Skip to content

Commit

Permalink
fix: Global deployment Resource Group Fix (#863)
Browse files Browse the repository at this point in the history
## Description


[![avm.res.api-management.service](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.api-management.service.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.api-management.service.yml)

[![avm.res.app.managed-environment](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.app.managed-environment.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.app.managed-environment.yml)

[![avm.res.automation.automation-account](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.automation.automation-account.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.automation.automation-account.yml)

[![avm.res.batch.batch-account](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.batch.batch-account.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.batch.batch-account.yml)

[![avm.res.cognitive-services.account](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.cognitive-services.account.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.cognitive-services.account.yml)

[![avm.res.compute.disk-encryption-set](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.disk-encryption-set.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.disk-encryption-set.yml)

[![avm.res.compute.gallery](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.gallery.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.gallery.yml)

[![avm.res.compute.proximity-placement-group](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.proximity-placement-group.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.proximity-placement-group.yml)

[![avm.res.compute.ssh-public-key](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.ssh-public-key.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.ssh-public-key.yml)

[![avm.res.compute.virtual-machine](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml)

[![avm.res.data-factory.factory](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.data-factory.factory.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.data-factory.factory.yml)

[![avm.res.db-for-postgre-sql.flexible-server](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.db-for-postgre-sql.flexible-server.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.db-for-postgre-sql.flexible-server.yml)

[![avm.res.document-db.database-account](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.document-db.database-account.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.document-db.database-account.yml)

[![avm.res.event-grid.domain](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.event-grid.domain.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.event-grid.domain.yml)

[![avm.res.event-grid.system-topic](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.event-grid.system-topic.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.event-grid.system-topic.yml)

[![avm.res.event-grid.topic](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.event-grid.topic.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.event-grid.topic.yml)

[![avm.res.insights.action-group](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.action-group.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.action-group.yml)

[![avm.res.insights.activity-log-alert](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.activity-log-alert.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.activity-log-alert.yml)

[![avm.res.insights.component](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.component.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.component.yml)

[![avm.res.insights.data-collection-endpoint](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.data-collection-endpoint.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.data-collection-endpoint.yml)

[![avm.res.insights.data-collection-rule](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.data-collection-rule.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.data-collection-rule.yml)

[![avm.res.insights.diagnostic-setting](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.diagnostic-setting.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.diagnostic-setting.yml)

[![avm.res.insights.metric-alert](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.metric-alert.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.metric-alert.yml)

[![avm.res.insights.scheduled-query-rule](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.scheduled-query-rule.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.scheduled-query-rule.yml)

[![avm.res.insights.webtest](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.webtest.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.insights.webtest.yml)

[![avm.res.key-vault.vault](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml)

[![avm.res.kubernetes-configuration.extension](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.kubernetes-configuration.extension.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.kubernetes-configuration.extension.yml)

[![avm.res.kubernetes-configuration.flux-configuration](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.kubernetes-configuration.flux-configuration.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.kubernetes-configuration.flux-configuration.yml)

[![avm.res.logic.workflow](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.logic.workflow.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.logic.workflow.yml)

[![avm.res.maintenance.maintenance-configuration](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.maintenance.maintenance-configuration.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.maintenance.maintenance-configuration.yml)

[![avm.res.managed-identity.user-assigned-identity](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.managed-identity.user-assigned-identity.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.managed-identity.user-assigned-identity.yml)

[![avm.res.network.application-security-group](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.application-security-group.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.application-security-group.yml)

[![avm.res.network.bastion-host](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.bastion-host.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.bastion-host.yml)

[![avm.res.network.connection](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.connection.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.connection.yml)

[![avm.res.network.ddos-protection-plan](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.ddos-protection-plan.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.ddos-protection-plan.yml)

[![avm.res.network.dns-forwarding-ruleset](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.dns-forwarding-ruleset.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.dns-forwarding-ruleset.yml)

[![avm.res.network.dns-resolver](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.dns-resolver.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.dns-resolver.yml)

[![avm.res.network.dns-zone](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.dns-zone.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.dns-zone.yml)

[![avm.res.network.express-route-circuit](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.express-route-circuit.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.express-route-circuit.yml)

[![avm.res.network.express-route-gateway](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.express-route-gateway.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.express-route-gateway.yml)

[![avm.res.network.firewall-policy](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.firewall-policy.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.firewall-policy.yml)

[![avm.res.network.front-door-web-application-firewall-policy](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.front-door-web-application-firewall-policy.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.front-door-web-application-firewall-policy.yml)

[![avm.res.network.front-door](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.front-door.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.front-door.yml)

[![avm.res.network.load-balancer](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.load-balancer.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.load-balancer.yml)

[![avm.res.network.nat-gateways](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.nat-gateway.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.nat-gateway.yml)

[![avm.res.network.network-interface](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.network-interface.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.network-interface.yml)

[![avm.res.network.network-security-group](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.network-security-group.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.network-security-group.yml)

[![avm.res.network.private-dns-zone](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.private-dns-zone.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.private-dns-zone.yml)

[![avm.res.network.private-endpoint](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.private-endpoint.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.private-endpoint.yml)

[![avm.res.network.public-ip-address](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.public-ip-address.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.public-ip-address.yml)

[![avm.res.network.public-ip-prefix](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.public-ip-prefix.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.public-ip-prefix.yml)

[![avm.res.network.route-table](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.route-table.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.route-table.yml)

[![avm.res.network.trafficmanagerprofile](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.trafficmanagerprofile.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.trafficmanagerprofile.yml)

[![avm.res.network.virtual-network](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network.yml)

[![avm.res.network.vpn-gateway](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.vpn-gateway.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.vpn-gateway.yml)

[![avm.res.network.vpn-site](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.vpn-site.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.network.vpn-site.yml)

[![avm.res.operational-insights.workspace](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.operational-insights.workspace.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.operational-insights.workspace.yml)

[![avm.res.operations-management.solution](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.operations-management.solution.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.operations-management.solution.yml)

[![avm.res.power-bi-dedicated.capacity](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.power-bi-dedicated.capacity.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.power-bi-dedicated.capacity.yml)

[![avm.res.resource-graph.query](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.resource-graph.query.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.resource-graph.query.yml)

[![avm.res.resources.deployment-script](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.resources.deployment-script.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.resources.deployment-script.yml)

[![avm.res.resources.resource-group](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.resources.resource-group.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.resources.resource-group.yml)

[![avm.res.search.search-service](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.search.search-service.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.search.search-service.yml)

[![avm.res.service-bus.namespace](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.service-bus.namespace.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.service-bus.namespace.yml)

[![avm.res.sql.server](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml)

[![avm.res.web.serverfarm](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.web.serverfarm.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.web.serverfarm.yml)

[![avm.res.web.static-site](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.web.static-site.yml/badge.svg?branch=csidebotham%2Flocation-Testing&event=workflow_dispatch)](https://github.com/ChrisSidebotham/bicep-registry-modules/actions/workflows/avm.res.web.static-site.yml)

---------

Co-authored-by: Erika Gressi <[email protected]>
  • Loading branch information
ChrisSidebotham and eriqua authored Jan 27, 2024
1 parent af70b85 commit 9736ae1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ runs:
# Set fucntion input parameters
$functionInput = @{
ModuleRoot = '${{ inputs.modulePath }}'
GlobalResourceGroupLocation = '${{ inputs.deploymentMetadataLocation }}'
}
Write-Verbose "Invoke function with" -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
$resourceLocation = Get-AzAvailableResourceLocation @functionInput
$resourceLocation = Get-AzAvailableResourceLocation @functionInput -Verbose
$deploymentLocation = @{}
Write-Verbose ('{0}-{1}' -f 'resourceLocation', $resourceLocation) -Verbose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Required. The root path of the module.
.PARAMETER repoRoot
Optional. The root path of the repository.
.PARAMETER GlobalResourceGroupLocation
Required. The location of the resource group where the global resources will be deployed.
.EXAMPLE
Get-AzAvailableResourceLocation -ModuleRoot ".\avm\res\resources\resource-group" -repoRoot .\
Expand All @@ -29,6 +32,9 @@ function Get-AzAvailableResourceLocation {
[Parameter(Mandatory = $true)]
[string] $ModuleRoot,

[Parameter(Mandatory = $false)]
[string] $GlobalResourceGroupLocation,

[Parameter(Mandatory = $false)]
[array] $ExcludedRegions = @(
"asiasoutheast",
Expand Down Expand Up @@ -65,19 +71,27 @@ function Get-AzAvailableResourceLocation {
$ResourceRegionList = (Get-AzResourceProvider | Where-Object { $_.ProviderNamespace -eq $formattedResourceProvider }).ResourceTypes | Where-Object { $_.ResourceTypeName -eq $formattedServiceName } | Select-Object -ExpandProperty Locations
Write-Verbose "Region list: $($resourceRegionList | ConvertTo-Json)"

$locations = Get-AzLocation | Where-Object {
$_.DisplayName -in $ResourceRegionList -and
$_.Location -notin $ExcludedRegions -and
$_.PairedRegion -ne "{}" -and
$_.RegionCategory -eq "Recommended"
} | Select-Object -ExpandProperty Location
Write-Verbose "Available Locations: $($locations | ConvertTo-Json)"
if ($resourceRegionList -eq "global") {
Write-Verbose "Resource is global, default region [$GlobalResourceGroupLocation] will be used for resource group creation"
$location = $GlobalResourceGroupLocation # Set Location to resource group location. Globabl resources should have hardocded location in `main.bicep`
}
else {

$locations = Get-AzLocation | Where-Object {
$_.DisplayName -in $ResourceRegionList -and
$_.Location -notin $ExcludedRegions -and
$_.PairedRegion -ne "{}" -and
$_.RegionCategory -eq "Recommended"
} | Select-Object -ExpandProperty Location
Write-Verbose "Available Locations: $($locations | ConvertTo-Json)"


$index = Get-Random -Maximum ($locations.Count)
Write-Verbose "Generated random index [$index]"

$index = Get-Random -Maximum ($locations.Count)
Write-Verbose "Generated random index [$index]"
$location = $locations[$index]

$location = $locations[$index]
}
Write-Verbose "Selected location [$location]" -Verbose

return $location
Expand Down

0 comments on commit 9736ae1

Please sign in to comment.