From 6b3abf130c8851ce925fb56aae5156df44637b6a Mon Sep 17 00:00:00 2001 From: MrMCake Date: Tue, 30 Aug 2022 21:42:58 +0200 Subject: [PATCH 01/15] [Modules] Updated DataFactory/Factories to new dependency approach --- .../workflows/ms.datafactory.factories.yml | 3 +- .../.test/default/dependencies.bicep | 133 +++++++++++++++++ .../factories/.test/default/deploy.test.bicep | 117 +++++++++++++++ .../factories/.test/min.parameters.json | 9 -- .../factories/.test/min/deploy.test.bicep | 37 +++++ .../factories/.test/parameters.json | 100 ------------- .../Microsoft.DataFactory/factories/readme.md | 140 +++++++++--------- utilities/tools/Set-ModuleReadMe.ps1 | 6 +- 8 files changed, 361 insertions(+), 184 deletions(-) create mode 100644 modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep create mode 100644 modules/Microsoft.DataFactory/factories/.test/default/deploy.test.bicep delete mode 100644 modules/Microsoft.DataFactory/factories/.test/min.parameters.json create mode 100644 modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep delete mode 100644 modules/Microsoft.DataFactory/factories/.test/parameters.json diff --git a/.github/workflows/ms.datafactory.factories.yml b/.github/workflows/ms.datafactory.factories.yml index 162c0ed643..bbc3fb8aba 100644 --- a/.github/workflows/ms.datafactory.factories.yml +++ b/.github/workflows/ms.datafactory.factories.yml @@ -106,8 +106,7 @@ jobs: - name: 'Using test file [${{ matrix.moduleTestFilePaths }}]' uses: ./.github/actions/templates/validateModuleDeployment with: - templateFilePath: '${{ env.modulePath }}/deploy.bicep' - parameterFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' + templateFilePath: '${{ env.modulePath }}/${{ matrix.moduleTestFilePaths }}' location: '${{ env.location }}' resourceGroupName: '${{ env.resourceGroupName }}' subscriptionId: '${{ secrets.ARM_SUBSCRIPTION_ID }}' diff --git a/modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep b/modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep new file mode 100644 index 0000000000..99c3536651 --- /dev/null +++ b/modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep @@ -0,0 +1,133 @@ +@description('Optional. The location to deploy resources to.') +param location string = resourceGroup().location + +@description('Required. The name of the Virtual Network to create.') +param virtualNetworkName string + +@description('Required. The name of the Key Vault to create.') +param keyVaultName string + +@description('Required. The name of the Managed Identity to create.') +param managedIdentityName string + +@description('Required. The name of the Storage Account to create.') +param storageAccountName string + +resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { + name: virtualNetworkName + location: location + properties: { + addressSpace: { + addressPrefixes: [ + '10.0.0.0/24' + ] + } + subnets: [ + { + name: 'defaultSubnet' + properties: { + addressPrefix: '10.0.0.0/24' + } + } + ] + } +} + +resource privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { + name: 'privatelink.datafactory.azure.net' + location: 'global' + + resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { + name: '${virtualNetworkName}-vnetlink' + location: 'global' + properties: { + virtualNetwork: { + id: virtualNetwork.id + } + registrationEnabled: false + } + } +} + +resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { + name: keyVaultName + location: location + properties: { + sku: { + family: 'A' + name: 'standard' + } + tenantId: tenant().tenantId + enablePurgeProtection: null + enabledForTemplateDeployment: true + enabledForDiskEncryption: true + enabledForDeployment: true + enableRbacAuthorization: true + accessPolicies: [] + } + + resource key 'keys@2022-07-01' = { + name: 'encryptionKey' + properties: { + kty: 'RSA' + } + } +} + +resource keyPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = { + name: guid('msi-${managedIdentityName}-KeyVault-Key-Read-RoleAssignment') + scope: keyVault::key + properties: { + principalId: managedIdentity.properties.principalId + // Key Vault Crypto User + roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '12338af0-0e69-4776-bea7-57ae8d297424') + principalType: 'ServicePrincipal' + } +} + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = { + name: storageAccountName + location: location + kind: 'StorageV2' + sku: { + name: 'Standard_LRS' + } + properties: { + allowBlobPublicAccess: false + } +} + +@description('The resource ID of the created Virtual Network Subnet.') +output subnetResourceId string = virtualNetwork.properties.subnets[0].id + +@description('The resource ID of the created Virtual Network Subnet.') +output privateDNSResourceId string = privateDNSZone.id + +@description('The resource ID of the created Key Vault.') +output keyVaultResourceId string = keyVault.id + +@description('The URL of the created Key Vault.') +output keyVaultUrl string = keyVault.properties.vaultUri + +@description('The principal ID of the created Managed Identity.') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId + +@description('The resource ID of the created Managed Identity.') +output managedIdentityResourceId string = managedIdentity.id + +@description('The name of the created Key Vault Encryption Key.') +output keyVaultEncryptionKeyName string = keyVault::key.name + +@description('The resource ID of the created Storage Account.') +output storageAccountResourceId string = storageAccount.id + +@description('The name of the created Storage Account.') +output storageAccountName string = storageAccount.name + +@description('The Blob Endpoint of the created Storage Account.') +output storageAccountBlobEndpoint string = storageAccount.properties.primaryEndpoints.blob diff --git a/modules/Microsoft.DataFactory/factories/.test/default/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/default/deploy.test.bicep new file mode 100644 index 0000000000..ef6a36dcfe --- /dev/null +++ b/modules/Microsoft.DataFactory/factories/.test/default/deploy.test.bicep @@ -0,0 +1,117 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.datafactory.factories-${serviceShort}-rg' + +@description('Optional. The location to deploy resources to') +param location string = deployment().location + +@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +param serviceShort string = 'dffdef' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +module resourceGroupResources 'dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-paramNested' + params: { + virtualNetworkName: 'dep-<>-vnet-${serviceShort}' + keyVaultName: 'dep-<>-kv-${serviceShort}' + managedIdentityName: 'dep-<>-msi-${serviceShort}' + storageAccountName: 'dep<>st${serviceShort}' + } +} + +// Diagnostics +// =========== +module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnostic.dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-diagnosticDependencies' + params: { + storageAccountName: 'dep<>diasa${serviceShort}01' + logAnalyticsWorkspaceName: 'dep-<>-law-${serviceShort}' + eventHubNamespaceEventHubName: 'dep-<>-evh-${serviceShort}' + eventHubNamespaceName: 'dep-<>-evhns-${serviceShort}' + location: location + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + cMKKeyName: resourceGroupResources.outputs.keyVaultEncryptionKeyName + cMKKeyVaultResourceId: resourceGroupResources.outputs.keyVaultResourceId + cMKUserAssignedIdentityResourceId: resourceGroupResources.outputs.managedIdentityResourceId + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId + diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId + diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId + diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName + gitConfigureLater: true + integrationRuntime: { + managedVirtualNetworkName: 'default' + name: 'AutoResolveIntegrationRuntime' + type: 'Managed' + typeProperties: { + computeProperties: { + location: 'AutoResolve' + } + } + } + lock: 'CanNotDelete' + managedPrivateEndpoints: [ + { + fqdns: [ + resourceGroupResources.outputs.storageAccountBlobEndpoint + ] + groupId: 'blob' + name: '${resourceGroupResources.outputs.storageAccountName}-managed-privateEndpoint' + privateLinkResourceId: resourceGroupResources.outputs.storageAccountResourceId + } + ] + managedVirtualNetworkName: 'default' + privateEndpoints: [ + { + privateDnsZoneGroups: { + privateDNSResourceIds: [ + resourceGroupResources.outputs.privateDNSResourceId + ] + } + service: 'dataFactory' + subnetResourceId: resourceGroupResources.outputs.subnetResourceId + } + ] + publicNetworkAccess: 'Disabled' + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] + systemAssignedIdentity: true + userAssignedIdentities: { + '${resourceGroupResources.outputs.managedIdentityResourceId}': {} + } + } +} diff --git a/modules/Microsoft.DataFactory/factories/.test/min.parameters.json b/modules/Microsoft.DataFactory/factories/.test/min.parameters.json deleted file mode 100644 index f432bf3874..0000000000 --- a/modules/Microsoft.DataFactory/factories/.test/min.parameters.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-adf-min-001" - } - } -} diff --git a/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep new file mode 100644 index 0000000000..a9a1365ce1 --- /dev/null +++ b/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep @@ -0,0 +1,37 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.datafactory.factories-${serviceShort}-rg' + +@description('Optional. The location to deploy resources to') +param location string = deployment().location + +@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +param serviceShort string = 'dffmin' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + } +} diff --git a/modules/Microsoft.DataFactory/factories/.test/parameters.json b/modules/Microsoft.DataFactory/factories/.test/parameters.json deleted file mode 100644 index 53bdc9cc7b..0000000000 --- a/modules/Microsoft.DataFactory/factories/.test/parameters.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-adf-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "managedVirtualNetworkName": { - "value": "default" - }, - "managedPrivateEndpoints": { - "value": [ - { - "name": "adp<>azsax001-managed-privateEndpoint", - "groupId": "blob", - "fqdns": [ - "adp<>azsax001.blob.core.windows.net" - ], - "privateLinkResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - } - ] - }, - "integrationRuntime": { - "value": { - "name": "AutoResolveIntegrationRuntime", - "type": "Managed", - "managedVirtualNetworkName": "default", - "typeProperties": { - "computeProperties": { - "location": "AutoResolve" - } - } - } - }, - "publicNetworkAccess": { - "value": "Disabled" - }, - "gitConfigureLater": { - "value": true - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - }, - "diagnosticLogsRetentionInDays": { - "value": 7 - }, - "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" - }, - "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" - }, - "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" - }, - "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "privateEndpoints": { - "value": [ - { - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints", - "service": "dataFactory", - "privateDnsZoneGroups": { - "privateDNSResourceIds": [ - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.datafactory.azure.net" - ] - } - } - ] - }, - "cMKUserAssignedIdentityResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" - }, - "cMKKeyName": { - "value": "keyEncryptionKey" - }, - "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" - } - } -} diff --git a/modules/Microsoft.DataFactory/factories/readme.md b/modules/Microsoft.DataFactory/factories/readme.md index 9f6e6f6502..88443729cd 100644 --- a/modules/Microsoft.DataFactory/factories/readme.md +++ b/modules/Microsoft.DataFactory/factories/readme.md @@ -353,64 +353,27 @@ The following module usage examples are retrieved from the content of the files >**Note**: The name of each example is based on the name of the file from which it is taken. >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -

