diff --git a/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/resources/main.bicep b/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/resources/main.bicep index 738ac18b..097b0a0f 100644 --- a/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/resources/main.bicep +++ b/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/resources/main.bicep @@ -9,24 +9,25 @@ param prefix string = 'mh' @description('The Number of deployments per subscription. This parameter is to be used it the deployment gets precreated for the users.') param deploymentCount int = 1 -@description('Azure region for the deployment') -@allowed([ - 'Germany West Central' - 'West Europe' - 'North Europe' - 'East US' - 'East US 2' - 'Southeast Asia' - 'East Asia' -]) -param location string +@description('Azure region for the deployment. Defaulting to the Location of the Deployment.') +param location string = deployment().location +@description('User Name for the Tags') +param userName string + +@description('Suffix used to make resource names unique') var suffix = substring(uniqueString(currentUserObjectId), 0, 4) +@description('Tags to identify user resources') +var tags = { + User: userName +} + @description('Source Resouce Groups.') resource sourceRg 'Microsoft.Resources/resourceGroups@2021-01-01' = [for i in range(0, deploymentCount): { name: '${prefix}${(i+1)}-${suffix}-source-rg' location: location + tags: tags }] @description('Source Module to deploy initial demo resources for migration') @@ -46,6 +47,7 @@ module source 'source.bicep' = [for i in range(0, deploymentCount): { resource destinationRg 'Microsoft.Resources/resourceGroups@2021-01-01' = [for i in range(0, deploymentCount): { name: '${prefix}${(i+1)}-${suffix}-destination-rg' location: location + tags: tags }] @description('Destination Module to deploy the destination resources') diff --git a/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/walkthrough/challenge-1/solution.md b/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/walkthrough/challenge-1/solution.md index 3349a506..57e178e6 100644 --- a/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/walkthrough/challenge-1/solution.md +++ b/03-Azure/01-03-Infrastructure/06_Migration_Datacenter_Modernization/walkthrough/challenge-1/solution.md @@ -15,7 +15,7 @@ Duration: 30 minutes - Execute `az login` and sign in with your Azure AD account - Execute `az ad signed-in-user show --query id ` - Copy the value to the clipboard -- Execute `az deployment sub create --name $(az ad signed-in-user show --query displayName -o tsv) --location germanywestcentral --template-file ./main.bicep` +- Execute `az deployment sub create --name $(az ad signed-in-user show --query id -o tsv) --location germanywestcentral --template-file ./main.bicep --parameters currentUserObjectId=$(az ad signed-in-user show --query id -o tsv) --parameters userName="$(az ad signed-in-user show --query displayName -o tsv)"` - Paste the previously copied value as *currentUserObjectId* - Select a region - Wait for the deployment to finish