Not sure if this PowerShell method ever worked.
The null assignment gives the error
PS C:\Users\xxxxxxxxxx> $nic.IpConfigurations.publicipaddress.id=$null
The property 'id' cannot be found on this object. Verify that the property
exists and can be set.
At line:1 char:2
+ $nic.IpConfigurations.publicipaddress.id=$null
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException
This is what I have done as a workaround.
$nic = Get-AzNetworkInterface -Name $pip.NICName -ResourceGroup `
$pip.ResourceGrou
$count= $nic.IpConfigurations.Name.Count
$i=0
while ($i -le ($count-1)){
$nic.IpConfigurations[$i].publicipaddress.id=$null
$i++}
Set-AzNetworkInterface -NetworkInterface $nic