我尝试使用Azure PowerShell修改Azure功能应用的IP限制。我使用此处描述的方法:Modify Azure AppService ipsecurity during release from VSTS
$r = Get-AzureRmResource -ResourceGroupName "Resoucegroup name" -ResourceType Microsoft.Web/sites/config -ResourceName resourcename -ApiVersion 2016-08-01
$p = $r.Properties
$p.ipSecurityRestrictions = @()
$restriction = @{}
$restriction.Add("ipAddress","0.0.0.0")
$restriction.Add("subnetMask","0.0.0.0")
$p.ipSecurityRestrictions+= $restriction
Set-AzureRmResource -ResourceGroupName "Resoucegroup name" -ResourceType Microsoft.Web/sites/config -ResourceName resourcename -ApiVersion 2016-08-01 -PropertyObject $p -Force
然而,Set-AzureRmResource CmdLet失败并显示错误:
The requested resource does not support http method 'PUT'.
有什么想法吗?
答案 0 :(得分:2)
您在resourcename
使用了什么?它应该是yourFunctionAppName/web
您的命令与我使用我的resourceGroup名称替换Resoucegroup name
和使用resourcename
替换my-function-app-name/web
完全一样