I'm trying to create an Azure Resource Group using a .bicep file:
targetScope = 'subscription'
param environment string
param location string = deployment().location
resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: 'snapshot-generator-${environment}-west-eu'
location: location
}
And for deploy I'm using the following command in PowerShell:
New-AzResourceGroupDeployment -TemplateFile resourceGroup.bicep
but the ResourceGroupName is requested and I can't understand why and what I'm doing wrong.
You should use New-AzSubscriptionDeployment instead of New-AzResourceGroupDeployment for a subscription-level deployment. See here for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With