Please suggest how to deploy into multiple subscriptions in bicep. #4656
-
Hi , Please suggest how can I deploy virtual network configuration using single parameter file for multiple subscriptions. vnet.bicep |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
in order to do this you will need to use a Subscription level deployment and a Module. The module has a scope property that you can reference the subscription + resource group that you want to deploy into. https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/modules#configure-module-scopes Notice that the resourcegroup() method can take the parameters for the subscription and the resourcegroup and can be used for the Scope property
|
Beta Was this translation helpful? Give feedback.
-
@brwilkinson : screenshot attached |
Beta Was this translation helpful? Give feedback.
-
@brwilkinson : I am successfully able to deploy the code in one subscription using default scope : resource group and module functionality in bicep no problem in that. But use case is now to deploy into multiple subscriptions using service principal on management group level and parent management group has 3 childs and subscriptions under that . deployment to be scope at management group level so that it can go one level down to subscriptions and deploy into resource groups. |
Beta Was this translation helpful? Give feedback.
-
As mentioned above. Notice that the resourcegroup() method can take the parameters for the subscription and the resourcegroup and can be used for the Scope property resourceGroup(subscriptionId, resourceGroupName) |
Beta Was this translation helpful? Give feedback.
As mentioned above.
Notice that the resourcegroup() method can take the parameters for the subscription and the resourcegroup and can be used for the Scope property
resourceGroup(subscriptionId, resourceGroupName)
https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-scope#resourcegroup