Azure python library return web app configurations

214 Views Asked by At

I am trying to deep dive into azure python sdk to retrieve and control all my resources in azure, but I am having hard time to find any valid documentation on the following issue.

using this code:

    resource_client = ResourceManagementClient(credentials, subscription_id)
    web_client = WebSiteManagementClient(credential=credentials, subscription_id=subscription_id)
    rg_subscription = resource_client.resource_groups.list()
    web_apps_test = []
    for rg in list(rg_subscription):   
        for site in web_client.web_apps.list_by_resource_group(rg.name):
            print(site)

I am able to return all my azure web app service. Which is great, but what I would like to have more is to be able for each web app, to return its configurations so I can extract specific values from it.

I have been looking around since yesterday but I am having some problems to find the right documentation, code or GitHub project to achieve this.

Just to give a practical example of what I am looking for, is this:

Using azure cli, I can run the command az webapp config show --name <webapp-name> -g <resource-group-name> and I will get all the configurations for the specific web app. I was wondering if there is any python library to achieve this using python.

Can anyone help to solve this please?any help would be much appreciated.

And please if my question is not clear, just let me know and I can provide detailed explanation.

1

There are 1 best solutions below

0
On

Solved. I could access the linuxfx version by simply using the web_client.web_apps.get(RG, APPNAME)