Skip to content

Commit

Permalink
fix: Remove tempLocation workaround (#880)
Browse files Browse the repository at this point in the history
## Description

Remove `tempLocation` workaround after region selector adoption
All except `web.serverfarm`. That still has the workaround implemented
and has to be troubleshooted separately.
For `web.serverfarm` anyway the workaround has been updated to the one
commonly used by other modules (using `tempLocation` variable instead of
hardcoding location value)


[![avm.res.compute.virtual-machine](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml/badge.svg?branch=fix%2Flocation)](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml)

[![avm.res.compute.image](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.compute.image.yml/badge.svg?branch=fix%2Flocation)](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.compute.image.yml)

[![avm.res.databricks.workspace](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.databricks.workspace.yml/badge.svg?branch=fix%2Flocation)](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.databricks.workspace.yml)

[![avm.res.network.connection](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.network.connection.yml/badge.svg?branch=fix%2Flocation)](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.network.connection.yml)

[![avm.res.network.virtual-network-gateway](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network-gateway.yml/badge.svg?branch=fix%2Flocation)](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.network.virtual-network-gateway.yml)

[![avm.res.network.vpn-gateway](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.network.vpn-gateway.yml/badge.svg?branch=fix%2Flocation)](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.network.vpn-gateway.yml)

[![avm.res.web.serverfarm](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.web.serverfarm.yml/badge.svg?branch=fix%2Flocation)](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.web.serverfarm.yml)

[![avm.res.db-for-my-sql.flexible-server](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.db-for-my-sql.flexible-server.yml/badge.svg?branch=fix%2Flocation)](https://github.com/eriqua/bicep-registry-modules/actions/workflows/avm.res.db-for-my-sql.flexible-server.yml)
  • Loading branch information
eriqua authored Jan 30, 2024
1 parent a32a434 commit a24f695
Show file tree
Hide file tree
Showing 33 changed files with 103 additions and 178 deletions.
9 changes: 3 additions & 6 deletions avm/res/compute/image/tests/e2e/defaults/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ param baseTime string = utcNow('u')
@description('Optional. A token to inject into the name of each resource. This value can be automatically injected by the CI.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // services used for this module are only available in major regions
var tempLocation = 'eastus'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -36,15 +33,15 @@ var tempLocation = 'eastus'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: tempLocation
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: tempLocation
location: resourceLocation
storageAccountName: 'dep${namePrefix}sa${serviceShort}${substring(uniqueString(baseTime), 0, 3)}'
imageTemplateNamePrefix: 'dep-${namePrefix}-imgt-${serviceShort}'
triggerImageDeploymentScriptName: 'dep-${namePrefix}-ds-${serviceShort}-triggerImageTemplate'
Expand All @@ -62,7 +59,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: tempLocation
location: resourceLocation
osAccountType: 'Standard_LRS'
osDiskBlobUri: nestedDependencies.outputs.vhdUri
osDiskCaching: 'ReadWrite'
Expand Down
9 changes: 3 additions & 6 deletions avm/res/compute/image/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ param baseTime string = utcNow('u')
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // services used for this module are only available in major regions
var tempLocation = 'eastus'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -34,15 +31,15 @@ var tempLocation = 'eastus'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2022-09-01' = {
name: resourceGroupName
location: tempLocation
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: tempLocation
location: resourceLocation
// Adding base time to make the name unique as purge protection must be enabled (but may not be longer than 24 characters total)
keyVaultName: 'dep-${namePrefix}-kv-${serviceShort}-${substring(uniqueString(baseTime), 0, 3)}'
diskEncryptionSetName: 'dep-${namePrefix}-des-${serviceShort}'
Expand All @@ -62,7 +59,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: tempLocation
location: resourceLocation
osAccountType: 'Premium_LRS'
osDiskBlobUri: nestedDependencies.outputs.vhdUri
osDiskCaching: 'ReadWrite'
Expand Down
9 changes: 3 additions & 6 deletions avm/res/compute/image/tests/e2e/waf-aligned/main.test.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ param baseTime string = utcNow('u')
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // services used for this module are only available in major regions
var tempLocation = 'eastus'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -34,15 +31,15 @@ var tempLocation = 'eastus'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2022-09-01' = {
name: resourceGroupName
location: tempLocation
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
location: tempLocation
location: resourceLocation
// Adding base time to make the name unique as purge protection must be enabled (but may not be longer than 24 characters total)
keyVaultName: 'dep-${namePrefix}-kv-${serviceShort}-${substring(uniqueString(baseTime), 0, 3)}'
diskEncryptionSetName: 'dep-${namePrefix}-des-${serviceShort}'
Expand All @@ -62,7 +59,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
name: '${namePrefix}${serviceShort}001'
location: tempLocation
location: resourceLocation
osAccountType: 'Premium_LRS'
osDiskBlobUri: nestedDependencies.outputs.vhdUri
osDiskCaching: 'ReadWrite'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ param serviceShort string = 'cvmlinatmg'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // Just a value to avoid ongoing capacity challenges
var tempLocation = 'northeurope'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -38,7 +35,7 @@ module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
location: tempLocation
location: resourceLocation
virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}'
sshDeploymentScriptName: 'dep-${namePrefix}-ds-${serviceShort}'
sshKeyName: 'dep-${namePrefix}-ssh-${serviceShort}'
Expand All @@ -60,7 +57,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
location: tempLocation
location: resourceLocation
name: '${namePrefix}${serviceShort}'
adminUsername: 'localAdminUser'
imageReference: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ param serviceShort string = 'cvmlinmin'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // Just a value to avoid ongoing capacity challenges
var tempLocation = 'northeurope'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -38,7 +35,7 @@ module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
location: tempLocation
location: resourceLocation
virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}'
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
sshDeploymentScriptName: 'dep-${namePrefix}-ds-${serviceShort}'
Expand All @@ -60,7 +57,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
location: tempLocation
location: resourceLocation
name: '${namePrefix}${serviceShort}'
adminUsername: 'localAdminUser'
imageReference: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ param serviceShort string = 'cvmlinmax'
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // Just a value to avoid ongoing capacity challenges
var tempLocation = 'northeurope'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -31,14 +28,14 @@ var tempLocation = 'northeurope'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: tempLocation
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
location: tempLocation
location: resourceLocation
virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}'
applicationSecurityGroupName: 'dep-${namePrefix}-asg-${serviceShort}'
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
Expand All @@ -62,7 +59,7 @@ module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/t
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}'
eventHubNamespaceEventHubName: 'dep-${namePrefix}-evh-${serviceShort}'
eventHubNamespaceName: 'dep-${namePrefix}-evhns-${serviceShort}'
location: tempLocation
location: resourceLocation
}
}

