I\'m trying to use Powershell to set IP Security Restrictions. My syntax is not returning any errors, but settings are not changing. The \"ipSecurityRestrictions\" property
ipSecurityRestrictions
should be object array. Please have a try to change code as following. It works correctly for me.
$r = Get-AzureRmResource -ResourceGroupName "Resoucegroup name" -ResourceType Microsoft.Web/sites/config -ResourceName resourcename/web -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/web -ApiVersion 2016-08-01 -PropertyObject $p
After that we can get the result from the resources azure (https://resources.azure.com).
We also can get powershell cmd from the resource azure.