0

anyone know if it is possible to create app gw with azure cli, when my vnet is in different resource group, not in the same as i'm creating the application gateway in? It seems az command doesnt let me provide --vnet-name id of vnet. If i provide the name of it, it just created new on in same resource group where i'm creating the app gateway.

Is it possible to reference the vnet from another resource group when using command - az network application-gateway create? As it seems from parameters only subnet supports the reference by ID... Is there a workaround?

--subnet Name or ID of the subnet. Will create resource if it does not exist. If name specified, also specify --vnet-name.

--vnet-name The virtual network (VNet) name.

2
  • 1
    The subnet always in a Vnet. If you reference the subnet it also means reference the Vnet. Commented Dec 11, 2018 at 15:54
  • damn, that's true. Got it working. Thanks a lot @CharlesXu. Appreciated for quick help! Commented Dec 11, 2018 at 16:08

2 Answers 2

2

Yeah. In Azure, there are many resources and sub-resources. Most have the ID that represents the unique one in Azure. For Subnet, it belongs to Vnet. If it exists and the ID can only refer to it.

So if you want to reference the existing subnet of a Vnet in Azure you just need to reference its ID. In addition, the Application Gateway needs an empty subnet and there should be no resource in it. You should pay attention to this point.

Sign up to request clarification or add additional context in comments.

Comments

0

Got this answered by @Charles Xu.

The subnet always in a Vnet. If you reference the subnet it also means reference the Vnet. – Charles Xu

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.