Hub Spoke Peering #3909
-
Hi, I'm currently trying to get a Hub Spoke model working. The example from Azure is one big main.bicep file which deploys everything at once. Since we'll be having multiple projects I'm trying to create different Bicep files for the Hub and the Spokes. In the vnetSpoke.bicep file I've created a reference to the existing vnetHub which resides in it's own ResourceGroup.
Where the problem starts is when I try to create the peering. Once I deploy the template it will search in the rg-spoke ResourceGroup for the hub-vnet. My peering looks as follows:
Is there a way for me to define that this peering has to be made in a different Resource Group? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You will need to generate the Peering in both directions. Here is a sample: Since you want to run the reverse Peering from the Hub, you can do that by using the Module with the scope set to the other resource group. |
Beta Was this translation helpful? Give feedback.
You will need to generate the Peering in both directions.
Here is a sample:
https://github.com/brwilkinson/AzureDeploymentFramework/blob/60f2a6721034bacc441ad42a6c4701afaffe99f4/ADF/bicep/VNET.bicep#L133
Since you want to run the reverse Peering from the Hub, you can do that by using the Module with the scope set to the other resource group.