bicep referencing existing resources
For resource group it is scope to a subscription. As for the storage account, it scopes is to an existing resource group.
targetScope='subscription'
resource newRG 'Microsoft.Resources/resourceGroups@2021-01-01' existing = {
name: 'bicep-test-rg'
}
resource stg 'Microsoft.Storage/storageAccounts@2022-09-01' existing = {
name: 'mydevdatastore'
scope: resourceGroup(newRG.name)
}
output blobEndpoint string = stg.properties.primaryEndpoints.blob
Comments