Example 1: Min

+

Example 1: Default

via Bicep module ```bicep -module factories './Microsoft.DataFactory/factories/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-factories' - params: { - name: '<>-adf-min-001' - } -} -``` - -
-

- -

- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-adf-min-001" - } - } -} -``` - -
-

- -

Example 2: Parameters

- -
- -via Bicep module - -```bicep -module factories './Microsoft.DataFactory/factories/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-factories' +module Factories './Microsoft.Datafactory/Factories/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-dffdef' params: { // Required parameters - name: '<>-adf-001' + name: '<>dffdef001' // Non-required parameters - cMKKeyName: 'keyEncryptionKey' - cMKKeyVaultResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002' - cMKUserAssignedIdentityResourceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + cMKKeyName: '' + cMKKeyVaultResourceId: '' + cMKUserAssignedIdentityResourceId: '' + diagnosticEventHubAuthorizationRuleId: '' + diagnosticEventHubName: '' diagnosticLogsRetentionInDays: 7 - diagnosticStorageAccountId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' - diagnosticWorkspaceId: '/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001' + diagnosticStorageAccountId: '' + diagnosticWorkspaceId: '' gitConfigureLater: true integrationRuntime: { managedVirtualNetworkName: 'default' @@ -426,11 +389,11 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { managedPrivateEndpoints: [ { fqdns: [ - 'adp<>azsax001.blob.core.windows.net' + '' ] groupId: 'blob' - name: 'adp<>azsax001-managed-privateEndpoint' - privateLinkResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001' + name: '${resourceGroupResources.outputs.storageAccountName}-managed-privateEndpoint' + privateLinkResourceId: '' } ] managedVirtualNetworkName: 'default' @@ -438,25 +401,25 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { { privateDnsZoneGroups: { privateDNSResourceIds: [ - '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.datafactory.azure.net' + '' ] } service: 'dataFactory' - subnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints' + subnetResourceId: '' } ] publicNetworkAccess: 'Disabled' roleAssignments: [ { principalIds: [ - '<>' + '' ] roleDefinitionIdOrName: 'Reader' } ] systemAssignedIdentity: true userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + '': {} } } } @@ -476,32 +439,32 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { "parameters": { // Required parameters "name": { - "value": "<>-adf-001" + "value": "<>dffdef001" }, // Non-required parameters "cMKKeyName": { - "value": "keyEncryptionKey" + "value": "" }, "cMKKeyVaultResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-nopr-002" + "value": "" }, "cMKUserAssignedIdentityResourceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001" + "value": "" }, "diagnosticEventHubAuthorizationRuleId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey" + "value": "" }, "diagnosticEventHubName": { - "value": "adp-<>-az-evh-x-001" + "value": "" }, "diagnosticLogsRetentionInDays": { "value": 7 }, "diagnosticStorageAccountId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + "value": "" }, "diagnosticWorkspaceId": { - "value": "/subscriptions/<>/resourcegroups/validation-rg/providers/microsoft.operationalinsights/workspaces/adp-<>-az-law-x-001" + "value": "" }, "gitConfigureLater": { "value": true @@ -525,11 +488,11 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { "value": [ { "fqdns": [ - "adp<>azsax001.blob.core.windows.net" + "" ], "groupId": "blob", - "name": "adp<>azsax001-managed-privateEndpoint", - "privateLinkResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Storage/storageAccounts/adp<>azsax001" + "name": "${resourceGroupResources.outputs.storageAccountName}-managed-privateEndpoint", + "privateLinkResourceId": "" } ] }, @@ -541,11 +504,11 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { { "privateDnsZoneGroups": { "privateDNSResourceIds": [ - "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/privatelink.datafactory.azure.net" + "" ] }, "service": "dataFactory", - "subnetResourceId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-001/subnets/<>-az-subnet-x-005-privateEndpoints" + "subnetResourceId": "" } ] }, @@ -556,7 +519,7 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { "value": [ { "principalIds": [ - "<>" + "" ], "roleDefinitionIdOrName": "Reader" } @@ -567,7 +530,7 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { }, "userAssignedIdentities": { "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + "": {} } } } @@ -576,3 +539,40 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = {

+ +

Example 2: Min

+ +
+ +via Bicep module + +```bicep +module Factories './Microsoft.Datafactory/Factories/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-dffmin' + params: { + name: '<>dffmin001' + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "value": "<>dffmin001" + } + } +} +``` + +
+

diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index a1074fed21..6b922d65e8 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -883,9 +883,10 @@ function Set-DeploymentExamplesSection { '' ) + $TextInfo = (Get-Culture -Name 'en-US').TextInfo $moduleRoot = Split-Path $TemplateFilePath -Parent - $resourceTypeIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') - $resourceType = $resourceTypeIdentifier.Split('/')[1] + $resourceTypeIdentifier = $TextInfo.ToTitleCase($moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/')) + $resourceType = $TextInfo.ToTitleCase($resourceTypeIdentifier.Split('/')[1]) $testFilePaths = Get-ModuleTestFileList -ModulePath $moduleRoot | ForEach-Object { Join-Path $moduleRoot $_ } $RequiredParametersList = $TemplateFileContent.parameters.Keys | Where-Object { $TemplateFileContent.parameters[$_].Keys -notcontains 'defaultValue' } | Sort-Object @@ -906,7 +907,6 @@ function Set-DeploymentExamplesSection { } else { $exampleTitle = ((Split-Path $testFilePath -LeafBase) -replace '\.', ' ') -replace ' parameters', '' } - $TextInfo = (Get-Culture -Name 'en-US').TextInfo $exampleTitle = $TextInfo.ToTitleCase($exampleTitle) $SectionContent += @( '

Example {0}: {1}

' -f $pathIndex, $exampleTitle From 0e66d6ea9b075f7ce960700e536ae08640d7ff19 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 11:34:41 +0200 Subject: [PATCH 02/15] Update to latest --- .../Microsoft.DataFactory/factories/readme.md | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/modules/Microsoft.DataFactory/factories/readme.md b/modules/Microsoft.DataFactory/factories/readme.md index e9c62d9361..ff037586a0 100644 --- a/modules/Microsoft.DataFactory/factories/readme.md +++ b/modules/Microsoft.DataFactory/factories/readme.md @@ -360,45 +360,8 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module factories './Microsoft.DataFactory/factories/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-Factories' - params: { - name: '<>-adf-min-001' - } -} -``` - - -

