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..524c53f47d --- /dev/null +++ b/modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep @@ -0,0 +1,143 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@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.') +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 + roleAssignments: [ + { + principalIds: [ + resourceGroupResources.outputs.managedIdentityPrincipalId + ] + roleDefinitionIdOrName: 'Reader' + } + ] + } +} 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..f466f03f9e --- /dev/null +++ b/modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep @@ -0,0 +1,116 @@ +targetScope = 'subscription' + +// ========== // +// Parameters // +// ========== // +@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.') +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 // +// ============== // +var resourceName = '<>${serviceShort}001' +module testDeployment '../../deploy.bicep' = { + scope: resourceGroup + name: '${uniqueString(deployment().name)}-test-${serviceShort}' + params: { + name: resourceName + 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 + } + } + ] + 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' + } + } + } + } + ] + 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/.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/deploy.bicep b/modules/Microsoft.Network/frontDoors/deploy.bicep index 609b3ed924..4c42a2e459 100644 --- a/modules/Microsoft.Network/frontDoors/deploy.bicep +++ b/modules/Microsoft.Network/frontDoors/deploy.bicep @@ -23,14 +23,15 @@ 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' @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' @@ -38,17 +39,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 05d36d46f4..d30d381e21 100644 --- a/modules/Microsoft.Network/frontDoors/readme.md +++ b/modules/Microsoft.Network/frontDoors/readme.md @@ -25,12 +25,16 @@ 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. | | `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 | | :-- | :-- | :-- | :-- | :-- | -| `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. | @@ -40,16 +44,12 @@ 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. | +| `sendRecvTimeoutSeconds` | int | `240` | | Certificate name check time of the frontdoor resource. | | `tags` | object | `{object}` | | Resource tags. | @@ -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,11 +180,9 @@ 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' - // Non-required parameters backendPools: [ { name: 'backendPool' @@ -205,20 +203,19 @@ 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' } } } ] - enforceCertificateNameCheck: 'Disabled' frontendEndpoints: [ { name: 'frontEnd' properties: { - hostName: '<>-az-fd-x-001.azurefd.net' + hostName: '${resourceName}.azurefd.net' sessionAffinityEnabledState: 'Disabled' sessionAffinityTtlSeconds: 60 } @@ -246,7 +243,7 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } } ] - lock: 'CanNotDelete' + name: '' routingRules: [ { name: 'routingRule' @@ -258,7 +255,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,13 +264,24 @@ 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' } } } ] + // Non-required parameters + enforceCertificateNameCheck: 'Disabled' + lock: 'CanNotDelete' + roleAssignments: [ + { + principalIds: [ + '' + ] + roleDefinitionIdOrName: 'Reader' + } + ] sendRecvTimeoutSeconds: 10 } } @@ -292,10 +300,6 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { "contentVersion": "1.0.0.0", "parameters": { // Required parameters - "name": { - "value": "<>-az-fd-x-001" - }, - // Non-required parameters "backendPools": { "value": [ { @@ -317,24 +321,21 @@ 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" } } } ] }, - "enforceCertificateNameCheck": { - "value": "Disabled" - }, "frontendEndpoints": { "value": [ { "name": "frontEnd", "properties": { - "hostName": "<>-az-fd-x-001.azurefd.net", + "hostName": "${resourceName}.azurefd.net", "sessionAffinityEnabledState": "Disabled", "sessionAffinityTtlSeconds": 60 } @@ -367,8 +368,8 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } ] }, - "lock": { - "value": "CanNotDelete" + "name": { + "value": "" }, "routingRules": { "value": [ @@ -382,7 +383,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 +392,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" } @@ -399,6 +400,23 @@ module frontDoors './Microsoft.Network/frontDoors/deploy.bicep' = { } ] }, + // Non-required parameters + "enforceCertificateNameCheck": { + "value": "Disabled" + }, + "lock": { + "value": "CanNotDelete" + }, + "roleAssignments": { + "value": [ + { + "principalIds": [ + "" + ], + "roleDefinitionIdOrName": "Reader" + } + ] + }, "sendRecvTimeoutSeconds": { "value": 10 } @@ -408,3 +426,210 @@ 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: { + // 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' + 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' + } + } + } + } + ] + } +} +``` + +
+

+ +

+ +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 + "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": [ + { + "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": "" + }, + "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" + } + } + } + } + ] + } + } +} +``` + +
+