用于将属性添加到 Azure Webapp 应用程序设置的 API [英] API to add properties to Azure Webapp Application settings

查看:15
本文介绍了用于将属性添加到 Azure Webapp 应用程序设置的 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在 Azure 应用服务计划上运行的 Web 应用.Web 应用程序在 Web 应用程序的应用程序设置中定义了许多设置.现在我想复制该 Web 应用程序及其所有应用程序设置.我得到了 REST API 来列出任何 Web 应用程序 (/api/settings) 的所有可用设置.虽然有一个 POST 调用来添加/更新设置,但它并没有更新应用程序设置.

是否有任何 REST API 来添加/更新 Azure Web 应用的应用程序设置?

谢谢,阿比拉姆

解决方案

是否有任何 REST API 来添加/更新 Azure Web 应用的应用程序设置?

是的,我们可以使用以下

注意:我们可以使用以下 列出应用程序设置 REST API post 列出应用程序设置主体的方式.

 发布 https://management.azure.com/subscriptions/{subscription}/resourceGroups/CXP-{resourceGroup}/providers/Microsoft.Web/sites/{WebAppName}/config/appsettings/list?api-版本=2016-08-01

I have one web app running on a Azure appservice plan. The web app has a lot of settings defined in Application settings of the Web App. Now I want to replicate that web app with all its Application settings. I got the REST API to list down all the settings available for any web app (/api/settings). Although there is a POST call to add/update the settings , But it is not updating Application settings.

Is there any REST API to add/update the Application settings of Azure web app ?

Thanks, Abhiram

解决方案

Is there any REST API to add/update the Application settings of Azure web app ?

Yes, we could update the application setting with the following Update Application Settings REST API

Put https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resource group}/providers/Microsoft.Web/sites/{WebAppName}/config/appsettings?api-version=2016-08-01

Body

{
  "id": "subscriptions/{subscriptionId}/resourceGroups/{resource group}/providers/Microsoft.Web/sites/{WebAppName}/config/appsettings",
  "name": "appsettings",
  "type": "Microsoft.Web/sites/config",
  "location": "South Central US",
  "tags": {
    "hidden-related:/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/tomfreePlan": "empty"
  },
  "properties": {
    "WEBSITE_NODE_DEFAULT_VERSION": "6.9.1",
    "Test1": "testValue1" //Added value
  }
}

Note: we could use the following List Application Settings REST API post way to list the appsetting body.

 Post https://management.azure.com/subscriptions/{subscription}/resourceGroups/CXP-{resourceGroup}/providers/Microsoft.Web/sites/{WebAppName}/config/appsettings/list?api-version=2016-08-01

这篇关于用于将属性添加到 Azure Webapp 应用程序设置的 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