简体   繁体   中英

Azure ARM: If resource group does not exist, place in deployment resource group

I have created a main template that deploys to a resource group (parent-rg). Inside the main template, there are multiple nested templates within it. The nested templates have the option to create their resources in a different resource group (child-rg).

Naturally, during deploying, if the child-rg does not exist, the nested template will fail.

Is there a way to put a logical expression to say "if your child-rg does not exist, place it in the main template's parent-rg."

No, you need to implement this logic outside the template and pass the "result" (yes\\no, true\\false, etc) to the template and in the template you can depend on this value to make a decision. arm template cannot check existence of resources.

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