简体   繁体   English

Azure python 库返回 web 应用程序配置

[英]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.

相关问题 Azure web 应用程序出现 BadImageFormatException 错误 - BadImageFormatException error on Azure web app 一个 Azure Web App 可以只包含 azure web jobs - Can an Azure Web App consist exclusively of azure web jobs Stream Azure 容器记录到 web app - Stream Azure container logging to web app Azure Web App HTTP 响应大小限制? - Azure Web App HTTP Response size limitations? 如何在Azure Web App Service Linux环境下安装自己的Python package? - How can I install my own Python package in Azure Web App Service Linux environment? 无法在 Azure web 应用程序上获得正确的 SAS 令牌 - 身份验证失败。 Python - Cant get correct SAS token on Azure web app - Authentication Failed. Python 如何使用 Azure 管道在 Azure AD 中注册一个 web 应用程序? - How to register a web app in Azure AD using Azure Pipelines? 上传 Web API 到 Azure 使得 886803227288 Web App 无法访问 - Uploading Web API to Azure makes Blazor Web App not accessible 如何找到一个Azure App服务的cloud_RoleInstance web app - How to find the cloud_RoleInstance of an Azure App service web app 部署在 azure web 应用程序上时找不到 React 应用程序上的字体 - Font on React app not found when deployed on azure web app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM