使用PowerShell设置Azure功能IP限制

时间:2018-02-23 15:13:47

标签: azure azure-functions

我尝试使用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'.

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

您在resourcename使用了什么?它应该是yourFunctionAppName/web

您的命令与我使用我的resourceGroup名称替换Resoucegroup name和使用resourcename替换my-function-app-name/web完全一样