问题
How do I add an existing VM to an existing App gateway via the Python SDK for Azure?
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?
回答1:
You could check this answer.
Note: Firstly, your existing VM should be in your application gateway's VNet.
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.
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"
}]
}],
Check Python SDK in this link.
来源:https://stackoverflow.com/questions/48376092/add-vm-to-azure-app-gateway-python