我正在寻找 az commands (powershell) 以在部署时在 azure app 服务中添加 url
提前致谢
请使用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