From 6ba34d0302be46d819b026dc3ae4dc76a43d86bf Mon Sep 17 00:00:00 2001 From: MrMCake Date: Tue, 30 Aug 2022 19:39:57 +0200 Subject: [PATCH 01/12] Updated API Management --- .../workflows/ms.apimanagement.service.yml | 3 +- .../service/.test/default/dependencies.bicep | 13 + .../service/.test/default/deploy.test.bicep | 80 +++++ .../service/.test/max.parameters.json | 177 ---------- .../service/.test/max/dependencies.bicep | 56 +++ .../service/.test/max/deploy.test.bicep | 187 ++++++++++ .../service/.test/min.parameters.json | 15 - .../service/.test/min/deploy.test.bicep | 39 +++ .../service/.test/parameters.json | 56 --- .../Microsoft.ApiManagement/service/readme.md | 318 +++++++++--------- utilities/tools/Set-ModuleReadMe.ps1 | 6 +- 11 files changed, 537 insertions(+), 413 deletions(-) create mode 100644 modules/Microsoft.ApiManagement/service/.test/default/dependencies.bicep create mode 100644 modules/Microsoft.ApiManagement/service/.test/default/deploy.test.bicep delete mode 100644 modules/Microsoft.ApiManagement/service/.test/max.parameters.json create mode 100644 modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep create mode 100644 modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep delete mode 100644 modules/Microsoft.ApiManagement/service/.test/min.parameters.json create mode 100644 modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep delete mode 100644 modules/Microsoft.ApiManagement/service/.test/parameters.json diff --git a/.github/workflows/ms.apimanagement.service.yml b/.github/workflows/ms.apimanagement.service.yml index ccb2652751..dffd5eb2d5 100644 --- a/.github/workflows/ms.apimanagement.service.yml +++ b/.github/workflows/ms.apimanagement.service.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.ApiManagement/service/.test/default/dependencies.bicep b/modules/Microsoft.ApiManagement/service/.test/default/dependencies.bicep new file mode 100644 index 0000000000..bfae36a05d --- /dev/null +++ b/modules/Microsoft.ApiManagement/service/.test/default/dependencies.bicep @@ -0,0 +1,13 @@ +@description('Required. The name of the managed identity to create.') +param managedIdentityName string + +@description('Optional. The location to deploy resources to.') +param location string = resourceGroup().location + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +@description('The principal ID of the created managed identity') +output managedIdentityPrincipalId string = managedIdentity.properties.principalId diff --git a/modules/Microsoft.ApiManagement/service/.test/default/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/default/deploy.test.bicep new file mode 100644 index 0000000000..ccaba404ab --- /dev/null +++ b/modules/Microsoft.ApiManagement/service/.test/default/deploy.test.bicep @@ -0,0 +1,80 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(80) +param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apisdef' + +// =========== // +// 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: { + managedIdentityName: 'dep-<>-msi-${serviceShort}' + } +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' + publisherName: '<>-az-amorg-x-001' + lock: 'CanNotDelete' + policies: [ + { + format: 'xml' + value: ' ' + } + ] + portalSettings: [ + { + name: 'signin' + properties: { + enabled: false + } + } + { + name: 'signup' + properties: { + enabled: false + termsOfService: { + consentRequired: false + enabled: false + } + } + } + ] + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] + } +} diff --git a/modules/Microsoft.ApiManagement/service/.test/max.parameters.json b/modules/Microsoft.ApiManagement/service/.test/max.parameters.json deleted file mode 100644 index f760ecf1d4..0000000000 --- a/modules/Microsoft.ApiManagement/service/.test/max.parameters.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-apim-max-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "publisherEmail": { - "value": "apimgmt-noreply@mail.windowsazure.com" - }, - "publisherName": { - "value": "<>-az-amorg-x-001" - }, - "apis": { - "value": [ - { - "name": "echo-api", - "displayName": "Echo API", - "path": "echo", - "serviceUrl": "http://echoapi.cloudapp.net/api", - "apiVersionSet": { - "name": "echo-version-set", - "properties": { - "description": "echo-version-set", - "displayName": "echo-version-set", - "versioningScheme": "Segment" - } - } - } - ] - }, - "authorizationServers": { - "value": [ - { - "name": "AuthServer1", - "authorizationEndpoint": "https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize", - "grantTypes": [ - "authorizationCode" - ], - "clientCredentialsKeyVaultId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "clientIdSecretName": "apimclientid", - "clientSecretSecretName": "apimclientsecret", - "clientRegistrationEndpoint": "http://localhost", - "tokenEndpoint": "https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token" - } - ] - }, - "backends": { - "value": [ - { - "name": "backend", - "url": "http://echoapi.cloudapp.net/api", - "tls": { - "validateCertificateChain": false, - "validateCertificateName": false - } - } - ] - }, - "caches": { - "value": [ - { - "name": "westeurope", - "connectionString": "connectionstringtest", - "useFromLocation": "westeurope" - } - ] - }, - "identityProviders": { - "value": [ - { - "name": "aadProvider" - } - ] - }, - "namedValues": { - "value": [ - { - "name": "apimkey", - "displayName": "apimkey", - "secret": true - } - ] - }, - "policies": { - "value": [ - { - "value": " ", - "format": "xml" - } - ] - }, - "portalSettings": { - "value": [ - { - "name": "signin", - "properties": { - "enabled": false - } - }, - { - "name": "signup", - "properties": { - "enabled": false, - "termsOfService": { - "enabled": false, - "consentRequired": false - } - } - } - ] - }, - "products": { - "value": [ - { - "name": "Starter", - "subscriptionRequired": false, - "approvalRequired": false, - "apis": [ - { - "name": "echo-api" - } - ], - "groups": [ - { - "name": "developers" - } - ] - } - ] - }, - "subscriptions": { - "value": [ - { - "scope": "/apis", - "name": "testArmSubscriptionAllApis" - } - ] - }, - "systemAssignedIdentity": { - "value": true - }, - "userAssignedIdentities": { - "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} - } - }, - "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" - } - } -} diff --git a/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep b/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep new file mode 100644 index 0000000000..9bf566f5d9 --- /dev/null +++ b/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep @@ -0,0 +1,56 @@ +@description('Required. The name of the managed identity to create.') +param managedIdentityName string + +@description('Required. The name of the Key Vault to create.') +param keyVaultName string + +@description('Optional. The location to deploy resources to.') +param location string = resourceGroup().location + +@description('Optional. The secret to store in the Key Vault. Is auto-generated if not provided.') +@secure() +param customSecret string = newGuid() + +var keyVaultSecretName = 'apimclientsecret' + +resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018-11-30' = { + name: managedIdentityName + location: location +} + +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 secret 'secrets@2022-07-01' = { + name: keyVaultSecretName + properties: { + value: customSecret + } + } +} + +@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 resource ID of the created Key Vault.') +output keyVaultResourceId string = keyVault.id + +@description('The name of the created Key Vault secret.') +output keyVaultSecretName string = keyVaultSecretName diff --git a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep new file mode 100644 index 0000000000..c193d64561 --- /dev/null +++ b/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep @@ -0,0 +1,187 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(80) +param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apismax' + +// =========== // +// 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: { + managedIdentityName: 'dep-<>-msi-${serviceShort}' + keyVaultName: 'dep-<>-kv-${serviceShort}' + } +} + +// Diagnostics +// =========== +module diagnosticDependencies '../../../../.shared/dependencyConstructs/diagnostic.dependencies.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name, location)}-diagnosticDependencies' + params: { + storageAccountName: 'dep<>azsa${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' + publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' + publisherName: '<>-az-amorg-x-001' + // Non-required parameters + apis: [ + { + apiVersionSet: { + name: 'echo-version-set' + properties: { + description: 'echo-version-set' + displayName: 'echo-version-set' + versioningScheme: 'Segment' + } + } + displayName: 'Echo API' + name: 'echo-api' + path: 'echo' + serviceUrl: 'http://echoapi.cloudapp.net/api' + } + ] + authorizationServers: [ + { + authorizationEndpoint: '${environment().authentication.loginEndpoint}651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize' + clientCredentialsKeyVaultId: resourceGroupResources.outputs.keyVaultResourceId + clientIdSecretName: resourceGroupResources.outputs.keyVaultSecretName + clientRegistrationEndpoint: 'http://localhost' + clientSecretSecretName: resourceGroupResources.outputs.keyVaultSecretName + grantTypes: [ + 'authorizationCode' + ] + name: 'AuthServer1' + tokenEndpoint: '${environment().authentication.loginEndpoint}651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token' + } + ] + backends: [ + { + name: 'backend' + tls: { + validateCertificateChain: false + validateCertificateName: false + } + url: 'http://echoapi.cloudapp.net/api' + } + ] + caches: [ + { + connectionString: 'connectionstringtest' + name: 'westeurope' + useFromLocation: 'westeurope' + } + ] + diagnosticLogsRetentionInDays: 7 + diagnosticStorageAccountId: diagnosticDependencies.outputs.storageAccountResourceId + diagnosticWorkspaceId: diagnosticDependencies.outputs.logAnalyticsWorkspaceResourceId + diagnosticEventHubAuthorizationRuleId: diagnosticDependencies.outputs.eventHubAuthorizationRuleId + diagnosticEventHubName: diagnosticDependencies.outputs.eventHubNamespaceEventHubName + identityProviders: [ + { + name: 'aadProvider' + } + ] + lock: 'CanNotDelete' + namedValues: [ + { + displayName: 'apimkey' + name: 'apimkey' + secret: true + } + ] + policies: [ + { + format: 'xml' + value: ' ' + } + ] + portalSettings: [ + { + name: 'signin' + properties: { + enabled: false + } + } + { + name: 'signup' + properties: { + enabled: false + termsOfService: { + consentRequired: false + enabled: false + } + } + } + ] + products: [ + { + apis: [ + { + name: 'echo-api' + } + ] + approvalRequired: false + groups: [ + { + name: 'developers' + } + ] + name: 'Starter' + subscriptionRequired: false + } + ] + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] + subscriptions: [ + { + name: 'testArmSubscriptionAllApis' + scope: '/apis' + } + ] + systemAssignedIdentity: true + userAssignedIdentities: { + '${resourceGroupResources.outputs.managedIdentityResourceId}': {} + } + } +} diff --git a/modules/Microsoft.ApiManagement/service/.test/min.parameters.json b/modules/Microsoft.ApiManagement/service/.test/min.parameters.json deleted file mode 100644 index d71e822cc5..0000000000 --- a/modules/Microsoft.ApiManagement/service/.test/min.parameters.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-apim-min-001" - }, - "publisherEmail": { - "value": "apimgmt-noreply@mail.windowsazure.com" - }, - "publisherName": { - "value": "<>-az-amorg-x-001" - } - } -} diff --git a/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep new file mode 100644 index 0000000000..cefa054c83 --- /dev/null +++ b/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep @@ -0,0 +1,39 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(80) +param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apismin' + +// =========== // +// 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' + publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' + publisherName: '<>-az-amorg-x-001' + } +} diff --git a/modules/Microsoft.ApiManagement/service/.test/parameters.json b/modules/Microsoft.ApiManagement/service/.test/parameters.json deleted file mode 100644 index 8f73097f17..0000000000 --- a/modules/Microsoft.ApiManagement/service/.test/parameters.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-apim-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "publisherEmail": { - "value": "apimgmt-noreply@mail.windowsazure.com" - }, - "publisherName": { - "value": "<>-az-amorg-x-001" - }, - "portalSettings": { - "value": [ - { - "name": "signin", - "properties": { - "enabled": false - } - }, - { - "name": "signup", - "properties": { - "enabled": false, - "termsOfService": { - "enabled": false, - "consentRequired": false - } - } - } - ] - }, - "policies": { - "value": [ - { - "value": " ", - "format": "xml" - } - ] - }, - "roleAssignments": { - "value": [ - { - "roleDefinitionIdOrName": "Reader", - "principalIds": [ - "<>" - ] - } - ] - } - } -} diff --git a/modules/Microsoft.ApiManagement/service/readme.md b/modules/Microsoft.ApiManagement/service/readme.md index b3aedc1115..d57dce0523 100644 --- a/modules/Microsoft.ApiManagement/service/readme.md +++ b/modules/Microsoft.ApiManagement/service/readme.md @@ -281,18 +281,141 @@ 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: Max

+

Example 1: Default

via Bicep module ```bicep -module service './Microsoft.ApiManagement/service/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-service' +module Service './Microsoft.Apimanagement/Service/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-apisdef' params: { // Required parameters - name: '<>-az-apim-max-001' + name: '<>apisdef001' + publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' + publisherName: '<>-az-amorg-x-001' + // Non-required parameters + lock: 'CanNotDelete' + policies: [ + { + format: 'xml' + value: ' ' + } + ] + portalSettings: [ + { + name: 'signin' + properties: { + enabled: false + } + } + { + name: 'signup' + properties: { + enabled: false + termsOfService: { + consentRequired: false + enabled: false + } + } + } + ] + roleAssignments: [ + { + principalIds: [ + '' + ] + roleDefinitionIdOrName: 'Reader' + } + ] + } +} +``` + +
+

+ +

+ +via JSON Parameter file + +```json +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + // Required parameters + "name": { + "value": "<>apisdef001" + }, + "publisherEmail": { + "value": "apimgmt-noreply@mail.windowsazure.com" + }, + "publisherName": { + "value": "<>-az-amorg-x-001" + }, + // Non-required parameters + "lock": { + "value": "CanNotDelete" + }, + "policies": { + "value": [ + { + "format": "xml", + "value": " " + } + ] + }, + "portalSettings": { + "value": [ + { + "name": "signin", + "properties": { + "enabled": false + } + }, + { + "name": "signup", + "properties": { + "enabled": false, + "termsOfService": { + "consentRequired": false, + "enabled": false + } + } + } + ] + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + } + } +} +``` + +
+

+ +

Example 2: Max

+ +
+ +via Bicep module + +```bicep +module Service './Microsoft.Apimanagement/Service/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-apismax' + params: { + // Required parameters + name: '<>apismax001' publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' publisherName: '<>-az-amorg-x-001' // Non-required parameters @@ -314,16 +437,16 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { ] authorizationServers: [ { - authorizationEndpoint: 'https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize' - clientCredentialsKeyVaultId: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001' - clientIdSecretName: 'apimclientid' + authorizationEndpoint: '${environment().authentication.loginEndpoint}651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize' + clientCredentialsKeyVaultId: '' + clientIdSecretName: '' clientRegistrationEndpoint: 'http://localhost' - clientSecretSecretName: 'apimclientsecret' + clientSecretSecretName: '' grantTypes: [ 'authorizationCode' ] name: 'AuthServer1' - tokenEndpoint: 'https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token' + tokenEndpoint: '${environment().authentication.loginEndpoint}651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token' } ] backends: [ @@ -343,11 +466,11 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { useFromLocation: 'westeurope' } ] - 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: '' identityProviders: [ { name: 'aadProvider' @@ -364,7 +487,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { policies: [ { format: 'xml' - value: ' ' + value: ' ' } ] portalSettings: [ @@ -405,7 +528,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { roleAssignments: [ { principalIds: [ - '<>' + '' ] roleDefinitionIdOrName: 'Reader' } @@ -413,12 +536,11 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { subscriptions: [ { name: 'testArmSubscriptionAllApis' - scope: '/apis' } ] systemAssignedIdentity: true userAssignedIdentities: { - '/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001': {} + '': {} } } } @@ -438,7 +560,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { "parameters": { // Required parameters "name": { - "value": "<>-az-apim-max-001" + "value": "<>apismax001" }, "publisherEmail": { "value": "apimgmt-noreply@mail.windowsazure.com" @@ -468,16 +590,16 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { "authorizationServers": { "value": [ { - "authorizationEndpoint": "https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize", - "clientCredentialsKeyVaultId": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.KeyVault/vaults/adp-<>-az-kv-x-001", - "clientIdSecretName": "apimclientid", + "authorizationEndpoint": "${environment().authentication.loginEndpoint}651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/authorize", + "clientCredentialsKeyVaultId": "", + "clientIdSecretName": "", "clientRegistrationEndpoint": "http://localhost", - "clientSecretSecretName": "apimclientsecret", + "clientSecretSecretName": "", "grantTypes": [ "authorizationCode" ], "name": "AuthServer1", - "tokenEndpoint": "https://login.microsoftonline.com/651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token" + "tokenEndpoint": "${environment().authentication.loginEndpoint}651b43ce-ccb8-4301-b551-b04dd872d401/oauth2/v2.0/token" } ] }, @@ -503,19 +625,19 @@ module service './Microsoft.ApiManagement/service/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": "" }, "identityProviders": { "value": [ @@ -540,7 +662,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { "value": [ { "format": "xml", - "value": " " + "value": " " } ] }, @@ -587,7 +709,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { "value": [ { "principalIds": [ - "<>" + "" ], "roleDefinitionIdOrName": "Reader" } @@ -596,8 +718,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { "subscriptions": { "value": [ { - "name": "testArmSubscriptionAllApis", - "scope": "/apis" + "name": "testArmSubscriptionAllApis" } ] }, @@ -606,7 +727,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { }, "userAssignedIdentities": { "value": { - "/subscriptions/<>/resourcegroups/validation-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/adp-<>-az-msi-x-001": {} + "": {} } } } @@ -616,18 +737,18 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = {

-

Example 2: Min

+

Example 3: Min

via Bicep module ```bicep -module service './Microsoft.ApiManagement/service/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-service' +module Service './Microsoft.Apimanagement/Service/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-apismin' params: { // Required parameters - name: '<>-az-apim-min-001' + name: '<>apismin001' publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' publisherName: '<>-az-amorg-x-001' } @@ -648,7 +769,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { "parameters": { // Required parameters "name": { - "value": "<>-az-apim-min-001" + "value": "<>apismin001" }, "publisherEmail": { "value": "apimgmt-noreply@mail.windowsazure.com" @@ -662,126 +783,3 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = {

- -

Example 3: Parameters

- -
- -via Bicep module - -```bicep -module service './Microsoft.ApiManagement/service/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-service' - params: { - // Required parameters - name: '<>-az-apim-x-001' - publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' - publisherName: '<>-az-amorg-x-001' - // Non-required parameters - lock: 'CanNotDelete' - policies: [ - { - format: 'xml' - value: ' ' - } - ] - portalSettings: [ - { - name: 'signin' - properties: { - enabled: false - } - } - { - name: 'signup' - properties: { - enabled: false - termsOfService: { - consentRequired: false - enabled: false - } - } - } - ] - roleAssignments: [ - { - principalIds: [ - '<>' - ] - roleDefinitionIdOrName: 'Reader' - } - ] - } -} -``` - -
-

- -

- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - // Required parameters - "name": { - "value": "<>-az-apim-x-001" - }, - "publisherEmail": { - "value": "apimgmt-noreply@mail.windowsazure.com" - }, - "publisherName": { - "value": "<>-az-amorg-x-001" - }, - // Non-required parameters - "lock": { - "value": "CanNotDelete" - }, - "policies": { - "value": [ - { - "format": "xml", - "value": " " - } - ] - }, - "portalSettings": { - "value": [ - { - "name": "signin", - "properties": { - "enabled": false - } - }, - { - "name": "signup", - "properties": { - "enabled": false, - "termsOfService": { - "consentRequired": false, - "enabled": false - } - } - } - ] - }, - "roleAssignments": { - "value": [ - { - "principalIds": [ - "<>" - ], - "roleDefinitionIdOrName": "Reader" - } - ] - } - } -} -``` - -
-

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 b853b3a42c73eaab053735ac9e8fc24c3aa7db5c Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 10:13:10 +0200 Subject: [PATCH 02/12] Update to latest --- .../Microsoft.ApiManagement/service/readme.md | 6 ++--- utilities/tools/Set-ModuleReadMe.ps1 | 23 ++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/modules/Microsoft.ApiManagement/service/readme.md b/modules/Microsoft.ApiManagement/service/readme.md index d57dce0523..4b8c3dc164 100644 --- a/modules/Microsoft.ApiManagement/service/readme.md +++ b/modules/Microsoft.ApiManagement/service/readme.md @@ -288,7 +288,7 @@ The following module usage examples are retrieved from the content of the files via Bicep module ```bicep -module Service './Microsoft.Apimanagement/Service/deploy.bicep' = { +module service './Microsoft.ApiManagement/service/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-apisdef' params: { // Required parameters @@ -411,7 +411,7 @@ module Service './Microsoft.Apimanagement/Service/deploy.bicep' = { via Bicep module ```bicep -module Service './Microsoft.Apimanagement/Service/deploy.bicep' = { +module service './Microsoft.ApiManagement/service/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-apismax' params: { // Required parameters @@ -744,7 +744,7 @@ module Service './Microsoft.Apimanagement/Service/deploy.bicep' = { via Bicep module ```bicep -module Service './Microsoft.Apimanagement/Service/deploy.bicep' = { +module service './Microsoft.ApiManagement/service/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-apismin' params: { // Required parameters diff --git a/utilities/tools/Set-ModuleReadMe.ps1 b/utilities/tools/Set-ModuleReadMe.ps1 index 6b922d65e8..25d22f3fff 100644 --- a/utilities/tools/Set-ModuleReadMe.ps1 +++ b/utilities/tools/Set-ModuleReadMe.ps1 @@ -51,7 +51,7 @@ function Set-ResourceTypesSection { $RelevantResourceTypeObjects = Get-NestedResourceList $TemplateFileContent | Where-Object { $_.type -notin $ResourceTypesToExclude -and $_ - } | Select-Object 'Type', 'ApiVersion' -Unique | Sort-Object Type -Culture en-US + } | Select-Object 'Type', 'ApiVersion' -Unique | Sort-Object Type -Culture 'en-US' foreach ($resourceTypeObject in $RelevantResourceTypeObjects) { $ProviderNamespace, $ResourceType = $resourceTypeObject.Type -split '/', 2 @@ -280,7 +280,7 @@ function Set-OutputsSection { '| Output Name | Type | Description |', '| :-- | :-- | :-- |' ) - foreach ($outputName in ($templateFileContent.outputs.Keys | Sort-Object -Culture en-US)) { + foreach ($outputName in ($templateFileContent.outputs.Keys | Sort-Object -Culture 'en-US')) { $output = $TemplateFileContent.outputs[$outputName] $description = $output.metadata.description.Replace("`r`n", '

').Replace("`n", '

') $SectionContent += ("| ``{0}`` | {1} | {2} |" -f $outputName, $output.type, $description) @@ -290,7 +290,7 @@ function Set-OutputsSection { '| Output Name | Type |', '| :-- | :-- |' ) - foreach ($outputName in ($templateFileContent.outputs.Keys | Sort-Object -Culture en-US)) { + foreach ($outputName in ($templateFileContent.outputs.Keys | Sort-Object -Culture 'en-US')) { $output = $TemplateFileContent.outputs[$outputName] $SectionContent += ("| ``{0}`` | {1} |" -f $outputName, $output.type) } @@ -883,10 +883,16 @@ function Set-DeploymentExamplesSection { '' ) - $TextInfo = (Get-Culture -Name 'en-US').TextInfo $moduleRoot = Split-Path $TemplateFilePath -Parent - $resourceTypeIdentifier = $TextInfo.ToTitleCase($moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/')) - $resourceType = $TextInfo.ToTitleCase($resourceTypeIdentifier.Split('/')[1]) + $fullIdentifier = $moduleRoot.Replace('\', '/').Split('/modules/')[1].TrimStart('/') + + # Get resource type and make first letter upper case. Requires manual handling as ToTitleCase lowercases everything but the first letter + $providerNamespace = ($fullIdentifier.Split('/')[0] -split '\.' | ForEach-Object { $_.Substring(0, 1).ToUpper() + $_.Substring(1) }) -join '.' + $resourceType = $fullIdentifier.Split('/')[1] + $resourceTypeUpper = $resourceType.Substring(0, 1).ToUpper() + $resourceType.Substring(1) + + $resourceTypeIdentifier = "$providerNamespace/$resourceType" + $testFilePaths = Get-ModuleTestFileList -ModulePath $moduleRoot | ForEach-Object { Join-Path $moduleRoot $_ } $RequiredParametersList = $TemplateFileContent.parameters.Keys | Where-Object { $TemplateFileContent.parameters[$_].Keys -notcontains 'defaultValue' } | Sort-Object @@ -907,7 +913,8 @@ function Set-DeploymentExamplesSection { } else { $exampleTitle = ((Split-Path $testFilePath -LeafBase) -replace '\.', ' ') -replace ' parameters', '' } - $exampleTitle = $TextInfo.ToTitleCase($exampleTitle) + $textInfo = (Get-Culture -Name 'en-US').TextInfo + $exampleTitle = $textInfo.ToTitleCase($exampleTitle) $SectionContent += @( '

Example {0}: {1}

' -f $pathIndex, $exampleTitle ) @@ -1138,7 +1145,7 @@ function Set-DeploymentExamplesSection { '```bicep', $extendedKeyVaultReferences, "module $resourceType './$resourceTypeIdentifier/deploy.bicep' = {" - " name: '`${uniqueString(deployment().name)}-$resourceType'" + " name: '`${uniqueString(deployment().name)}-$resourceTypeUpper'" ' params: {' $bicepExample.TrimEnd(), ' }' From 74b31baf5768210da8bbe1e810d4c12517b0a7ee Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 1 Sep 2022 11:29:34 +0200 Subject: [PATCH 03/12] Update to latest --- .../Microsoft.ApiManagement/service/readme.md | 127 +----------------- 1 file changed, 2 insertions(+), 125 deletions(-) diff --git a/modules/Microsoft.ApiManagement/service/readme.md b/modules/Microsoft.ApiManagement/service/readme.md index 2a713c13e0..4b8c3dc164 100644 --- a/modules/Microsoft.ApiManagement/service/readme.md +++ b/modules/Microsoft.ApiManagement/service/readme.md @@ -289,7 +289,7 @@ The following module usage examples are retrieved from the content of the files ```bicep module service './Microsoft.ApiManagement/service/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-Service' + name: '${uniqueString(deployment().name)}-test-apisdef' params: { // Required parameters name: '<>apisdef001' @@ -745,7 +745,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { ```bicep module service './Microsoft.ApiManagement/service/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-Service' + name: '${uniqueString(deployment().name)}-test-apismin' params: { // Required parameters name: '<>apismin001' @@ -783,126 +783,3 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = {

- -

Example 3: Parameters

- -
- -via Bicep module - -```bicep -module service './Microsoft.ApiManagement/service/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-Service' - params: { - // Required parameters - name: '<>-az-apim-x-001' - publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' - publisherName: '<>-az-amorg-x-001' - // Non-required parameters - lock: 'CanNotDelete' - policies: [ - { - format: 'xml' - value: ' ' - } - ] - portalSettings: [ - { - name: 'signin' - properties: { - enabled: false - } - } - { - name: 'signup' - properties: { - enabled: false - termsOfService: { - consentRequired: false - enabled: false - } - } - } - ] - roleAssignments: [ - { - principalIds: [ - '<>' - ] - roleDefinitionIdOrName: 'Reader' - } - ] - } -} -``` - -
-

- -

- -via JSON Parameter file - -```json -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - // Required parameters - "name": { - "value": "<>-az-apim-x-001" - }, - "publisherEmail": { - "value": "apimgmt-noreply@mail.windowsazure.com" - }, - "publisherName": { - "value": "<>-az-amorg-x-001" - }, - // Non-required parameters - "lock": { - "value": "CanNotDelete" - }, - "policies": { - "value": [ - { - "format": "xml", - "value": " " - } - ] - }, - "portalSettings": { - "value": [ - { - "name": "signin", - "properties": { - "enabled": false - } - }, - { - "name": "signup", - "properties": { - "enabled": false, - "termsOfService": { - "consentRequired": false, - "enabled": false - } - } - } - ] - }, - "roleAssignments": { - "value": [ - { - "principalIds": [ - "<>" - ], - "roleDefinitionIdOrName": "Reader" - } - ] - } - } -} -``` - -
-

From 6542980157117cd60400adae4d094beea6dcd2dd Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 8 Sep 2022 18:45:10 +0200 Subject: [PATCH 04/12] Updated folder default to common. --- .../service/.test/{default => common}/dependencies.bicep | 0 .../service/.test/{default => common}/deploy.test.bicep | 0 modules/Microsoft.ApiManagement/service/readme.md | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename modules/Microsoft.ApiManagement/service/.test/{default => common}/dependencies.bicep (100%) rename modules/Microsoft.ApiManagement/service/.test/{default => common}/deploy.test.bicep (100%) diff --git a/modules/Microsoft.ApiManagement/service/.test/default/dependencies.bicep b/modules/Microsoft.ApiManagement/service/.test/common/dependencies.bicep similarity index 100% rename from modules/Microsoft.ApiManagement/service/.test/default/dependencies.bicep rename to modules/Microsoft.ApiManagement/service/.test/common/dependencies.bicep diff --git a/modules/Microsoft.ApiManagement/service/.test/default/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep similarity index 100% rename from modules/Microsoft.ApiManagement/service/.test/default/deploy.test.bicep rename to modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep diff --git a/modules/Microsoft.ApiManagement/service/readme.md b/modules/Microsoft.ApiManagement/service/readme.md index 4b8c3dc164..079b79a30e 100644 --- a/modules/Microsoft.ApiManagement/service/readme.md +++ b/modules/Microsoft.ApiManagement/service/readme.md @@ -281,7 +281,7 @@ 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

From 2c31acab9e83b4716cc36b13e1b0b5e24b3c9579 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 12:48:38 +0200 Subject: [PATCH 05/12] Update to latest --- .../service/.test/common/deploy.test.bicep | 4 ++-- .../service/.test/max/deploy.test.bicep | 2 +- .../service/.test/min/deploy.test.bicep | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep index ccaba404ab..7470c78cbf 100644 --- a/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep @@ -10,8 +10,8 @@ param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apisdef' +@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 = 'apiscom' // =========== // // Deployments // diff --git a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep index c193d64561..c5a79f9bef 100644 --- a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apismax' // =========== // diff --git a/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep index cefa054c83..3d8ffb0143 100644 --- a/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep @@ -10,7 +10,7 @@ param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apismin' // =========== // From 1b4e838562cedbd5f8deb43a243e3719e5ca1f7c Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:01:41 +0200 Subject: [PATCH 06/12] Update to latest --- .../service/.test/common/deploy.test.bicep | 6 +++--- .../service/.test/max/deploy.test.bicep | 6 +++--- .../service/.test/min/deploy.test.bicep | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep index 7470c78cbf..446789312d 100644 --- a/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.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(80) param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apiscom' // =========== // diff --git a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep index c5a79f9bef..d2f047b745 100644 --- a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/max/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(80) param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apismax' // =========== // diff --git a/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep index 3d8ffb0143..fc4e343f92 100644 --- a/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.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(80) param resourceGroupName string = 'ms.apimanagement.service-${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 = 'apismin' // =========== // From 5b9b98de7ca0eab7428e6b41c0da0f62bbeb5c89 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 9 Sep 2022 13:23:35 +0200 Subject: [PATCH 07/12] Update to latest --- modules/Microsoft.ApiManagement/service/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.ApiManagement/service/readme.md b/modules/Microsoft.ApiManagement/service/readme.md index 2da9a5c46a..3a6bcf90e9 100644 --- a/modules/Microsoft.ApiManagement/service/readme.md +++ b/modules/Microsoft.ApiManagement/service/readme.md @@ -290,10 +290,10 @@ The following module usage examples are retrieved from the content of the files ```bicep module service './Microsoft.ApiManagement/service/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-test-apisdef' + name: '${uniqueString(deployment().name)}-test-apiscom' params: { // Required parameters - name: '<>apisdef001' + name: '<>apiscom001' publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' publisherName: '<>-az-amorg-x-001' // Non-required parameters @@ -348,7 +348,7 @@ module service './Microsoft.ApiManagement/service/deploy.bicep' = { "parameters": { // Required parameters "name": { - "value": "<>apisdef001" + "value": "<>apiscom001" }, "publisherEmail": { "value": "apimgmt-noreply@mail.windowsazure.com" From 4f8dfe5b1a1c4ab8a8a043ce1ac170f0098e643d Mon Sep 17 00:00:00 2001 From: MrMCake Date: Sun, 18 Sep 2022 22:57:00 +0200 Subject: [PATCH 08/12] Update to latest --- .../service/.test/common/deploy.test.bicep | 2 +- .../Microsoft.ApiManagement/service/.test/max/deploy.test.bicep | 2 +- .../Microsoft.ApiManagement/service/.test/min/deploy.test.bicep | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep index 446789312d..17cd6df4d6 100644 --- a/modules/Microsoft.ApiManagement/service/.test/common/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.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(80) param resourceGroupName string = 'ms.apimanagement.service-${serviceShort}-rg' diff --git a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep index d2f047b745..668f36fbb7 100644 --- a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/max/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(80) param resourceGroupName string = 'ms.apimanagement.service-${serviceShort}-rg' diff --git a/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep index fc4e343f92..d77d096aec 100644 --- a/modules/Microsoft.ApiManagement/service/.test/min/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.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(80) param resourceGroupName string = 'ms.apimanagement.service-${serviceShort}-rg' From fe11cbcc77e7945ef572c5abc71a33bd3ea3599c Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 10:18:39 +0200 Subject: [PATCH 09/12] Update modules/Microsoft.ApiManagement/service/.test/common/dependencies.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../service/.test/common/dependencies.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.ApiManagement/service/.test/common/dependencies.bicep b/modules/Microsoft.ApiManagement/service/.test/common/dependencies.bicep index bfae36a05d..29b9641692 100644 --- a/modules/Microsoft.ApiManagement/service/.test/common/dependencies.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/common/dependencies.bicep @@ -9,5 +9,5 @@ resource managedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentities@2018- location: location } -@description('The principal ID of the created managed identity') +@description('The principal ID of the created managed identity.') output managedIdentityPrincipalId string = managedIdentity.properties.principalId From 0ee4f392816ba23abeb9d3e6bfac89ccaa4dfde8 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 10:18:45 +0200 Subject: [PATCH 10/12] Update modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../Microsoft.ApiManagement/service/.test/max/deploy.test.bicep | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep b/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep index 668f36fbb7..3d536b715b 100644 --- a/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/max/deploy.test.bicep @@ -58,7 +58,6 @@ module testDeployment '../../deploy.bicep' = { name: '<>${serviceShort}001' publisherEmail: 'apimgmt-noreply@mail.windowsazure.com' publisherName: '<>-az-amorg-x-001' - // Non-required parameters apis: [ { apiVersionSet: { From 62bf4c991cdcb07e99750599c7e3a1ce6f8336f9 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 10:18:50 +0200 Subject: [PATCH 11/12] Update modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../service/.test/max/dependencies.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep b/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep index 9bf566f5d9..b937b3a34a 100644 --- a/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep @@ -53,4 +53,4 @@ output managedIdentityResourceId string = managedIdentity.id output keyVaultResourceId string = keyVault.id @description('The name of the created Key Vault secret.') -output keyVaultSecretName string = keyVaultSecretName +output keyVaultSecretName string = keyVault::secret.name From 430cdc95f0e89928c1960508f880b83ca78a4fcc Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Mon, 10 Oct 2022 10:18:55 +0200 Subject: [PATCH 12/12] Update modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep Co-authored-by: Erika Gressi <56914614+eriqua@users.noreply.github.com> --- .../service/.test/max/dependencies.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep b/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep index b937b3a34a..486d972626 100644 --- a/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep +++ b/modules/Microsoft.ApiManagement/service/.test/max/dependencies.bicep @@ -43,7 +43,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' = { } } -@description('The principal ID of the created managed identity') +@description('The principal ID of the created managed identity.') output managedIdentityPrincipalId string = managedIdentity.properties.principalId @description('The resource ID of the created Managed Identity.')