简体   繁体   中英

Azure BICEP deploy if doesn't already exist

I'm not sure if this is possible, but what I'm trying to do is create a virtual.network from one virtualNetwork.main.bicep file and then create a su.net from another su.net.main.bicep within the virtual.network. Now I can do this, but the problem I have is if I rerun the virtual.network virtualNetwork.main.bicep it will remove any su.nets that have been created by the su.net.main.bicep file

I know I can just add all su.nets to the virtualNetwork.main.bicep but the idea is that I can hand over the creation of su.nets to other people whilst maintaining a global.networking configuration.

So is there any way that I can only stop the virtual.network file from deleting what's already there?

Hope this makes sense.

Cheers

Checking to see if a resource already exists is an ask in Bicep that isn't yet implemented.

Further, you're looking at creating a virtual.network from multiple modules and I fear you're going to be disappointed there as well, as that's not really supported per the discussionhere . The guidance provided here suggests:

It is instead recommended to create all the su.nets in the array property inside of the .net

And unfortunately this suggests that you have to create all the su.nets at once to accommodate the API shortcomings. Sorry!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM