Create Azure Resource Group using Bicep

0 votes

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.

Mar 23, 2022 in Azure by Edureka
• 12,690 points
1,494 views

1 answer to this question.

0 votes
Add a module to construct the resource group and deliver resources to it. The resources to deploy to the resource group are included in the module. Set the module's scope to the symbolic name of the resource group you've just created. You have the option of deploying to up to 800 resource groups.
answered Mar 25, 2022 by Edureka
• 13,620 points

Related Questions In Azure

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to create Azure API Gateway Resource?

Go to your API Management instance In the ...READ MORE

answered Apr 12, 2022 in Azure by Edureka
• 12,690 points
941 views
0 votes
1 answer

What is resource group in Azure?

In Microsoft Azure, a resource group is ...READ MORE

answered Nov 2, 2023 in Azure by anonymous
• 3,360 points
519 views
0 votes
1 answer
0 votes
1 answer

Azure Advisor Recommendations using PowerShell

The command appears to be correct. I ...READ MORE

answered Mar 4, 2022 in Azure by Edureka
• 13,620 points
1,323 views
0 votes
1 answer

How do I use Powershell to create an Azure Web App that runs on Linux?

Try the command below: New-AzureRmResource -ResourceGroupName <ResourceGroupName> -Location ...READ MORE

answered Mar 25, 2022 in Azure by Edureka
• 12,690 points
1,069 views
0 votes
1 answer

Azure ARM Template : Create Resource Group

To construct a resource group in an ...READ MORE

answered Mar 4, 2022 in Azure by Edureka
• 13,620 points
889 views
0 votes
1 answer

Can I create virtual machine without virtual network in Azure Resource Manager?

A VNet is used to provide the ...READ MORE

answered Mar 4, 2022 in Azure by Edureka
• 13,620 points
2,191 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP