Add VM to Azure App Gateway python

丶灬走出姿态 提交于 2019-12-24 11:15:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!