Skip to content

Azure publisher uses "environmentName" parameter for resourceGroupName #8921

Closed
@eerhardt

Description

@eerhardt

When generating the main.bicep file in the Azure publisher, we use a parameter named environmentName and use it to generate the resource group name:

var environmentParam = new ProvisioningParameter("environmentName", typeof(string));
MainInfrastructure.Add(environmentParam);

var rg = new ResourceGroup("rg")
{
Name = BicepFunction.Interpolate($"rg-{environmentParam}"),
Location = locationParam,
Tags = tags
};

There are 2 things about this that are surprising:

  1. It is always prefixed with rg-. Do people always need/want their Resource Group to be prefixed with rg-?
  2. The parameter name "Environment Name" is too ambiguous. It probably comes from azd's concept of an environment when you azd init.

We should consider changing this code:

  1. Name the parameter resourceGroupName
  2. Drop the mandatory prefix rg- and just use the resourceGroupName directly.

cc @davidfowl @captainsafia @tg-msft @vhvb1989 @mitchdenny

Metadata

Metadata

Assignees

Labels

area-deploymentazureIssues associated specifically with scenarios tied to using Azure

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions