Replies: 2 comments 1 reply
-
Seems if I define subnets within the vnet then I don't get the error resource vnet 'Microsoft.Network/virtualNetworks@2023-04-01' = {
name: vnetName
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/16'
]
}
subnets: [
{
name: 'endpoints-subnet'
properties: {
addressPrefix: '10.0.0.0/24'
privateEndpointNetworkPolicies: 'Disabled'
}
}
]
}
tags: tags
} There's some mention of this https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-modes#incremental-mode |
Beta Was this translation helpful? Give feedback.
-
@johnlokerse is right about what's happening here, and how to avoid it. To add my two cents - it is possible to deploy vnets and snets independently of each other, but this depends on the bigger picture of what you are trying to achieve. If all you want to do is deploy an ACR connected to a private vnet you don't have to complicate things. If you structure your resources by level you can have a hierarchy where you are provided a vnet by the networking team and have to do your own subnetting. You would then create the subnets like this:
This works slightly different than referencing the parent directly, but achieves the same result. You could put it into modules for more flexibility and you can roll out ACR and other resources separately. (In Azure architecture the networking is often said to be at a lower level than ACR, web apps, etc. so you can remove the upper layers as you wish, but not the other way around.) |
Beta Was this translation helpful? Give feedback.
-
I'm trying to get started with Bicep and create a Container Registry with Private Endpoint using the guide https://learn.microsoft.com/en-us/azure/container-registry/container-registry-private-link but having a few problems.
Firstly, there seems to be no sample to do this so I created everything manually as per the guide and then exported the template and decompiled to Bicep. Here's the script:
This works but when I create a second deployment it fails with:
However, when I do a
what-if
, there should be no changes. I'm still learning Bicep but should I be able to safely create multiple deployments and if there's no reported changes it shouldn't change anything? Why does it attempt to delete the resources?Beta Was this translation helpful? Give feedback.
All reactions