From 597ef91f9c27763900a7e2314fa2e71354ed340c Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 16 Sep 2022 11:57:06 +0200 Subject: [PATCH 1/9] Update Network FrontDoors to new dependency approach --- .github/workflows/ms.network.frontdoors.yml | 3 +- .../.test/common/dependencies.bicep | 14 ++ .../frontDoors/.test/common/deploy.test.bicep | 135 ++++++++++++++++++ .../frontDoors/.test/min/deploy.test.bicep | 37 +++++ .../frontDoors/.test/parameters.json | 115 --------------- .../Microsoft.Network/frontDoors/readme.md | 65 +++++++-- 6 files changed, 238 insertions(+), 131 deletions(-) create mode 100644 modules/Microsoft.Network/frontDoors/.test/common/dependencies.bicep create mode 100644 modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep create mode 100644 modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep delete mode 100644 modules/Microsoft.Network/frontDoors/.test/parameters.json diff --git a/.github/workflows/ms.network.frontdoors.yml b/.github/workflows/ms.network.frontdoors.yml index 3f61f66412..01f7194a82 100644 --- a/.github/workflows/ms.network.frontdoors.yml +++ b/.github/workflows/ms.network.frontdoors.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.Network/frontDoors/.test/common/dependencies.bicep b/modules/Microsoft.Network/frontDoors/.test/common/dependencies.bicep new file mode 100644 index 0000000000..7371d4437b --- /dev/null +++ b/modules/Microsoft.Network/frontDoors/.test/common/dependencies.bicep @@ -0,0 +1,14 @@ +@description('Optional. The location to deploy to.') +param location string = resourceGroup().location + +@description('Required. The name of the Managed Identity to create.') +param managedIdentityName string + +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.Network/frontDoors/.test/common/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep new file mode 100644 index 0000000000..81033cb7e1 --- /dev/null +++ b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep @@ -0,0 +1,135 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.network.frontdoors-${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 = 'nfdcom' + +// =========== // +// 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 // +// ============== // +var resourceName = '<>${serviceShort}001' +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: resourceName + backendPools: [ + { + name: 'backendPool' + properties: { + backends: [ + { + address: 'biceptest.local' + backendHostHeader: 'backendAddress' + enabledState: 'Enabled' + httpPort: 80 + httpsPort: 443 + priority: 1 + privateLinkAlias: '' + privateLinkApprovalMessage: '' + privateLinkLocation: '' + privateLinkResourceId: '' + weight: 50 + } + ] + HealthProbeSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe' + } + LoadBalancingSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer' + } + } + } + ] + enforceCertificateNameCheck: 'Disabled' + frontendEndpoints: [ + { + name: 'frontEnd' + properties: { + hostName: '${resourceName}.azurefd.net' + sessionAffinityEnabledState: 'Disabled' + sessionAffinityTtlSeconds: 60 + } + } + ] + healthProbeSettings: [ + { + name: 'heathProbe' + properties: { + enabledState: '' + healthProbeMethod: '' + intervalInSeconds: 60 + path: '/' + protocol: 'Https' + } + } + ] + loadBalancingSettings: [ + { + name: 'loadBalancer' + properties: { + additionalLatencyMilliseconds: 0 + sampleSize: 50 + successfulSamplesRequired: 1 + } + } + ] + lock: 'CanNotDelete' + routingRules: [ + { + name: 'routingRule' + properties: { + acceptedProtocols: [ + 'Http' + 'Https' + ] + enabledState: 'Enabled' + frontendEndpoints: [ + { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/FrontendEndpoints/frontEnd' + } + ] + patternsToMatch: [ + '/*' + ] + routeConfiguration: { + '@odata.type': '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' + backendPool: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/BackendPools/backendPool' + } + forwardingProtocol: 'MatchRequest' + } + } + } + ] + sendRecvTimeoutSeconds: 10 + } +} diff --git a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep new file mode 100644 index 0000000000..1ce31ff2f7 --- /dev/null +++ b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep @@ -0,0 +1,37 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@description('Optional. The name of the resource group to deploy for a testing purposes') +@maxLength(90) +param resourceGroupName string = 'ms.network.frontdoors-${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 = 'nfdmin' + +// =========== // +// Deployments // +// =========== // + +// General resources +// ================= +resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { + name: resourceGroupName + location: location +} + +// ============== // +// Test Execution // +// ============== // + +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: '<>${serviceShort}001' + } +} diff --git a/modules/Microsoft.Network/frontDoors/.test/parameters.json b/modules/Microsoft.Network/frontDoors/.test/parameters.json deleted file mode 100644 index e52cca17f9..0000000000 --- a/modules/Microsoft.Network/frontDoors/.test/parameters.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "name": { - "value": "<>-az-fd-x-001" - }, - "lock": { - "value": "CanNotDelete" - }, - "backendPools": { - "value": [ - { - "name": "backendPool", - "properties": { - "backends": [ - { - "address": "biceptest.local", - "backendHostHeader": "backendAddress", - "httpPort": 80, - "httpsPort": 443, - "weight": 50, - "priority": 1, - "enabledState": "Enabled", - "privateLinkAlias": "", - "privateLinkApprovalMessage": "", - "privateLinkLocation": "", - "privateLinkResourceId": "" - } - ], - "LoadBalancingSettings": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/LoadBalancingSettings/loadBalancer" - }, - "HealthProbeSettings": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/HealthProbeSettings/heathProbe" - } - } - } - ] - }, - "enforceCertificateNameCheck": { - "value": "Disabled" - }, - "sendRecvTimeoutSeconds": { - "value": 10 - }, - "frontendEndpoints": { - "value": [ - { - "name": "frontEnd", - "properties": { - "hostName": "<>-az-fd-x-001.azurefd.net", - "sessionAffinityEnabledState": "Disabled", - "sessionAffinityTtlSeconds": 60 - } - } - ] - }, - "healthProbeSettings": { - "value": [ - { - "name": "heathProbe", - "properties": { - "enabledState": "", - "healthProbeMethod": "", - "intervalInSeconds": 60, - "path": "/", - "protocol": "Https" - } - } - ] - }, - "loadBalancingSettings": { - "value": [ - { - "name": "loadBalancer", - "properties": { - "additionalLatencyMilliseconds": 0, - "sampleSize": 50, - "successfulSamplesRequired": 1 - } - } - ] - }, - "routingRules": { - "value": [ - { - "name": "routingRule", - "properties": { - "acceptedProtocols": [ - "Http", - "Https" - ], - "enabledState": "Enabled", - "frontendEndpoints": [ - { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/FrontendEndpoints/frontEnd" - } - ], - "patternsToMatch": [ - "/*" - ], - "routeConfiguration": { - "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration", - "forwardingProtocol": "MatchRequest", - "backendPool": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/BackendPools/backendPool" - } - } - } - } - ] - } - } -} diff --git a/modules/Microsoft.Network/frontDoors/readme.md b/modules/Microsoft.Network/frontDoors/readme.md index 05d36d46f4..4b4fd9962b 100644 --- a/modules/Microsoft.Network/frontDoors/readme.md +++ b/modules/Microsoft.Network/frontDoors/readme.md @@ -172,7 +172,7 @@ The following module usage examples are retrieved from the content of the files >**Note**: Each example lists all the required parameters first, followed by the rest - each in alphabetical order. -

Example 1: Parameters

+

Example 1: Common

@@ -180,10 +180,10 @@ The following module usage examples are retrieved from the content of the files ```bicep module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { - name: '${uniqueString(deployment().name)}-FrontDoors' + name: '${uniqueString(deployment().name)}-test-nfdcom' params: { // Required parameters - name: '<>-az-fd-x-001' + name: '' // Non-required parameters backendPools: [ { @@ -205,10 +205,10 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } ] HealthProbeSettings: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/HealthProbeSettings/heathProbe' + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe' } LoadBalancingSettings: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/LoadBalancingSettings/loadBalancer' + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer' } } } @@ -218,7 +218,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { { name: 'frontEnd' properties: { - hostName: '<>-az-fd-x-001.azurefd.net' + hostName: '${resourceName}.azurefd.net' sessionAffinityEnabledState: 'Disabled' sessionAffinityTtlSeconds: 60 } @@ -258,7 +258,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { enabledState: 'Enabled' frontendEndpoints: [ { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/FrontendEndpoints/frontEnd' + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/FrontendEndpoints/frontEnd' } ] patternsToMatch: [ @@ -267,7 +267,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { routeConfiguration: { '@odata.type': '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' backendPool: { - id: '/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/BackendPools/backendPool' + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/BackendPools/backendPool' } forwardingProtocol: 'MatchRequest' } @@ -293,7 +293,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "parameters": { // Required parameters "name": { - "value": "<>-az-fd-x-001" + "value": "" }, // Non-required parameters "backendPools": { @@ -317,10 +317,10 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } ], "HealthProbeSettings": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/HealthProbeSettings/heathProbe" + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe" }, "LoadBalancingSettings": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/LoadBalancingSettings/loadBalancer" + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer" } } } @@ -334,7 +334,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { { "name": "frontEnd", "properties": { - "hostName": "<>-az-fd-x-001.azurefd.net", + "hostName": "${resourceName}.azurefd.net", "sessionAffinityEnabledState": "Disabled", "sessionAffinityTtlSeconds": 60 } @@ -382,7 +382,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "enabledState": "Enabled", "frontendEndpoints": [ { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/FrontendEndpoints/frontEnd" + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/FrontendEndpoints/frontEnd" } ], "patternsToMatch": [ @@ -391,7 +391,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "routeConfiguration": { "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration", "backendPool": { - "id": "/subscriptions/<>/resourceGroups/validation-rg/providers/Microsoft.Network/frontDoors/<>-az-fd-x-001/BackendPools/backendPool" + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/BackendPools/backendPool" }, "forwardingProtocol": "MatchRequest" } @@ -408,3 +408,40 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = {

+ +

Example 2: Min

+ +
+ +via Bicep module + +```bicep +module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { + name: '${uniqueString(deployment().name)}-test-nfdmin' + params: { + name: '<>nfdmin001' + } +} +``` + +
+

+ +

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

From 911ef08246ac456cc9e47aaad00358023cbfbb84 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 16 Sep 2022 12:18:56 +0200 Subject: [PATCH 2/9] Adjusted mandatory parameters --- .../frontDoors/.test/min/deploy.test.bicep | 61 +++- .../Microsoft.Network/frontDoors/deploy.bicep | 16 +- .../Microsoft.Network/frontDoors/readme.md | 274 +++++++++++++----- 3 files changed, 264 insertions(+), 87 deletions(-) diff --git a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep index 1ce31ff2f7..7ef534b670 100644 --- a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep @@ -27,11 +27,68 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { // ============== // // Test Execution // // ============== // - +var resourceName = '<>${serviceShort}001' module testDeployment '../../deploy.bicep' = { scope: resourceGroup name: '${uniqueString(deployment().name)}-test-${serviceShort}' params: { - name: '<>${serviceShort}001' + name: resourceName + frontendEndpoints: [ + { + name: 'frontEnd' + properties: { + hostName: '${resourceName}.azurefd.net' + sessionAffinityEnabledState: 'Disabled' + sessionAffinityTtlSeconds: 60 + } + } + ] + healthProbeSettings: [ + { + name: 'heathProbe' + properties: { + // enabledState: '' + // healthProbeMethod: '' + intervalInSeconds: 60 + path: '/' + protocol: 'Https' + } + } + ] + loadBalancingSettings: [ + { + name: 'loadBalancer' + properties: { + additionalLatencyMilliseconds: 0 + sampleSize: 50 + successfulSamplesRequired: 1 + } + } + ] + routingRules: [ + { + name: 'routingRule' + properties: { + acceptedProtocols: [ + 'Https' + ] + enabledState: 'Enabled' + frontendEndpoints: [ + { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/FrontendEndpoints/frontEnd' + } + ] + patternsToMatch: [ + '/*' + ] + routeConfiguration: { + '@odata.type': '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' + backendPool: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/BackendPools/backendPool' + } + } + } + } + ] } } diff --git a/modules/Microsoft.Network/frontDoors/deploy.bicep b/modules/Microsoft.Network/frontDoors/deploy.bicep index 609b3ed924..0ba0b5b5d3 100644 --- a/modules/Microsoft.Network/frontDoors/deploy.bicep +++ b/modules/Microsoft.Network/frontDoors/deploy.bicep @@ -38,17 +38,17 @@ param enabledState string = 'Enabled' @description('Optional. Friendly name of the frontdoor resource.') param friendlyName string = '' -@description('Optional. Frontend endpoints of the frontdoor resource.') -param frontendEndpoints array = [] +@description('Required. Frontend endpoints of the frontdoor resource.') +param frontendEndpoints array -@description('Optional. Heath probe settings of the frontdoor resource.') -param healthProbeSettings array = [] +@description('Required. Heath probe settings of the frontdoor resource.') +param healthProbeSettings array -@description('Optional. Load balancing settings of the frontdoor resource.') -param loadBalancingSettings array = [] +@description('Required. Load balancing settings of the frontdoor resource.') +param loadBalancingSettings array -@description('Optional. Routing rules settings of the frontdoor resource.') -param routingRules array = [] +@description('Required. Routing rules settings of the frontdoor resource.') +param routingRules array @description('Optional. Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely.') @minValue(0) diff --git a/modules/Microsoft.Network/frontDoors/readme.md b/modules/Microsoft.Network/frontDoors/readme.md index 4b4fd9962b..337184a25d 100644 --- a/modules/Microsoft.Network/frontDoors/readme.md +++ b/modules/Microsoft.Network/frontDoors/readme.md @@ -25,7 +25,11 @@ This module deploys Front Doors. **Required parameters** | Parameter Name | Type | Description | | :-- | :-- | :-- | +| `frontendEndpoints` | array | Frontend endpoints of the frontdoor resource. | +| `healthProbeSettings` | array | Heath probe settings of the frontdoor resource. | +| `loadBalancingSettings` | array | Load balancing settings of the frontdoor resource. | | `name` | string | The name of the frontDoor. | +| `routingRules` | array | Routing rules settings of the frontdoor resource. | **Optional parameters** | Parameter Name | Type | Default Value | Allowed Values | Description | @@ -40,15 +44,11 @@ This module deploys Front Doors. | `enabledState` | string | `'Enabled'` | | State of the frontdoor resource. | | `enforceCertificateNameCheck` | string | `'Disabled'` | | Enforce certificate name check of the frontdoor resource. | | `friendlyName` | string | `''` | | Friendly name of the frontdoor resource. | -| `frontendEndpoints` | array | `[]` | | Frontend endpoints of the frontdoor resource. | -| `healthProbeSettings` | array | `[]` | | Heath probe settings of the frontdoor resource. | -| `loadBalancingSettings` | array | `[]` | | Load balancing settings of the frontdoor resource. | | `location` | string | `[resourceGroup().location]` | | Location for all resources. | | `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. | | `logsToEnable` | array | `[FrontdoorAccessLog, FrontdoorWebApplicationFirewallLog]` | `[FrontdoorAccessLog, FrontdoorWebApplicationFirewallLog]` | The name of logs that will be streamed. | | `metricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. | | `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. | -| `routingRules` | array | `[]` | | Routing rules settings of the frontdoor resource. | | `sendRecvTimeoutSeconds` | int | `600` | | Certificate name check time of the frontdoor resource. | | `tags` | object | `{object}` | | Resource tags. | @@ -183,37 +183,6 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-nfdcom' params: { // Required parameters - name: '' - // Non-required parameters - backendPools: [ - { - name: 'backendPool' - properties: { - backends: [ - { - address: 'biceptest.local' - backendHostHeader: 'backendAddress' - enabledState: 'Enabled' - httpPort: 80 - httpsPort: 443 - priority: 1 - privateLinkAlias: '' - privateLinkApprovalMessage: '' - privateLinkLocation: '' - privateLinkResourceId: '' - weight: 50 - } - ] - HealthProbeSettings: { - id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe' - } - LoadBalancingSettings: { - id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer' - } - } - } - ] - enforceCertificateNameCheck: 'Disabled' frontendEndpoints: [ { name: 'frontEnd' @@ -246,7 +215,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } } ] - lock: 'CanNotDelete' + name: '' routingRules: [ { name: 'routingRule' @@ -274,6 +243,37 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } } ] + // Non-required parameters + backendPools: [ + { + name: 'backendPool' + properties: { + backends: [ + { + address: 'biceptest.local' + backendHostHeader: 'backendAddress' + enabledState: 'Enabled' + httpPort: 80 + httpsPort: 443 + priority: 1 + privateLinkAlias: '' + privateLinkApprovalMessage: '' + privateLinkLocation: '' + privateLinkResourceId: '' + weight: 50 + } + ] + HealthProbeSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe' + } + LoadBalancingSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer' + } + } + } + ] + enforceCertificateNameCheck: 'Disabled' + lock: 'CanNotDelete' sendRecvTimeoutSeconds: 10 } } @@ -292,43 +292,6 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "contentVersion": "1.0.0.0", "parameters": { // Required parameters - "name": { - "value": "" - }, - // Non-required parameters - "backendPools": { - "value": [ - { - "name": "backendPool", - "properties": { - "backends": [ - { - "address": "biceptest.local", - "backendHostHeader": "backendAddress", - "enabledState": "Enabled", - "httpPort": 80, - "httpsPort": 443, - "priority": 1, - "privateLinkAlias": "", - "privateLinkApprovalMessage": "", - "privateLinkLocation": "", - "privateLinkResourceId": "", - "weight": 50 - } - ], - "HealthProbeSettings": { - "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe" - }, - "LoadBalancingSettings": { - "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer" - } - } - } - ] - }, - "enforceCertificateNameCheck": { - "value": "Disabled" - }, "frontendEndpoints": { "value": [ { @@ -367,8 +330,8 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } ] }, - "lock": { - "value": "CanNotDelete" + "name": { + "value": "" }, "routingRules": { "value": [ @@ -399,6 +362,43 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } ] }, + // Non-required parameters + "backendPools": { + "value": [ + { + "name": "backendPool", + "properties": { + "backends": [ + { + "address": "biceptest.local", + "backendHostHeader": "backendAddress", + "enabledState": "Enabled", + "httpPort": 80, + "httpsPort": 443, + "priority": 1, + "privateLinkAlias": "", + "privateLinkApprovalMessage": "", + "privateLinkLocation": "", + "privateLinkResourceId": "", + "weight": 50 + } + ], + "HealthProbeSettings": { + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe" + }, + "LoadBalancingSettings": { + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer" + } + } + } + ] + }, + "enforceCertificateNameCheck": { + "value": "Disabled" + }, + "lock": { + "value": "CanNotDelete" + }, "sendRecvTimeoutSeconds": { "value": 10 } @@ -419,7 +419,63 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-nfdmin' params: { - name: '<>nfdmin001' + // Required parameters + frontendEndpoints: [ + { + name: 'frontEnd' + properties: { + hostName: '${resourceName}.azurefd.net' + sessionAffinityEnabledState: 'Disabled' + sessionAffinityTtlSeconds: 60 + } + } + ] + healthProbeSettings: [ + { + name: 'heathProbe' + properties: { + intervalInSeconds: 60 + path: '/' + protocol: 'Https' + } + } + ] + loadBalancingSettings: [ + { + name: 'loadBalancer' + properties: { + additionalLatencyMilliseconds: 0 + sampleSize: 50 + successfulSamplesRequired: 1 + } + } + ] + name: '' + routingRules: [ + { + name: 'routingRule' + properties: { + acceptedProtocols: [ + 'Https' + ] + enabledState: 'Enabled' + frontendEndpoints: [ + { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/FrontendEndpoints/frontEnd' + } + ] + patternsToMatch: [ + '/*' + ] + routeConfiguration: { + '@odata.type': '#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration' + backendPool: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/BackendPools/backendPool' + } + } + } + } + ] } } ``` @@ -436,8 +492,72 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { + // Required parameters + "frontendEndpoints": { + "value": [ + { + "name": "frontEnd", + "properties": { + "hostName": "${resourceName}.azurefd.net", + "sessionAffinityEnabledState": "Disabled", + "sessionAffinityTtlSeconds": 60 + } + } + ] + }, + "healthProbeSettings": { + "value": [ + { + "name": "heathProbe", + "properties": { + "intervalInSeconds": 60, + "path": "/", + "protocol": "Https" + } + } + ] + }, + "loadBalancingSettings": { + "value": [ + { + "name": "loadBalancer", + "properties": { + "additionalLatencyMilliseconds": 0, + "sampleSize": 50, + "successfulSamplesRequired": 1 + } + } + ] + }, "name": { - "value": "<>nfdmin001" + "value": "" + }, + "routingRules": { + "value": [ + { + "name": "routingRule", + "properties": { + "acceptedProtocols": [ + "Https" + ], + "enabledState": "Enabled", + "frontendEndpoints": [ + { + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/FrontendEndpoints/frontEnd" + } + ], + "patternsToMatch": [ + "/*" + ], + "routeConfiguration": { + "@odata.type": "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration", + "backendPool": { + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/BackendPools/backendPool" + } + } + } + } + ] } } } From 9b56530b1fc765dc01f6be3709f35215a3c81da8 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 16 Sep 2022 12:59:42 +0200 Subject: [PATCH 3/9] Adjusted mandatory parameters --- .../frontDoors/.test/min/deploy.test.bicep | 26 +++++++++++++++++-- .../Microsoft.Network/frontDoors/deploy.bicep | 4 +-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep index 7ef534b670..80aef9ed9e 100644 --- a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep @@ -47,8 +47,6 @@ module testDeployment '../../deploy.bicep' = { { name: 'heathProbe' properties: { - // enabledState: '' - // healthProbeMethod: '' intervalInSeconds: 60 path: '/' protocol: 'Https' @@ -90,5 +88,29 @@ module testDeployment '../../deploy.bicep' = { } } ] + backendPools: [ + { + name: 'backendPool' + properties: { + backends: [ + { + address: 'biceptest.local' + backendHostHeader: 'backendAddress' + enabledState: 'Enabled' + httpPort: 80 + httpsPort: 443 + priority: 1 + weight: 50 + } + ] + HealthProbeSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe' + } + LoadBalancingSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer' + } + } + } + ] } } diff --git a/modules/Microsoft.Network/frontDoors/deploy.bicep b/modules/Microsoft.Network/frontDoors/deploy.bicep index 0ba0b5b5d3..fa70fb847b 100644 --- a/modules/Microsoft.Network/frontDoors/deploy.bicep +++ b/modules/Microsoft.Network/frontDoors/deploy.bicep @@ -23,8 +23,8 @@ param tags object = {} @description('Optional. Enable telemetry via the Customer Usage Attribution ID (GUID).') param enableDefaultTelemetry bool = true -@description('Optional. Backend address pool of the frontdoor resource.') -param backendPools array = [] +@description('Required. Backend address pool of the frontdoor resource.') +param backendPools array @description('Optional. Enforce certificate name check of the frontdoor resource.') param enforceCertificateNameCheck string = 'Disabled' From 52311421724db25336db45c008526532efb3da5c Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 16 Sep 2022 13:03:35 +0200 Subject: [PATCH 4/9] Updated ReadMe --- .../Microsoft.Network/frontDoors/readme.md | 168 ++++++++++++------ 1 file changed, 109 insertions(+), 59 deletions(-) diff --git a/modules/Microsoft.Network/frontDoors/readme.md b/modules/Microsoft.Network/frontDoors/readme.md index 337184a25d..8d9a35377a 100644 --- a/modules/Microsoft.Network/frontDoors/readme.md +++ b/modules/Microsoft.Network/frontDoors/readme.md @@ -25,6 +25,7 @@ This module deploys Front Doors. **Required parameters** | Parameter Name | Type | Description | | :-- | :-- | :-- | +| `backendPools` | array | Backend address pool of the frontdoor resource. | | `frontendEndpoints` | array | Frontend endpoints of the frontdoor resource. | | `healthProbeSettings` | array | Heath probe settings of the frontdoor resource. | | `loadBalancingSettings` | array | Load balancing settings of the frontdoor resource. | @@ -34,7 +35,6 @@ This module deploys Front Doors. **Optional parameters** | Parameter Name | Type | Default Value | Allowed Values | Description | | :-- | :-- | :-- | :-- | :-- | -| `backendPools` | array | `[]` | | Backend address pool of the frontdoor resource. | | `diagnosticEventHubAuthorizationRuleId` | string | `''` | | Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to. | | `diagnosticEventHubName` | string | `''` | | Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub. | | `diagnosticLogsRetentionInDays` | int | `365` | | Specifies the number of days that logs will be kept for; a value of 0 will retain data indefinitely. | @@ -183,6 +183,34 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-nfdcom' params: { // Required parameters + backendPools: [ + { + name: 'backendPool' + properties: { + backends: [ + { + address: 'biceptest.local' + backendHostHeader: 'backendAddress' + enabledState: 'Enabled' + httpPort: 80 + httpsPort: 443 + priority: 1 + privateLinkAlias: '' + privateLinkApprovalMessage: '' + privateLinkLocation: '' + privateLinkResourceId: '' + weight: 50 + } + ] + HealthProbeSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe' + } + LoadBalancingSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer' + } + } + } + ] frontendEndpoints: [ { name: 'frontEnd' @@ -244,34 +272,6 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } ] // Non-required parameters - backendPools: [ - { - name: 'backendPool' - properties: { - backends: [ - { - address: 'biceptest.local' - backendHostHeader: 'backendAddress' - enabledState: 'Enabled' - httpPort: 80 - httpsPort: 443 - priority: 1 - privateLinkAlias: '' - privateLinkApprovalMessage: '' - privateLinkLocation: '' - privateLinkResourceId: '' - weight: 50 - } - ] - HealthProbeSettings: { - id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe' - } - LoadBalancingSettings: { - id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer' - } - } - } - ] enforceCertificateNameCheck: 'Disabled' lock: 'CanNotDelete' sendRecvTimeoutSeconds: 10 @@ -292,6 +292,36 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "contentVersion": "1.0.0.0", "parameters": { // Required parameters + "backendPools": { + "value": [ + { + "name": "backendPool", + "properties": { + "backends": [ + { + "address": "biceptest.local", + "backendHostHeader": "backendAddress", + "enabledState": "Enabled", + "httpPort": 80, + "httpsPort": 443, + "priority": 1, + "privateLinkAlias": "", + "privateLinkApprovalMessage": "", + "privateLinkLocation": "", + "privateLinkResourceId": "", + "weight": 50 + } + ], + "HealthProbeSettings": { + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe" + }, + "LoadBalancingSettings": { + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer" + } + } + } + ] + }, "frontendEndpoints": { "value": [ { @@ -363,36 +393,6 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { ] }, // Non-required parameters - "backendPools": { - "value": [ - { - "name": "backendPool", - "properties": { - "backends": [ - { - "address": "biceptest.local", - "backendHostHeader": "backendAddress", - "enabledState": "Enabled", - "httpPort": 80, - "httpsPort": 443, - "priority": 1, - "privateLinkAlias": "", - "privateLinkApprovalMessage": "", - "privateLinkLocation": "", - "privateLinkResourceId": "", - "weight": 50 - } - ], - "HealthProbeSettings": { - "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe" - }, - "LoadBalancingSettings": { - "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer" - } - } - } - ] - }, "enforceCertificateNameCheck": { "value": "Disabled" }, @@ -420,6 +420,30 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { name: '${uniqueString(deployment().name)}-test-nfdmin' params: { // Required parameters + backendPools: [ + { + name: 'backendPool' + properties: { + backends: [ + { + address: 'biceptest.local' + backendHostHeader: 'backendAddress' + enabledState: 'Enabled' + httpPort: 80 + httpsPort: 443 + priority: 1 + weight: 50 + } + ] + HealthProbeSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe' + } + LoadBalancingSettings: { + id: '${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer' + } + } + } + ] frontendEndpoints: [ { name: 'frontEnd' @@ -493,6 +517,32 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "contentVersion": "1.0.0.0", "parameters": { // Required parameters + "backendPools": { + "value": [ + { + "name": "backendPool", + "properties": { + "backends": [ + { + "address": "biceptest.local", + "backendHostHeader": "backendAddress", + "enabledState": "Enabled", + "httpPort": 80, + "httpsPort": 443, + "priority": 1, + "weight": 50 + } + ], + "HealthProbeSettings": { + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/HealthProbeSettings/heathProbe" + }, + "LoadBalancingSettings": { + "id": "${resourceGroup.id}/providers/Microsoft.Network/frontDoors/${resourceName}/LoadBalancingSettings/loadBalancer" + } + } + } + ] + }, "frontendEndpoints": { "value": [ { From c4344c376b6ea51cbc8eaa1c0c73c1a7d04e0acf Mon Sep 17 00:00:00 2001 From: MrMCake Date: Fri, 16 Sep 2022 15:43:59 +0200 Subject: [PATCH 5/9] Added missing max --- modules/Microsoft.Network/frontDoors/deploy.bicep | 3 ++- modules/Microsoft.Network/frontDoors/readme.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/Microsoft.Network/frontDoors/deploy.bicep b/modules/Microsoft.Network/frontDoors/deploy.bicep index fa70fb847b..4c42a2e459 100644 --- a/modules/Microsoft.Network/frontDoors/deploy.bicep +++ b/modules/Microsoft.Network/frontDoors/deploy.bicep @@ -30,7 +30,8 @@ param backendPools array param enforceCertificateNameCheck string = 'Disabled' @description('Optional. Certificate name check time of the frontdoor resource.') -param sendRecvTimeoutSeconds int = 600 +@maxValue(240) +param sendRecvTimeoutSeconds int = 240 @description('Optional. State of the frontdoor resource.') param enabledState string = 'Enabled' diff --git a/modules/Microsoft.Network/frontDoors/readme.md b/modules/Microsoft.Network/frontDoors/readme.md index 8d9a35377a..4510ad8c2f 100644 --- a/modules/Microsoft.Network/frontDoors/readme.md +++ b/modules/Microsoft.Network/frontDoors/readme.md @@ -49,7 +49,7 @@ This module deploys Front Doors. | `logsToEnable` | array | `[FrontdoorAccessLog, FrontdoorWebApplicationFirewallLog]` | `[FrontdoorAccessLog, FrontdoorWebApplicationFirewallLog]` | The name of logs that will be streamed. | | `metricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | The name of metrics that will be streamed. | | `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. | -| `sendRecvTimeoutSeconds` | int | `600` | | Certificate name check time of the frontdoor resource. | +| `sendRecvTimeoutSeconds` | int | `240` | | Certificate name check time of the frontdoor resource. | | `tags` | object | `{object}` | | Resource tags. | From 5036a50e390b520c78290c126f9dfdce03ab79b8 Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Sun, 18 Sep 2022 23:42:42 +0200 Subject: [PATCH 6/9] Update modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep --- .../Microsoft.Network/frontDoors/.test/common/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep index 81033cb7e1..07090081dc 100644 --- a/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep @@ -3,7 +3,7 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for a testing purposes') +@description('Optional. The name of the resource group to deploy for testing purposes') @maxLength(90) param resourceGroupName string = 'ms.network.frontdoors-${serviceShort}-rg' From 9033564bafa791d60bfa508a3e0050c42b9bb13c Mon Sep 17 00:00:00 2001 From: Alexander Sehr Date: Sun, 18 Sep 2022 23:42:57 +0200 Subject: [PATCH 7/9] Update modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep --- .../Microsoft.Network/frontDoors/.test/min/deploy.test.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep index 80aef9ed9e..c23d4a73e4 100644 --- a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Network/frontDoors/.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.network.frontdoors-${serviceShort}-rg' From 3b7f7dd20c9169c79ab309d7d62ef41e1edcb5d9 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Wed, 5 Oct 2022 21:10:09 +0200 Subject: [PATCH 8/9] Update to latest --- .../frontDoors/.test/common/deploy.test.bicep | 6 +++--- .../frontDoors/.test/min/deploy.test.bicep | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep index 07090081dc..a7790dcc03 100644 --- a/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for testing purposes') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.network.frontdoors-${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 = 'nfdcom' // =========== // diff --git a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep index c23d4a73e4..f466f03f9e 100644 --- a/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep +++ b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep @@ -3,14 +3,14 @@ targetScope = 'subscription' // ========== // // Parameters // // ========== // -@description('Optional. The name of the resource group to deploy for testing purposes') +@description('Optional. The name of the resource group to deploy for testing purposes.') @maxLength(90) param resourceGroupName string = 'ms.network.frontdoors-${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 = 'nfdmin' // =========== // From 8f123444eb1210ccb4b15802a925538433732c37 Mon Sep 17 00:00:00 2001 From: MrMCake Date: Thu, 6 Oct 2022 11:24:21 +0200 Subject: [PATCH 9/9] Added missing test --- .../frontDoors/.test/common/deploy.test.bicep | 8 ++++++++ modules/Microsoft.Network/frontDoors/readme.md | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep index a7790dcc03..524c53f47d 100644 --- a/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep @@ -131,5 +131,13 @@ module testDeployment '../../deploy.bicep' = { } ] sendRecvTimeoutSeconds: 10 + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] } } diff --git a/modules/Microsoft.Network/frontDoors/readme.md b/modules/Microsoft.Network/frontDoors/readme.md index 4510ad8c2f..d30d381e21 100644 --- a/modules/Microsoft.Network/frontDoors/readme.md +++ b/modules/Microsoft.Network/frontDoors/readme.md @@ -274,6 +274,14 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { // Non-required parameters enforceCertificateNameCheck: 'Disabled' lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + '' + ] + roleDefinitionIdOrName: 'Reader' + } + ] sendRecvTimeoutSeconds: 10 } } @@ -399,6 +407,16 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "lock": { "value": "CanNotDelete" }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, "sendRecvTimeoutSeconds": { "value": 10 }