Expand All @@ -76,7 +73,7 @@ module testDeployment '../../../main.bicep' = {
params: {
name: '${namePrefix}${serviceShort}'
computerName: '${namePrefix}linvm1'
location: tempLocation
location: resourceLocation
adminUsername: 'localAdministrator'
imageReference: {
publisher: 'Canonical'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ param password string = newGuid()
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // Just a value to avoid ongoing capacity challenges
var tempLocation = 'northeurope'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -35,14 +32,14 @@ var tempLocation = 'northeurope'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: tempLocation
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
location: tempLocation
location: resourceLocation
virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}'
applicationSecurityGroupName: 'dep-${namePrefix}-asg-${serviceShort}'
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
Expand All @@ -65,7 +62,7 @@ module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/t
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}'
eventHubNamespaceEventHubName: 'dep-${namePrefix}-evh-${serviceShort}'
eventHubNamespaceName: 'dep-${namePrefix}-evhns-${serviceShort}'
location: tempLocation
location: resourceLocation
}
}

Expand All @@ -78,7 +75,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
location: tempLocation
location: resourceLocation
name: '${namePrefix}${serviceShort}'
computerName: '${namePrefix}winvm1'
adminUsername: 'VMAdmin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ param password string = newGuid()
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // Just a value to avoid ongoing capacity challenges
var tempLocation = 'northeurope'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -35,14 +32,14 @@ var tempLocation = 'northeurope'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: tempLocation
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
location: tempLocation
location: resourceLocation
virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}'
}
}
Expand All @@ -55,7 +52,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
location: tempLocation
location: resourceLocation
name: '${namePrefix}${serviceShort}'
adminUsername: 'localAdminUser'
imageReference: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ param password string = newGuid()
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // Just a value to avoid ongoing capacity challenges
var tempLocation = 'northeurope'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -35,14 +32,14 @@ var tempLocation = 'northeurope'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: tempLocation
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
location: tempLocation
location: resourceLocation
virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}'
applicationSecurityGroupName: 'dep-${namePrefix}-asg-${serviceShort}'
managedIdentityName: 'dep-${namePrefix}-msi-${serviceShort}'
Expand All @@ -65,7 +62,7 @@ module diagnosticDependencies '../../../../../../utilities/e2e-template-assets/t
logAnalyticsWorkspaceName: 'dep-${namePrefix}-law-${serviceShort}'
eventHubNamespaceEventHubName: 'dep-${namePrefix}-evh-${serviceShort}'
eventHubNamespaceName: 'dep-${namePrefix}-evhns-${serviceShort}'
location: tempLocation
location: resourceLocation
}
}

Expand All @@ -78,7 +75,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
location: tempLocation
location: resourceLocation
name: '${namePrefix}${serviceShort}'
computerName: '${namePrefix}winvm1'
adminUsername: 'VMAdmin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ param baseTime string = utcNow('u')
@description('Optional. A token to inject into the name of each resource.')
param namePrefix string = '#_namePrefix_#'

#disable-next-line no-hardcoded-location // Just a value to avoid ongoing capacity challenges
var tempLocation = 'northeurope'

// ============ //
// Dependencies //
// ============ //
Expand All @@ -38,14 +35,14 @@ var tempLocation = 'northeurope'
// =================
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: resourceGroupName
location: tempLocation
location: resourceLocation
}

module nestedDependencies 'dependencies.bicep' = {
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-nestedDependencies'
params: {
location: tempLocation
location: resourceLocation
virtualNetworkName: 'dep-${namePrefix}-vnet-${serviceShort}'
// Adding base time to make the name unique as purge protection must be enabled (but may not be longer than 24 characters total)
keyVaultName: 'dep${namePrefix}kv${serviceShort}-${substring(uniqueString(baseTime), 0, 3)}'
Expand All @@ -61,7 +58,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
scope: resourceGroup
name: '${uniqueString(deployment().name, resourceLocation)}-test-${serviceShort}-${iteration}'
params: {
location: tempLocation
location: resourceLocation
name: '${namePrefix}${serviceShort}'
adminUsername: 'VMAdministrator'
imageReference: {
Expand Down
2 changes: 1 addition & 1 deletion avm/res/databricks/workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ This instance deploys the module with most of its features enabled.

```bicep
module workspace 'br/public:avm/res/databricks/workspace:<version>' = {
name: '${uniqueString(deployment().name, tempLocation)}-test-dwmax'
name: '${uniqueString(deployment().name, resourceLocation)}-test-dwmax'
params: {
// Required parameters
name: 'dwmax001'
Expand Down
Loading

0 comments on commit a24f695

Please sign in to comment.