From 709054c9b8f178631829c6cdf6c24dc61dd648df Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 13:46:32 +0200 Subject: [PATCH 01/17] Initial draft --- .../ms.dbforpostgresql.flexibleservers.yml | 3 +- .../flexibleServers/.test/min.parameters.json | 26 ----- .../.test/min/dependencies.bicep | 85 +++++++++++++++ .../.test/min/deploy.test.bicep | 63 +++++++++++ .../.test/private.parameters.json | 76 ------------- .../.test/private/dependencies.bicep | 85 +++++++++++++++ .../.test/private/deploy.test.bicep | 63 +++++++++++ .../.test/public.parameters.json | 102 ------------------ .../.test/public/dependencies.bicep | 85 +++++++++++++++ .../.test/public/deploy.test.bicep | 63 +++++++++++ 10 files changed, 445 insertions(+), 206 deletions(-) delete mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min.parameters.json create mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/dependencies.bicep create mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep delete mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private.parameters.json create mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep create mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep delete mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public.parameters.json create mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/dependencies.bicep create mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep diff --git a/.github/workflows/ms.dbforpostgresql.flexibleservers.yml b/.github/workflows/ms.dbforpostgresql.flexibleservers.yml index e320fc7a46..ea4b928fb7 100644 --- a/.github/workflows/ms.dbforpostgresql.flexibleservers.yml +++ b/.github/workflows/ms.dbforpostgresql.flexibleservers.yml @@ -109,8 +109,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.DBforPostgreSQL/flexibleServers/.test/min.parameters.json b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min.parameters.json deleted file mode 100644 index c2f6ed475a..0000000000 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min.parameters.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-postgresqlflexserver-min-001" - }, - "skuName": { - "value": "Standard_B2s" - }, - "tier": { - "value": "Burstable" - }, - "administratorLogin": { - "value": "adminUserName" - }, - "administratorLoginPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLoginPassword" - } - } - } -} diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/dependencies.bicep new file mode 100644 index 0000000000..6ae656b61a --- /dev/null +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/dependencies.bicep @@ -0,0 +1,85 @@ +@description('Optional. The location to deploy 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 + +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 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 privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { + name: 'privatelink.azconfig.io' + location: 'global' + + resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { + name: '${virtualNetworkName}-vnetlink' + location: 'global' + properties: { + virtualNetwork: { + id: virtualNetwork.id + } + } + } +} + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +@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 Key Vault.') +output keyVaultResourceId string = keyVault.id + +@description('The URL of the created Key Vault.') +output keyVaultUrl string = keyVault.properties.vaultUri + +@description('The resource ID of the created Virtual Network Subnet.') +output privateDNSResourceId string = privateDNSZone.id + +@description('The principal ID of the created Managed Identity.') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId + diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep new file mode 100644 index 0000000000..3c03d4ffa3 --- /dev/null +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep @@ -0,0 +1,63 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${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 = '...' + +// =========== // +// 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}' + } +} + +// 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' + } +} + + diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private.parameters.json b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private.parameters.json deleted file mode 100644 index ed8f972498..0000000000 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private.parameters.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-postgresqlflexserver-private-001" - }, - "skuName": { - "value": "Standard_D2s_v3" - }, - "tier": { - "value": "GeneralPurpose" - }, - "administratorLogin": { - "value": "adminUserName" - }, - "administratorLoginPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLoginPassword" - } - }, - "geoRedundantBackup": { - "value": "Enabled" - }, - "delegatedSubnetResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-postgres/subnets/<>-az-subnet-x-postgres" - }, - "privateDnsZoneArmResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/<>.postgres.database.azure.com" - }, - "databases": { - "value": [ - { - "name": "testdb1", - "collation": "en_US.utf8", - "charset": "UTF8" - }, - { - "name": "testdb2" - } - ] - }, - "configurations": { - "value": [ - { - "name": "log_min_messages", - "source": "user-override", - "value": "INFO" - }, - { - "name": "autovacuum_naptime", - "source": "user-override", - "value": "80" - } - ] - }, - "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" - } - } -} diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep new file mode 100644 index 0000000000..6ae656b61a --- /dev/null +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep @@ -0,0 +1,85 @@ +@description('Optional. The location to deploy 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 + +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 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 privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { + name: 'privatelink.azconfig.io' + location: 'global' + + resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { + name: '${virtualNetworkName}-vnetlink' + location: 'global' + properties: { + virtualNetwork: { + id: virtualNetwork.id + } + } + } +} + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +@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 Key Vault.') +output keyVaultResourceId string = keyVault.id + +@description('The URL of the created Key Vault.') +output keyVaultUrl string = keyVault.properties.vaultUri + +@description('The resource ID of the created Virtual Network Subnet.') +output privateDNSResourceId string = privateDNSZone.id + +@description('The principal ID of the created Managed Identity.') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId + diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep new file mode 100644 index 0000000000..3c03d4ffa3 --- /dev/null +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep @@ -0,0 +1,63 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${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 = '...' + +// =========== // +// 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}' + } +} + +// 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' + } +} + + diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public.parameters.json b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public.parameters.json deleted file mode 100644 index 8eacc69760..0000000000 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public.parameters.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-postgresqlflexserver-public-001" - }, - "skuName": { - "value": "Standard_D2s_v3" - }, - "tier": { - "value": "GeneralPurpose" - }, - "administratorLogin": { - "value": "adminUserName" - }, - "administratorLoginPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLoginPassword" - } - }, - "availabilityZone": { - "value": "2" - }, - "backupRetentionDays": { - "value": 20 - }, - "geoRedundantBackup": { - "value": "Enabled" - }, - "storageSizeGB": { - "value": 1024 - }, - "version": { - "value": "14" - }, - "highAvailability": { - "value": "SameZone" - }, - "location": { - "value": "westeurope" - }, - "firewallRules": { - "value": [ - { - "name": "AllowAllWindowsAzureIps", - "endIpAddress": "0.0.0.0", - "startIpAddress": "0.0.0.0" - }, - { - "name": "test-rule1", - "startIpAddress": "10.10.10.1", - "endIpAddress": "10.10.10.10" - }, - { - "name": "test-rule2", - "startIpAddress": "100.100.100.1", - "endIpAddress": "100.100.100.10" - } - ] - }, - "databases": { - "value": [ - { - "name": "testdb1", - "collation": "en_US.utf8", - "charset": "UTF8" - }, - { - "name": "testdb2" - } - ] - }, - "configurations": { - "value": [ - { - "name": "log_min_messages", - "source": "user-override", - "value": "INFO" - } - ] - }, - "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" - } - } -} diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/dependencies.bicep new file mode 100644 index 0000000000..6ae656b61a --- /dev/null +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/dependencies.bicep @@ -0,0 +1,85 @@ +@description('Optional. The location to deploy 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 + +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 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 privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { + name: 'privatelink.azconfig.io' + location: 'global' + + resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { + name: '${virtualNetworkName}-vnetlink' + location: 'global' + properties: { + virtualNetwork: { + id: virtualNetwork.id + } + } + } +} + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +@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 Key Vault.') +output keyVaultResourceId string = keyVault.id + +@description('The URL of the created Key Vault.') +output keyVaultUrl string = keyVault.properties.vaultUri + +@description('The resource ID of the created Virtual Network Subnet.') +output privateDNSResourceId string = privateDNSZone.id + +@description('The principal ID of the created Managed Identity.') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId + diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep new file mode 100644 index 0000000000..3c03d4ffa3 --- /dev/null +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep @@ -0,0 +1,63 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${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 = '...' + +// =========== // +// 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}' + } +} + +// 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' + } +} + + From 937b51dace310fcbf74a2edc5bf54db81ee58cc3 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 14:06:20 +0200 Subject: [PATCH 02/17] Updated Postgre Flexible Servers to new dependency approach --- .../.test/min/dependencies.bicep | 85 -------------- .../.test/min/deploy.test.bicep | 36 ++---- .../.test/private/dependencies.bicep | 43 +++----- .../.test/private/deploy.test.bicep | 44 +++++++- .../.test/public/dependencies.bicep | 85 -------------- .../.test/public/deploy.test.bicep | 68 +++++++++--- .../flexibleServers/readme.md | 104 +++++++----------- 7 files changed, 154 insertions(+), 311 deletions(-) delete mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/dependencies.bicep delete mode 100644 modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/dependencies.bicep diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/dependencies.bicep deleted file mode 100644 index 6ae656b61a..0000000000 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/dependencies.bicep +++ /dev/null @@ -1,85 +0,0 @@ -@description('Optional. The location to deploy 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 - -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 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 privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { - name: 'privatelink.azconfig.io' - location: 'global' - - resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { - name: '${virtualNetworkName}-vnetlink' - location: 'global' - properties: { - virtualNetwork: { - id: virtualNetwork.id - } - } - } -} - -resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { - name: managedIdentityName - location: location -} - -@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 Key Vault.') -output keyVaultResourceId string = keyVault.id - -@description('The URL of the created Key Vault.') -output keyVaultUrl string = keyVault.properties.vaultUri - -@description('The resource ID of the created Virtual Network Subnet.') -output privateDNSResourceId string = privateDNSZone.id - -@description('The principal ID of the created Managed Identity.') -output managedIdentityPrincipalId string = managedIdentity.properties.principalId - diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep index 3c03d4ffa3..e8cadf543c 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep @@ -11,7 +11,11 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = '...' +param serviceShort string = 'dpsqlfsmin' + +@description('Optional. The password to leverage for the login.') +@secure() +param password string = newGuid() // =========== // // Deployments // @@ -24,30 +28,6 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { 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}' - } -} - -// 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 // // ============== // @@ -57,7 +37,9 @@ module testDeployment '../../deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { name: '<>${serviceShort}001' + administratorLogin: 'adminUserName' + administratorLoginPassword: password + skuName: 'Standard_B2s' + tier: 'Burstable' } } - - diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep index 6ae656b61a..fad169f563 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep @@ -4,19 +4,19 @@ 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 Private DNS Zone to create.') +param privateDNSZoneName string + resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { name: virtualNetworkName location: location properties: { addressSpace: { addressPrefixes: [ - '10.0.0.0/24' + '10.0.0.0/24' ] } subnets: [ @@ -24,32 +24,22 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { name: 'defaultSubnet' properties: { addressPrefix: '10.0.0.0/24' + delegations: [ + { + name: 'Microsoft.DBforPostgreSQL.flexibleServers' + properties: { + serviceName: 'Microsoft.DBforPostgreSQL/flexibleServers' + } + } + ] } } ] } } -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 privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { - name: 'privatelink.azconfig.io' + name: privateDNSZoneName location: 'global' resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { @@ -71,15 +61,8 @@ resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018- @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 Key Vault.') -output keyVaultResourceId string = keyVault.id - -@description('The URL of the created Key Vault.') -output keyVaultUrl string = keyVault.properties.vaultUri - @description('The resource ID of the created Virtual Network Subnet.') output privateDNSResourceId string = privateDNSZone.id @description('The principal ID of the created Managed Identity.') output managedIdentityPrincipalId string = managedIdentity.properties.principalId - diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep index 3c03d4ffa3..0822cb5dae 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep @@ -11,7 +11,11 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = '...' +param serviceShort string = 'dpsqlfsprivate' + +@description('Optional. The password to leverage for the login.') +@secure() +param password string = newGuid() // =========== // // Deployments // @@ -29,8 +33,8 @@ module resourceGroupResources 'dependencies.bicep' = { name: '${uniqueString(deployment().name, location)}-paramNested' params: { virtualNetworkName: 'dep-<>-vnet-${serviceShort}' - keyVaultName: 'dep-<>-kv-${serviceShort}' managedIdentityName: 'dep-<>-msi-${serviceShort}' + privateDNSZoneName: '<>.postgres.database.azure.com' } } @@ -57,7 +61,39 @@ module testDeployment '../../deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { name: '<>${serviceShort}001' + administratorLogin: 'adminUserName' + administratorLoginPassword: password + skuName: 'Standard_D2s_v3' + tier: 'GeneralPurpose' + configurations: [ + { + name: 'log_min_messages' + source: 'user-override' + value: 'INFO' + } + { + name: 'autovacuum_naptime' + source: 'user-override' + value: '80' + } + ] + databases: [ + { + charset: 'UTF8' + collation: 'en_US.utf8' + name: 'testdb1' + } + { + name: 'testdb2' + } + ] + delegatedSubnetResourceId: resourceGroupResources.outputs.subnetResourceId + diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId + diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId + diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId + diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName + diagnosticLogsRetentionInDays: 7 + geoRedundantBackup: 'Enabled' + privateDnsZoneArmResourceId: resourceGroupResources.outputs.privateDNSResourceId } } - - diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/dependencies.bicep deleted file mode 100644 index 6ae656b61a..0000000000 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/dependencies.bicep +++ /dev/null @@ -1,85 +0,0 @@ -@description('Optional. The location to deploy 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 - -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 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 privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { - name: 'privatelink.azconfig.io' - location: 'global' - - resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { - name: '${virtualNetworkName}-vnetlink' - location: 'global' - properties: { - virtualNetwork: { - id: virtualNetwork.id - } - } - } -} - -resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { - name: managedIdentityName - location: location -} - -@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 Key Vault.') -output keyVaultResourceId string = keyVault.id - -@description('The URL of the created Key Vault.') -output keyVaultUrl string = keyVault.properties.vaultUri - -@description('The resource ID of the created Virtual Network Subnet.') -output privateDNSResourceId string = privateDNSZone.id - -@description('The principal ID of the created Managed Identity.') -output managedIdentityPrincipalId string = managedIdentity.properties.principalId - diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep index 3c03d4ffa3..2e7f1159f6 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep @@ -11,7 +11,11 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = '...' +param serviceShort string = 'dpsqlfspublic' + +@description('Optional. The password to leverage for the login.') +@secure() +param password string = newGuid() // =========== // // Deployments // @@ -24,16 +28,6 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { 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}' - } -} - // Diagnostics // =========== module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnostic.dependencies.bicep' = { @@ -57,7 +51,55 @@ module testDeployment '../../deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { name: '<>${serviceShort}001' + administratorLogin: 'adminUserName' + administratorLoginPassword: password + skuName: 'Standard_D2s_v3' + tier: 'GeneralPurpose' + availabilityZone: '2' + backupRetentionDays: 20 + configurations: [ + { + name: 'log_min_messages' + source: 'user-override' + value: 'INFO' + } + ] + databases: [ + { + charset: 'UTF8' + collation: 'en_US.utf8' + name: 'testdb1' + } + { + name: 'testdb2' + } + ] + diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId + diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId + diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId + diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName + diagnosticLogsRetentionInDays: 7 + firewallRules: [ + { + endIpAddress: '0.0.0.0' + name: 'AllowAllWindowsAzureIps' + startIpAddress: '0.0.0.0' + } + { + endIpAddress: '10.10.10.10' + name: 'test-rule1' + startIpAddress: '10.10.10.1' + } + { + endIpAddress: '100.100.100.10' + name: 'test-rule2' + startIpAddress: '100.100.100.1' + } + ] + geoRedundantBackup: 'Enabled' + highAvailability: 'SameZone' + location: location + storageSizeGB: 1024 + version: '14' } } - - diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md index c1b85273de..f6c46e3d55 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md @@ -335,18 +335,13 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { - name: 'adp-<>-az-kv-x-001' - scope: resourceGroup('<>','validation-rg') -} - module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-FlexibleServers' + name: '${uniqueString(deployment().name)}-test-dpsqlfsmin' params: { // Required parameters administratorLogin: 'adminUserName' - administratorLoginPassword: kv1.getSecret('administratorLoginPassword') - name: '<>-az-postgresqlflexserver-min-001' + administratorLoginPassword: '' + name: '<>dpsqlfsmin001' skuName: 'Standard_B2s' tier: 'Burstable' } @@ -370,15 +365,10 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "adminUserName" }, "administratorLoginPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLoginPassword" - } + "value": "" }, "name": { - "value": "<>-az-postgresqlflexserver-min-001" + "value": "<>dpsqlfsmin001" }, "skuName": { "value": "Standard_B2s" @@ -400,18 +390,13 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep via Bicep module ```bicep -resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { - name: 'adp-<>-az-kv-x-001' - scope: resourceGroup('<>','validation-rg') -} - module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-FlexibleServers' + name: '${uniqueString(deployment().name)}-test-dpsqlfsprivate' params: { // Required parameters administratorLogin: 'adminUserName' - administratorLoginPassword: kv1.getSecret('administratorLoginPassword') - name: '<>-az-postgresqlflexserver-private-001' + administratorLoginPassword: '' + name: '<>dpsqlfsprivate001' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -437,14 +422,14 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep name: 'testdb2' } ] - delegatedSubnetResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-postgres/subnets/<>-az-subnet-x-postgres' - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + delegatedSubnetResourceId: '' + 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: '' geoRedundantBackup: 'Enabled' - privateDnsZoneArmResourceId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/<>.postgres.database.azure.com' + privateDnsZoneArmResourceId: '' } } ``` @@ -466,15 +451,10 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "adminUserName" }, "administratorLoginPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLoginPassword" - } + "value": "" }, "name": { - "value": "<>-az-postgresqlflexserver-private-001" + "value": "<>dpsqlfsprivate001" }, "skuName": { "value": "Standard_D2s_v3" @@ -510,28 +490,28 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ] }, "delegatedSubnetResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/virtualNetworks/adp-<>-az-vnet-x-postgres/subnets/<>-az-subnet-x-postgres" + "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": "" }, "geoRedundantBackup": { "value": "Enabled" }, "privateDnsZoneArmResourceId": { - "value": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/privateDnsZones/<>.postgres.database.azure.com" + "value": "" } } } @@ -547,18 +527,13 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep via Bicep module ```bicep -resource kv1 'Microsoft.KeyVault/vaults@2019-09-01' existing = { - name: 'adp-<>-az-kv-x-001' - scope: resourceGroup('<>','validation-rg') -} - module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-FlexibleServers' + name: '${uniqueString(deployment().name)}-test-dpsqlfspublic' params: { // Required parameters administratorLogin: 'adminUserName' - administratorLoginPassword: kv1.getSecret('administratorLoginPassword') - name: '<>-az-postgresqlflexserver-public-001' + administratorLoginPassword: '' + name: '<>dpsqlfspublic001' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -581,11 +556,11 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep name: 'testdb2' } ] - diagnosticEventHubAuthorizationRuleId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.EventHub/namespaces/adp-<>-az-evhns-x-001/AuthorizationRules/RootManageSharedAccessKey' - diagnosticEventHubName: 'adp-<>-az-evh-x-001' + 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: '' firewallRules: [ { endIpAddress: '0.0.0.0' @@ -605,7 +580,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ] geoRedundantBackup: 'Enabled' highAvailability: 'SameZone' - location: 'westeurope' + location: '' storageSizeGB: 1024 version: '14' } @@ -629,15 +604,10 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "adminUserName" }, "administratorLoginPassword": { - "reference": { - "keyVault": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001" - }, - "secretName": "administratorLoginPassword" - } + "value": "" }, "name": { - "value": "<>-az-postgresqlflexserver-public-001" + "value": "<>dpsqlfspublic001" }, "skuName": { "value": "Standard_D2s_v3" @@ -674,19 +644,19 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ] }, "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": "" }, "firewallRules": { "value": [ @@ -714,7 +684,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "SameZone" }, "location": { - "value": "westeurope" + "value": "" }, "storageSizeGB": { "value": 1024 From e629ecc319356971f951377c2003edd34ccfce5b Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 14:25:45 +0200 Subject: [PATCH 03/17] Shortened names --- .../flexibleServers/.test/private/deploy.test.bicep | 2 +- .../flexibleServers/.test/public/deploy.test.bicep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep index 0822cb5dae..b9e6da94ac 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = 'dpsqlfsprivate' +param serviceShort string = 'dpsqlfspv' @description('Optional. The password to leverage for the login.') @secure() diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep index 2e7f1159f6..c59826112c 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = 'dpsqlfspublic' +param serviceShort string = 'dpsqlfspb' @description('Optional. The password to leverage for the login.') @secure() From a8cdd06ad4d2bfe7bbb669fbd5d8eb188ec840cd Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 14:26:48 +0200 Subject: [PATCH 04/17] Updated readme --- .../flexibleServers/readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md index f6c46e3d55..07f4662d4a 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md @@ -391,12 +391,12 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ```bicep module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dpsqlfsprivate' + name: '${uniqueString(deployment().name)}-test-dpsqlfspv' params: { // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dpsqlfsprivate001' + name: '<>dpsqlfspv001' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -454,7 +454,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dpsqlfsprivate001" + "value": "<>dpsqlfspv001" }, "skuName": { "value": "Standard_D2s_v3" @@ -528,12 +528,12 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ```bicep module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dpsqlfspublic' + name: '${uniqueString(deployment().name)}-test-dpsqlfspb' params: { // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dpsqlfspublic001' + name: '<>dpsqlfspb001' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -607,7 +607,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dpsqlfspublic001" + "value": "<>dpsqlfspb001" }, "skuName": { "value": "Standard_D2s_v3" From 9f569d5d3915fa43a0658bfcc320b88e96fd985d Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 17:01:04 +0200 Subject: [PATCH 05/17] Update to latest --- .../flexibleServers/.test/private/dependencies.bicep | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep index fad169f563..8b8e8b4cf6 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep @@ -43,12 +43,13 @@ resource privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { location: 'global' resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { - name: '${virtualNetworkName}-vnetlink' + name: '${split(privateDNSZoneName, '.')[0]}-vnet-link' location: 'global' properties: { virtualNetwork: { id: virtualNetwork.id } + registrationEnabled: false } } } From e38db3f395bf9893b44699bbb1223f5239674e6a Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sat, 3 Sep 2022 22:52:31 +0200 Subject: [PATCH 06/17] Adjusted name --- .../flexibleServers/.test/public/deploy.test.bicep | 2 +- modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep index c59826112c..b9cc3ba7b2 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep @@ -50,7 +50,7 @@ module testDeployment '../../deploy.bicep' = { scope: resourceGroup name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { - name: '<>${serviceShort}001' + name: '<>${serviceShort}002' administratorLogin: 'adminUserName' administratorLoginPassword: password skuName: 'Standard_D2s_v3' diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md index 07f4662d4a..28519f0c4a 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md @@ -533,7 +533,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dpsqlfspb001' + name: '<>dpsqlfspb002' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -607,7 +607,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dpsqlfspb001" + "value": "<>dpsqlfspb002" }, "skuName": { "value": "Standard_D2s_v3" From f4733d392ad62f64e7ec9518530fa88e94944bc8 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:50:30 +0200 Subject: [PATCH 07/17] Update to latest --- .../flexibleServers/.test/min/deploy.test.bicep | 2 +- .../flexibleServers/.test/private/deploy.test.bicep | 2 +- .../flexibleServers/.test/public/deploy.test.bicep | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep index e8cadf543c..6050860a6f 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh @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 = 'dpsqlfsmin' @description('Optional. The password to leverage for the login.') diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep index b9e6da94ac..05bc68c8b1 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh @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 = 'dpsqlfspv' @description('Optional. The password to leverage for the login.') diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep index b9cc3ba7b2..7beb8b335a 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh @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 = 'dpsqlfspb' @description('Optional. The password to leverage for the login.') From 9cb125af3f9f3133b0e49df14b70ce3ff11f51d4 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:03:29 +0200 Subject: [PATCH 08/17] Update to latest --- .../flexibleServers/.test/min/deploy.test.bicep | 6 +++--- .../flexibleServers/.test/private/deploy.test.bicep | 6 +++--- .../flexibleServers/.test/public/deploy.test.bicep | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep index 6050860a6f..045b825320 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.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.dbforpostgresql.flexibleservers-${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 = 'dpsqlfsmin' @description('Optional. The password to leverage for the login.') diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep index 05bc68c8b1..26ca097301 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/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.dbforpostgresql.flexibleservers-${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 = 'dpsqlfspv' @description('Optional. The password to leverage for the login.') diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep index 7beb8b335a..2139029bbe 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/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.dbforpostgresql.flexibleservers-${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 = 'dpsqlfspb' @description('Optional. The password to leverage for the login.') From 321d261861890a464fae833dcf9dee7262a4c0a7 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 08:17:01 +0200 Subject: [PATCH 09/17] Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep --- .../flexibleServers/.test/min/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep index 045b825320..2f41823397 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.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.dbforpostgresql.flexibleservers-${serviceShort}-rg' From 5d732e26c112053ecbcb8a54452758b206baf508 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 08:17:13 +0200 Subject: [PATCH 10/17] Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep --- .../flexibleServers/.test/private/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep index 26ca097301..98df9b7efb 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/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.dbforpostgresql.flexibleservers-${serviceShort}-rg' From fec157551e57aaeb08f5c5c2b215ad356a104705 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 19 Sep 2022 08:17:26 +0200 Subject: [PATCH 11/17] Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep --- .../flexibleServers/.test/public/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep index 2139029bbe..0d88e7af97 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/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.dbforpostgresql.flexibleservers-${serviceShort}-rg' From 1da413b47c74ae4f72be8a12bc7b5b8903847e55 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 17 Oct 2022 10:59:02 +0200 Subject: [PATCH 12/17] Update to latest --- .../flexibleServers/.test/private/dependencies.bicep | 7 ++----- .../flexibleServers/.test/private/deploy.test.bicep | 1 - utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) create mode 160000 utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep index 8b8e8b4cf6..2d9171b5fa 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep @@ -7,9 +7,6 @@ param virtualNetworkName string @description('Required. The name of the Managed Identity to create.') param managedIdentityName string -@description('Required. The name of the Private DNS Zone to create.') -param privateDNSZoneName string - resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { name: virtualNetworkName location: location @@ -39,11 +36,11 @@ resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-01-01' = { } resource privateDNSZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { - name: privateDNSZoneName + name: 'postgres.database.azure.com' location: 'global' resource virtualNetworkLinks 'virtualNetworkLinks@2020-06-01' = { - name: '${split(privateDNSZoneName, '.')[0]}-vnet-link' + name: '${virtualNetwork.name}-vnetlink' location: 'global' properties: { virtualNetwork: { diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep index 98df9b7efb..5e2ea318db 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep @@ -34,7 +34,6 @@ module resourceGroupResources 'dependencies.bicep' = { params: { virtualNetworkName: 'dep-<>-vnet-${serviceShort}' managedIdentityName: 'dep-<>-msi-${serviceShort}' - privateDNSZoneName: '<>.postgres.database.azure.com' } } diff --git a/utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs b/utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs new file mode 160000 index 0000000000..42b348107e --- /dev/null +++ b/utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs @@ -0,0 +1 @@ +Subproject commit 42b348107ef4a56801065d8d2b98dfb425044cf1 From 1f5a00d9415d42715cb77c8907b52ffa4a6f90ef Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 17 Oct 2022 10:59:23 +0200 Subject: [PATCH 13/17] Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../flexibleServers/.test/private/dependencies.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep index 2d9171b5fa..79f6a40138 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/dependencies.bicep @@ -59,7 +59,7 @@ resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018- @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 principal ID of the created Managed Identity.') From d701cede810a546b73eb0cdc0cb15ca88fff261e Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 17 Oct 2022 10:59:37 +0200 Subject: [PATCH 14/17] Update modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../flexibleServers/.test/min/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep index 2f41823397..aea1807bdb 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = 'dpsqlfsmin' +param serviceShort string = 'dbfpsqlfsmin' @description('Optional. The password to leverage for the login.') @secure() From 9a2f95cbc44eb01e389d03698201c89d519949b8 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 17 Oct 2022 11:02:53 +0200 Subject: [PATCH 15/17] Addressed comments --- .../.test/private/deploy.test.bicep | 2 +- .../.test/public/deploy.test.bicep | 2 +- .../flexibleServers/readme.md | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep index 5e2ea318db..b5aac4420d 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = 'dpsqlfspv' +param serviceShort string = 'dpsqlfspvt' @description('Optional. The password to leverage for the login.') @secure() diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep index 0d88e7af97..c4f63263e9 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = 'dpsqlfspb' +param serviceShort string = 'dpsqlfspub' @description('Optional. The password to leverage for the login.') @secure() diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md index 3ce996afec..b0212c3be6 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md @@ -337,12 +337,12 @@ The following module usage examples are retrieved from the content of the files ```bicep module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dpsqlfsmin' + name: '${uniqueString(deployment().name)}-test-dbfpsqlfsmin' params: { // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dpsqlfsmin001' + name: '<>dbfpsqlfsmin001' skuName: 'Standard_B2s' tier: 'Burstable' } @@ -369,7 +369,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dpsqlfsmin001" + "value": "<>dbfpsqlfsmin001" }, "skuName": { "value": "Standard_B2s" @@ -392,12 +392,12 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ```bicep module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dpsqlfspv' + name: '${uniqueString(deployment().name)}-test-dpsqlfspvt' params: { // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dpsqlfspv001' + name: '<>dpsqlfspvt001' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -455,7 +455,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dpsqlfspv001" + "value": "<>dpsqlfspvt001" }, "skuName": { "value": "Standard_D2s_v3" @@ -529,12 +529,12 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ```bicep module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dpsqlfspb' + name: '${uniqueString(deployment().name)}-test-dpsqlfspub' params: { // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dpsqlfspb002' + name: '<>dpsqlfspub002' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -608,7 +608,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dpsqlfspb002" + "value": "<>dpsqlfspub002" }, "skuName": { "value": "Standard_D2s_v3" From 3ec0c23813dbf82b587998e0d269c793c046d157 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 17 Oct 2022 11:05:36 +0200 Subject: [PATCH 16/17] Addressed comments --- .../.test/min/deploy.test.bicep | 2 +- .../.test/private/deploy.test.bicep | 2 +- .../.test/public/deploy.test.bicep | 2 +- .../flexibleServers/readme.md | 18 +++++++++--------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep index aea1807bdb..6f26f27e64 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/min/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = 'dbfpsqlfsmin' +param serviceShort string = 'dfpsfsmin' @description('Optional. The password to leverage for the login.') @secure() diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep index b5aac4420d..f349ce8914 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/private/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = 'dpsqlfspvt' +param serviceShort string = 'dfpsfspvt' @description('Optional. The password to leverage for the login.') @secure() diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep index c4f63263e9..ddf2b64456 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/.test/public/deploy.test.bicep @@ -11,7 +11,7 @@ param resourceGroupName string = 'ms.dbforpostgresql.flexibleservers-${serviceSh 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 = 'dpsqlfspub' +param serviceShort string = 'dfpsfspub' @description('Optional. The password to leverage for the login.') @secure() diff --git a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md index b0212c3be6..13c25796a3 100644 --- a/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md +++ b/modules/Microsoft.DBforPostgreSQL/flexibleServers/readme.md @@ -337,12 +337,12 @@ The following module usage examples are retrieved from the content of the files ```bicep module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dbfpsqlfsmin' + name: '${uniqueString(deployment().name)}-test-dfpsfsmin' params: { // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dbfpsqlfsmin001' + name: '<>dfpsfsmin001' skuName: 'Standard_B2s' tier: 'Burstable' } @@ -369,7 +369,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dbfpsqlfsmin001" + "value": "<>dfpsfsmin001" }, "skuName": { "value": "Standard_B2s" @@ -392,12 +392,12 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ```bicep module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dpsqlfspvt' + name: '${uniqueString(deployment().name)}-test-dfpsfspvt' params: { // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dpsqlfspvt001' + name: '<>dfpsfspvt001' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -455,7 +455,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dpsqlfspvt001" + "value": "<>dfpsfspvt001" }, "skuName": { "value": "Standard_D2s_v3" @@ -529,12 +529,12 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep ```bicep module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-dpsqlfspub' + name: '${uniqueString(deployment().name)}-test-dfpsfspub' params: { // Required parameters administratorLogin: 'adminUserName' administratorLoginPassword: '' - name: '<>dpsqlfspub002' + name: '<>dfpsfspub002' skuName: 'Standard_D2s_v3' tier: 'GeneralPurpose' // Non-required parameters @@ -608,7 +608,7 @@ module flexibleServers './Microsoft.DBforPostgreSQL/flexibleServers/deploy.bicep "value": "" }, "name": { - "value": "<>dpsqlfspub002" + "value": "<>dfpsfspub002" }, "skuName": { "value": "Standard_D2s_v3" From efe35604f8f6f4b468b13f607cfbab5929fb68ca Mon Sep 17 00:00:00 2001 From: MrMCake Date: Mon, 17 Oct 2022 19:26:06 +0200 Subject: [PATCH 17/17] Update to latest --- utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs | 1 - 1 file changed, 1 deletion(-) delete mode 160000 utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs diff --git a/utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs b/utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs deleted file mode 160000 index 42b348107e..0000000000 --- a/utilities/tools/AzureApiCrawler/temp/azure-rest-api-specs +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 42b348107ef4a56801065d8d2b98dfb425044cf1