AZ-700 Question 22
Single answerYou manage a web application hosted on an Azure Virtual Machine. The VM was provisioned with a dynamic public IP address. After each system update, the VM� public IP occasionally changes, breaking DNS records and external integrations. You must ensure the public IP remains constant with minimal disruption to the application. What is the best way to achieve this requirement?
- A
Convert the existing dynamic public IP resource to a static allocation in the Azure Portal or via CLI without disassociating it from the VM.
- B
Disassociate the current dynamic public IP, create a new static private IP, and rely on Azure DNS to keep the public endpoint unchanged.
- C
Remove the NIC from the VM, create a new NIC with a static private IP, and let Azure automatically assign a new public IP upon reattachment.
- D
Attach an Azure NAT Gateway to the VM's subnet, which automatically converts the dynamic IP to static for the VM.
Show answer and explanation
Correct answer: A
Explanation
When a resource requires a stable and fixed public IP, you should use a static public IP allocation. In Azure, you can convert an existing dynamic public IP to static by changing the allocation method in the Public IP resource properties. This preserves the IP if it remains available, eliminating the need to reconfigure DNS entries. For more information, see the official Microsoft documentation on public IP addresses: https://learn.microsoft.com/azure/virtual-network/ip-services/public-ip-addresses.
- A. Correct.
Correct. You can change a public IP address from dynamic to static by updating the allocation method in the Azure Portal or CLI. This approach typically retains the same IP address if it is still available, minimizing downtime and disruption to DNS records. Refer to Microsoft documentation on configuring public IP addresses for details.
- B. Incorrect.
Incorrect. Creating or changing a private IP address does not guarantee a fixed public IP. Private IP settings do not control external connectivity directly, so this will not achieve the goal of retaining a constant public IP address.
- C. Incorrect.
Incorrect. Replacing the NIC does not ensure you can keep the same public IP address, and it introduces significant downtime. A new NIC often results in the assignment of a new public IP resource, violating the requirement for minimal disruption.
- D. Incorrect.
Incorrect. While NAT Gateway can provide consistent outbound addresses for multiple resources in a subnet, it does not automatically convert an existing dynamic public IP associated with a VM into a static IP. Additional steps or different scenarios apply for NAT Gateway usage.