相关疑难解决方法(0)

使用Powershell的Azure Resource Manager IP安全限制

我正在尝试使用Powershell来设置IP安全限制.我的语法没有返回任何错误,但设置没有改变."ipSecurityRestrictions"属性是一个哈希表.

$r = Get-AzureRmResource -ResourceGroupName *resource-group-name* -ResourceType Microsoft.Web/sites/config -ResourceName resourcename/web -ApiVersion 2016-08-01
$p = $r.Properties
$p.ipSecurityRestrictions = @{ ipAddress = "0.0.0.0"; subnetMask = "0.0.0.0" }
Set-AzureRmResource -ResourceGroupName *resource-group-name* -ResourceType Microsoft.Web/sites/config -ResourceName resourcename/web -ApiVersion 2016-08-01 -PropertyObject $p
Run Code Online (Sandbox Code Playgroud)

这不是权限问题,并且没有返回错误.要更改不是哈希表的属性,例如phpVersion,以下代码正常工作:

$p.phpVersion = "7.0"
Run Code Online (Sandbox Code Playgroud)

有没有人使用这种方法成功设置ipSecurityRestrictions?

powershell azure azure-resource-manager

7
推荐指数
1
解决办法
2586
查看次数

标签 统计

azure ×1

azure-resource-manager ×1

powershell ×1