You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In multi-tenant, multi-subscription environments, deploying Bicep templates requires switching Azure contexts frequently. Currently, we maintain a bicepparam file for each deployment, which includes most of the necessary parameters. However, specifying "Subscription ID" and "Tenant ID" is done externally, and we need to use az account set every time we switch tenants or subscriptions. This process can be cumbersome and error-prone.
Describe the solution you'd like
It would be helpful if subscriptionId and tenantId could be specified directly within the bicepparam file. The az deployment create command could then check these values in bicepparam for deployment context, defaulting to the current Azure CLI context if they aren’t provided.
This way, instead of first running az account set to adjust the context, then running az deployment create, we would only need to run az deployment create with context pulled directly from the parameter file, simplifying multi-environment deployments and reducing potential for errors.
The text was updated successfully, but these errors were encountered:
trylvis
changed the title
Specifying Subscription ID and Tenant ID inbicepparams instead of always needing to run "az account set"
Simplify Bicep Deployments by Embedding Subscription and Tenant Context in Parameter Files
Nov 5, 2024
Have you considered using modules to model your scenario? You can start with a management group target scope deployment that triggers modules, each module is downscoped to the subscription and resource group using the scope property of a module
Is your feature request related to a problem? Please describe.
In multi-tenant, multi-subscription environments, deploying Bicep templates requires switching Azure contexts frequently. Currently, we maintain a
bicepparam
file for each deployment, which includes most of the necessary parameters. However, specifying "Subscription ID" and "Tenant ID" is done externally, and we need to useaz account set
every time we switch tenants or subscriptions. This process can be cumbersome and error-prone.Describe the solution you'd like
It would be helpful if
subscriptionId
andtenantId
could be specified directly within thebicepparam
file. Theaz deployment create
command could then check these values inbicepparam
for deployment context, defaulting to the current Azure CLI context if they aren’t provided.This way, instead of first running
az account set
to adjust the context, then runningaz deployment create
, we would only need to runaz deployment create
with context pulled directly from the parameter file, simplifying multi-environment deployments and reducing potential for errors.The text was updated successfully, but these errors were encountered: