First decide which address you need: a static private IP for stable access within an Azure virtual network and connected networks, or a static public IP for a stable internet-facing address. Azure assigns a VM’s IP addresses through its network interface (NIC); every VM has a private IP, while a public IP is optional. The steps differ, and a public IP alone does not open access through your network security rules.
Choose between a static private IP and a static public IP
| Decision | Static private IP | Static public IP |
|---|---|---|
| Use it for | A stable address within the virtual network and connected networks. | A stable address for communication involving the internet. |
| What you change | The private address assignment on the VM NIC’s IP configuration. | A separate public IP resource, associated with a NIC IP configuration. |
| Internet reachability | Not directly internet-routable. External connectivity may use NAT or private connectivity. | Internet-facing, but inbound access remains subject to network security group (NSG) rules and other applicable security settings. |
| Operational consideration | Changing the private IP restarts the VM. Avoid conflicting guest-side network settings. | Public IPs have a nominal charge and subscription limits; check pricing and quota for your region and subscription. |
Microsoft notes that a dynamic public IP may change when a VM starts after being stopped in the deallocated state. Choose static allocation when the public address needs to stay stable. See Microsoft’s Azure virtual network and VM overview.
Assign a static private IP to an existing VM
Change the private IP assignment on the NIC in Azure, rather than independently setting an Azure-assigned address in the guest operating system. Microsoft warns that a guest-side address that does not match the NIC assignment can break connectivity.
- In the Azure portal, open Virtual machines, select your VM, and open its networking settings.
- Select the VM’s network interface, then open IP configurations. Select the relevant configuration, often named
ipconfig1. - Set Assignment to Static. Keep the current private address or enter an available address in the subnet.
- Save the change. A private-IP change restarts the VM so it can use the new address, according to Microsoft’s static private IP guide.
If you change the address, coordinate updates to dependent allowlists, DNS records, and client configurations. To make the change with automation, Microsoft documents az network nic ip-config update for Azure CLI. In PowerShell, the documented flow uses Get-AzVirtualNetwork, Get-AzVirtualNetworkSubnetConfig, Get-AzNetworkInterface, Set-AzNetworkInterfaceIpConfig, and Set-AzNetworkInterface. Use your deployment’s actual resource group, NIC, IP configuration name, and an available subnet address.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
Assign a static public IP to an existing VM
A static public IP is a distinct Azure resource; it is not the same setting as the NIC’s private IP. Create one with static allocation in the appropriate region, or use an existing unassociated public IP resource.
- Open the VM’s network interface in the Azure portal and select the IP configuration that should use the public address.
- Associate the public IP resource with that IP configuration and save.
- Review the applicable subnet and NIC NSG rules separately. Permit only the inbound protocols and ports the VM actually needs; associating a public IP does not bypass those rules.
Microsoft also documents the association with Azure CLI using az network nic ip-config update, and with Azure PowerShell using Set-AzNetworkInterfaceIpConfig followed by Set-AzNetworkInterface. For exact portal and command-line guidance, see Microsoft’s static public IP guide and its public IP address overview.
If you need external administrator access, consider Bastion
A public IP is not the only way to administer a VM from outside its virtual network. Azure Bastion can provide a route to the VM’s private IP without making that VM directly reachable through its own public IP. See Microsoft’s VM public IP association guidance for this alternative.
Quick Recap
Rank #4
Rank #3
Check before you finish
- Confirm whether the requirement is stable private connectivity or a stable internet-facing address.
- For a private IP change, schedule for the VM restart and update systems that rely on the old address.
- For public access, verify NSG and other applicable security rules independently of the public IP association.
- Check current regional public IP pricing and subscription quota before creating the resource; the amount and availability depend on the applicable Azure context.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →

