Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.17k stars 730 forks source link

Deploying resources within the same bicep file to different resource groups. #946

Closed akata72 closed 3 years ago

akata72 commented 3 years ago

While deploying an NSG I also want to deploy a flowlogs resource to a different resource group. (currently doing this using a nested template, but can't find this option in the current implementation of the deployments resource).

Describe the solution you'd like Having the option to configure the resourcegroup for the nested deployment (if that is the solution).

alex-frankel commented 3 years ago

This is possible with modules and the scope property. Modules effectively replace nested/linked deployments.

https://github.com/Azure/bicep/blob/main/docs/spec/modules.md#defining-and-configuring-module-scopes

Here's an example: https://github.com/Azure/bicep/blob/main/docs/examples/201/proximity-placement-with-multi-resource-groups/main.bicep#L44

Let me know if that's clear or if you need more context.

akata72 commented 3 years ago

Excellent. Should have seen that :-) Thanks.