[英]Azure python library return web app configurations
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.我试图深入研究 azure python sdk 以检索和控制我在 azure 中的所有资源,但我很难找到有关以下问题的任何有效文档。
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.我能够返回我所有的 azure web app
服务。 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.这很好,但我更希望能够为每个 web 应用程序返回其配置,以便我可以从中提取特定值。
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.从昨天开始我一直在四处寻找,但我在找到正确的文档、代码或 GitHub 项目来实现这一点时遇到了一些问题。
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.使用 azure cli,我可以运行命令az webapp config show --name <webapp-name> -g <resource-group-name>
我将获取特定 web 应用程序的所有配置。 I was wondering if there is any python library to achieve this using python.我想知道是否有任何 python 库可以使用 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.如果我的问题不清楚,请告诉我,我可以提供详细的解释。
Solved.解决了。 I could access the linuxfx version by simply using the web_client.web_apps.get(RG, APPNAME)
我可以通过简单地使用web_client.web_apps.get(RG, APPNAME)
访问 linuxfx 版本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.