- -

- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-adf-min-001" - } - } -} -``` - -
-

- -

Example 2: Parameters

- -
- -via Bicep module - -```bicep -module factories './Microsoft.DataFactory/factories/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-Factories' +module Factories './Microsoft.DataFactory/Factories/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-dffdef' params: { // Required parameters name: '<>dffdef001' @@ -584,7 +547,7 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { via Bicep module ```bicep -module Factories './Microsoft.Datafactory/Factories/deploy.bicep' = { +module Factories './Microsoft.DataFactory/Factories/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-dffmin' params: { name: '<>dffmin001' From ac854785921f0b03d27ea1ad34f25d2219aca2c4 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 12:31:03 +0200 Subject: [PATCH 03/15] Update to latest --- .../factories/.test/default/dependencies.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep b/modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep index 99c3536651..5eef73e7e1 100644 --- a/modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep @@ -75,7 +75,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { } resource keyPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = { - name: guid('msi-${managedIdentityName}-KeyVault-Key-Read-RoleAssignment') + name: guid('msi-${keyVault::key.id}-${location}-${managedIdentity.id}-KeyVault-Key-Read-RoleAssignment') scope: keyVault::key properties: { principalId: managedIdentity.properties.principalId From f25d3498f3199dc3bd8a667204fad2233cac9c52 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 8 Sep 2022 19:04:36 +0200 Subject: [PATCH 04/15] Updated folder default to common. --- .../factories/.test/{default => common}/dependencies.bicep | 0 .../factories/.test/{default => common}/deploy.test.bicep | 0 modules/Microsoft.DataFactory/factories/readme.md | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) rename modules/Microsoft.DataFactory/factories/.test/{default => common}/dependencies.bicep (100%) rename modules/Microsoft.DataFactory/factories/.test/{default => common}/deploy.test.bicep (100%) diff --git a/modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep b/modules/Microsoft.DataFactory/factories/.test/common/dependencies.bicep similarity index 100% rename from modules/Microsoft.DataFactory/factories/.test/default/dependencies.bicep rename to modules/Microsoft.DataFactory/factories/.test/common/dependencies.bicep diff --git a/modules/Microsoft.DataFactory/factories/.test/default/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep similarity index 100% rename from modules/Microsoft.DataFactory/factories/.test/default/deploy.test.bicep rename to modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep diff --git a/modules/Microsoft.DataFactory/factories/readme.md b/modules/Microsoft.DataFactory/factories/readme.md index ff037586a0..8dcae0dc8a 100644 --- a/modules/Microsoft.DataFactory/factories/readme.md +++ b/modules/Microsoft.DataFactory/factories/readme.md @@ -353,14 +353,14 @@ The following module usage examples are retrieved from the content of the files >**Note**: The name of each example is based on the name of the file from which it is taken. >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -

Example 1: Default

+

Example 1: Common

via Bicep module ```bicep -module Factories './Microsoft.DataFactory/Factories/deploy.bicep' = { +module factories './Microsoft.DataFactory/factories/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-dffdef' params: { // Required parameters @@ -547,7 +547,7 @@ module Factories './Microsoft.DataFactory/Factories/deploy.bicep' = { via Bicep module ```bicep -module Factories './Microsoft.DataFactory/Factories/deploy.bicep' = { +module factories './Microsoft.DataFactory/factories/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-dffmin' params: { name: '<>dffmin001' From fc1ad4f139f05fb174f8946b049fd1eef6b26b3c Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:50:35 +0200 Subject: [PATCH 05/15] Update to latest --- .../factories/.test/common/deploy.test.bicep | 4 ++-- .../factories/.test/min/deploy.test.bicep | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep index ef6a36dcfe..3c98f97846 100644 --- a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep @@ -10,8 +10,8 @@ param resourceGroupName string = 'ms.datafactory.factories-${serviceShort}-rg' @description('Optional. The location to deploy resources to') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') -param serviceShort string = 'dffdef' +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +param serviceShort string = 'dffcom' // =========== // // Deployments // diff --git a/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep index a9a1365ce1..9f2c8dfbab 100644 --- a/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.datafactory.factories-${serviceShort}-rg' @description('Optional. The location to deploy resources to') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment .Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') param serviceShort string = 'dffmin' // =========== // From b43dd1b2a95dec86362efc993d3b0c0e243a1cf0 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:03:34 +0200 Subject: [PATCH 06/15] Update to latest --- .../factories/.test/common/deploy.test.bicep | 6 +++--- .../factories/.test/min/deploy.test.bicep | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep index 3c98f97846..42f4f27ece 100644 --- a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for a testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.datafactory.factories-${serviceShort}-rg' -@description('Optional. The location to deploy resources to') +@description('Optional. The location to deploy resources to.') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') param serviceShort string = 'dffcom' // =========== // diff --git a/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep index 9f2c8dfbab..7003385a80 100644 --- a/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for a testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.datafactory.factories-${serviceShort}-rg' -@description('Optional. The location to deploy resources to') +@description('Optional. The location to deploy resources to.') param location string = deployment().location -@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints') +@description('Optional. A short identifier for the kind of deployment. Should be kept short to not run into resource-name length-constraints.') param serviceShort string = 'dffmin' // =========== // From 1579aefe7c638514f0d0b269d38fcb31503a084e Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:42:52 +0200 Subject: [PATCH 07/15] Update to latest --- modules/Microsoft.DataFactory/factories/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.DataFactory/factories/readme.md b/modules/Microsoft.DataFactory/factories/readme.md index 26d7523fb5..3a40f89e29 100644 --- a/modules/Microsoft.DataFactory/factories/readme.md +++ b/modules/Microsoft.DataFactory/factories/readme.md @@ -362,10 +362,10 @@ The following module usage examples are retrieved from the content of the files ```bicep module factories './Microsoft.DataFactory/factories/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dffdef' + name: '${uniqueString(deployment().name)}-test-dffcom' params: { // Required parameters - name: '<>dffdef001' + name: '<>dffcom001' // Non-required parameters cMKKeyName: '' cMKKeyVaultResourceId: '' @@ -440,7 +440,7 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { "parameters": { // Required parameters "name": { - "value": "<>dffdef001" + "value": "<>dffcom001" }, // Non-required parameters "cMKKeyName": { From dcf3b9dc92d5933d44ee3c6937e51ac3cd334cfb Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 19 Sep 2022 15:34:40 +0200 Subject: [PATCH 08/15] First commit --- utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 | 1 + 1 file changed, 1 insertion(+) create mode 100644 utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 diff --git a/utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 b/utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 new file mode 100644 index 0000000000..5f282702bb --- /dev/null +++ b/utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 @@ -0,0 +1 @@ + \ No newline at end of file From 6049b111f04ac8813234edf215116cd453271550 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 20:09:53 +0200 Subject: [PATCH 09/15] Update modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep --- .../factories/.test/common/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep index 42f4f27ece..e2913d1f52 100644 --- a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes.') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.datafactory.factories-${serviceShort}-rg' From 59d9644720684e762a7ab50e3cc0f6c8445c1a8f Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 20:10:07 +0200 Subject: [PATCH 10/15] Update modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep --- .../Microsoft.DataFactory/factories/.test/min/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep index 7003385a80..25b40c4dbf 100644 --- a/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/min/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes.') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.datafactory.factories-${serviceShort}-rg' From 296a3e18609d053da584d3db1d976f09fd6b5b40 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 19 Sep 2022 20:10:41 +0200 Subject: [PATCH 11/15] Update to latest --- utilities/tools/Set-ModuleReadMe.ps1 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index 6469605289..25923c3d62 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -896,13 +896,6 @@ function Set-DeploymentExamplesSection { '' ) -<<<<<<< HEAD - $TextInfo = (Get-Culture -Name 'en-US').TextInfo - $moduleRoot = Split-Path $TemplateFilePath -Parent - $fullIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') - -======= ->>>>>>> main # Get resource type and make first letter upper case. Requires manual handling as ToTitleCase lowercases everything but the first letter $providerNamespace = ($fullModuleIdentifier.Split('/')[0] -split '\.' | ForEach-Object { $_.Substring(0, 1).ToUpper() + $_.Substring(1) }) -join '.' $resourceType = $fullModuleIdentifier.Split('/')[1] From 35b0c9c78da514a3c3715a621f328de234e78812 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 20:22:55 +0200 Subject: [PATCH 12/15] Update modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../factories/.test/common/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep index c36c233594..ac625e9f8e 100644 --- a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep @@ -98,7 +98,7 @@ module testDeployment '../../deploy.bicep' = { managedVirtualNetworkName: 'default' privateEndpoints: [ { - privateDnsZoneGroups: { + privateDnsZoneGroup: { privateDNSResourceIds: [ resourceGroupResources.outputs.privateDNSResourceId ] From 30929e624c364542ec12832641b7f0f5ae1e7022 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Wed, 12 Oct 2022 11:27:06 +0200 Subject: [PATCH 13/15] Update modules/Microsoft.DataFactory/factories/.test/common/dependencies.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../factories/.test/common/dependencies.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DataFactory/factories/.test/common/dependencies.bicep b/modules/Microsoft.DataFactory/factories/.test/common/dependencies.bicep index 5eef73e7e1..5317c0c39b 100644 --- a/modules/Microsoft.DataFactory/factories/.test/common/dependencies.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/common/dependencies.bicep @@ -105,7 +105,7 @@ resource storageAccount 'Microsoft.Storage/storageAccounts@2021-08-01' = { @description('The resource ID of the created Virtual Network Subnet.') output subnetResourceId string = virtualNetwork.properties.subnets[0].id -@description('The resource ID of the created Virtual Network Subnet.') +@description('The resource ID of the created Private DNS Zone.') output privateDNSResourceId string = privateDNSZone.id @description('The resource ID of the created Key Vault.') From 84fd9c39ea2b9405ae93b49f073933090d5a20a1 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Wed, 12 Oct 2022 11:27:13 +0200 Subject: [PATCH 14/15] Update modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../factories/.test/common/deploy.test.bicep | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep index ac625e9f8e..34409149cc 100644 --- a/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep +++ b/modules/Microsoft.DataFactory/factories/.test/common/deploy.test.bicep @@ -107,7 +107,6 @@ module testDeployment '../../deploy.bicep' = { subnetResourceId: resourceGroupResources.outputs.subnetResourceId } ] - publicNetworkAccess: 'Disabled' roleAssignments: [ { principalIds: [ From 4fd661a5171490b5eaf94ce571288b2d3b8b7391 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Wed, 12 Oct 2022 11:28:06 +0200 Subject: [PATCH 15/15] Update to latest --- modules/Microsoft.DataFactory/factories/readme.md | 6 ------ utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 | 1 - 2 files changed, 7 deletions(-) delete mode 100644 utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 diff --git a/modules/Microsoft.DataFactory/factories/readme.md b/modules/Microsoft.DataFactory/factories/readme.md index 9eb7ca9679..c01ede8a7d 100644 --- a/modules/Microsoft.DataFactory/factories/readme.md +++ b/modules/Microsoft.DataFactory/factories/readme.md @@ -25,13 +25,11 @@ ## Parameters **Required parameters** - | Parameter Name | Type | Description | | :-- | :-- | :-- | | `name` | string | The name of the Azure Factory to create. | **Optional parameters** - | Parameter Name | Type | Default Value | Allowed Values | Description | | :-- | :-- | :-- | :-- | :-- | | `cMKKeyName` | string | `''` | | The name of the customer managed key to use for encryption. | @@ -417,7 +415,6 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { subnetResourceId: '' } ] - publicNetworkAccess: 'Disabled' roleAssignments: [ { principalIds: [ @@ -527,9 +524,6 @@ module factories './Microsoft.DataFactory/factories/deploy.bicep' = { } ] }, - "publicNetworkAccess": { - "value": "Disabled" - }, "roleAssignments": { "value": [ { diff --git a/utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 b/utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 deleted file mode 100644 index 5f282702bb..0000000000 --- a/utilities/tools/REST2CARML/Set-ModuleFolderData.ps1 +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file