Created
June 16, 2022 07:02
-
-
Save ehrnst/168b44255189ddff93196eaf8097dfb7 to your computer and use it in GitHub Desktop.
bicep alter params to sub modules
This file contains 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
param storageAccountName string | |
resource container 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-09-01' = { | |
name: '${storageAccountName}/default/mycontainer' | |
} | |
This file contains 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
targetScope = 'subscription' | |
var tags = { | |
'owner': 'john doe' | |
} | |
var resourceGroupName = 'rg-ehrnst-test2' | |
resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = { | |
name: resourceGroupName | |
location: deployment().location | |
tags: tags | |
} | |
module storage 'teststorage.bicep' = { | |
scope: rg | |
name: 'strdeploy4' | |
params: { | |
storageAccountName: 'qwsssdddvvvv' | |
containerDeploy: false | |
} | |
} |
This file contains 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
@minLength(4) | |
@maxLength(24) | |
param storageAccountName string | |
param resourceLocation string = 'westeurope' | |
param containerDeploy bool = true | |
resource storage 'Microsoft.Storage/storageAccounts@2021-09-01' = { | |
name: toLower(storageAccountName) // force lowercase letters | |
location: resourceLocation | |
kind:'StorageV2' | |
sku: { | |
name: 'Premium_LRS' | |
} | |
properties: { | |
} | |
} | |
module container 'containertest.bicep' = if (containerDeploy) { | |
name: 'containerDeploy' | |
params: { | |
storageAccountName: storage.name | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment