-
Notifications
You must be signed in to change notification settings - Fork 437
[Modules] Update Network FrontDoors to new dependency approach #2050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
597ef91
Update Network FrontDoors to new dependency approach
AlexanderSehr 911ef08
Adjusted mandatory parameters
AlexanderSehr 9b56530
Adjusted mandatory parameters
AlexanderSehr 5231142
Updated ReadMe
AlexanderSehr c4344c3
Added missing max
AlexanderSehr 5036a50
Update modules/Microsoft.Network/frontDoors/.test/common/deploy.test.…
AlexanderSehr 9033564
Update modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep
AlexanderSehr 3b7f7dd
Update to latest
AlexanderSehr 8f12344
Added missing test
AlexanderSehr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
modules/Microsoft.Network/frontDoors/.test/common/dependencies.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
|
143 changes: 143 additions & 0 deletions
143
modules/Microsoft.Network/frontDoors/.test/common/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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-<<namePrefix>>-msi-${serviceShort}' | ||
| } | ||
| } | ||
|
|
||
| // ============== // | ||
| // Test Execution // | ||
| // ============== // | ||
| var resourceName = '<<namePrefix>>${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' | ||
| } | ||
| ] | ||
| } | ||
| } | ||
116 changes: 116 additions & 0 deletions
116
modules/Microsoft.Network/frontDoors/.test/min/deploy.test.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 = '<<namePrefix>>${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' | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.