Skip to content Skip to sidebar Skip to footer

Add VM To Azure App Gateway Python

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

Solution 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.


Post a Comment for "Add VM To Azure App Gateway Python"