0

我正在寻找 az commands (powershell) 以在部署时在 azure app 服务中添加 url

为了清楚起见,您可以参考随附的图像。 在此处输入图像描述

提前致谢

4

1 回答 1

1

请使用Set-AzResource

一个例子供你参考。

$webAppName = ""
$subscriptionId = ""
$tenantId = ""
$resourceGroup = ""

Connect-AzAccount -Tenant $tenantId
Select-AzSubscription -SubscriptionId $subscriptionId

$allowedOrigins = @()
$allowedOrigins += "www.example.com"

$PropertiesObject = @{cors = @{allowedOrigins= $allowedOrigins}}

Set-AzResource -PropertyObject $PropertiesObject -ResourceGroupName $resourceGroup -ResourceType Microsoft.Web/sites/config -ResourceName $webAppName/web -ApiVersion 2015-08-01 -Force
于 2020-07-30T01:04:43.360 回答