Azure应用服务-通过API获取堆栈设置

问题描述

我有很多Web应用程序具有不同的堆栈设置:

enter image description here

我正在尝试自动获取该数据。 我已经尝试过az cli webapp,并且webapp / webapp settings / webapp appsettings都是api端点,但是我在任何地方都找不到它。 有一些键,例如:

function () {}

但是结果没有定论-它显示PHP和netframework版本。

你能帮我吗?

解决方法

如果您在门户网站->保存中选择版本为PHP的{​​{1}},然后选择返回5.6->保存,您将发现.Net始终是通过phpVersion来获得您提到的Web应用程序的设置。

如果只想获取当前使用的堆栈设置,则可以使用下面的REST API。

5.6

它将给出如下所示的响应,您可以获得POST https://management.azure.com/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Web/sites/<webapp-name>/config/metadata/list?api-version=2020-06-01

"CURRENT_STACK": "dotnet"

但是此API不会返回详细版本,因此您的选择是将其与{ "id": "/subscriptions/xxxx/resourceGroups/xxxx/providers/Microsoft.Web/sites/xxxx/config/metadata","location": "Central US","name": "metadata","properties": { "CURRENT_STACK": "dotnet" },"resourceGroup": "xxxx","tags": {},"type": "Microsoft.Web/sites/config" } 之类的东西或其他将Webapp设置在一起的方法一起使用。

如果您想在天蓝色的cli中使用此API,可以使用az rest

az webapp config show

enter image description here