Is it possible to enable Always On for Azure websites through management/resource management APIs?

后端 未结 3 646
感情败类
感情败类 2021-01-04 09:23

I am writing some code for automatic deployment of Azure websites (including the creation of the website in Azure). I\'m using the Azure Management Libraries and Azure Resou

3条回答
  •  星月不相逢
    2021-01-04 09:28

    I believe I found the solution!

    Using the resource management API, I can set the AlwaysOn property through the siteConfig object. In powershell:

    Set-AzureResource -ApiVersion 2014-04-01 -PropertyObject @{"siteConfig" = @{"AlwaysOn" = $false}} -Name mywebsite -ResourceGroupName myrg -ResourceType Microsoft.Web/sites

    In the resource management API in .NET it would be similar to this.

    The resulting REST call, to https://management.azure.com/subscriptions/xxx/resourcegroups/yyy/providers/Microsoft.Web/sites/zzz?api-version=2014-04-01: { "location": "West Europe", "properties": { "siteConfig": { "AlwaysOn": true } }, "tags": {} }

提交回复
热议问题