将VM添加到Azure App Gateway python
问题描述:
如何通过适用于Azure的Python SDK将现有VM添加到现有App网关?
How do I add an existing VM to an existing App gateway via the Python SDK for Azure?
我查看了此,并使用了也可以通过编程方式创建应用网关,但是如何将新创建的VM添加到现有网关中呢?
I've looked at this, and used it too, to create an app gateway programatically, but how do I go about adding newly created VMs to the existing gateway?
答
您可以检查注意:首先,您现有的VM应该位于应用程序网关的VNet中.
Note: Firstly, your existing VM should be in your application gateway's VNet.
如果将VM的公共IP添加到应用程序,则可以使用以下方式:
If you add your VM's public IP to application, you could use like below:
"backend_address_pools": [{
"name": appgateway_backend_pool_name,
"backend_addresses": [{
"ip_address": "10.1.0.4"
}, {
"ip_address": "10.1.0.5"
}]
}],
Check this example.
如果要将VM的nic添加到应用程序网关,则需要如下所示使用:
If you want to add VM's nic to application gateway, you need use like below:
"backend_address_pools": [{
"name": appgateway_backend_pool_name,
"backend_ip_configurations": [{
"id": "/subscriptions/**********/resourceGroups/shuiapplication/providers/Microsoft.Network/networkInterfaces/shui361/ipConfigurations"
}]
}],
在此链接.