Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,387 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Script to Reserve the Public IP address while resizing the VM
anonymous user , From your question it looks like you have a basic sku PIP in dynamic state. here is a CLI command to turn dynamic PIP to static.
CLI:
az network public-ip update -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static
PS:
$publicIp = Get-AzPublicIpAddress -Name $publicIpName -ResourceGroupName $rgName
$publicIp.PublicIpAllocationMethod = "Static"
Set-AzPublicIpAddress -PublicIpAddress $publicIp
Get-AzPublicIpAddress -Name $publicIpName -ResourceGroupName $rgName
Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.