Resource Not Found when creating NAT Gateway.

mooneyn 20 Reputation points
2024-02-19T17:34:01.6266667+00:00

Hello, I am new to Azure and am following the documentation Quickstart: Create a NAT gateway using the Azure CLI. After creating a public IP it claims that the resource does not exist when creating the nat gateway. Wondering if I am missing something in my environment. I'm attaching a screenshot of the commands outputs. 2024-02-19_12-06-04

Any advice would be appreciated thanks.

Azure NAT Gateway
Azure NAT Gateway
NAT Gateway is a fully managed service that securely routes internet traffic from a private virtual network with enterprise-grade performance and low latency.
38 questions
{count} votes

Accepted answer
  1. Timmy Malmgren 1,521 Reputation points
    2024-02-19T22:33:51.09+00:00

    Hi

    I think it might be an issue since you are not specifying location for your NAT gateway. The NAT gateway must be in the same location as the public IP you want to associate with it.

    When creating an IP i can see that you specify location as eastus2, make sure you create your NAT gateway in the same location if you want it to use that IP.

    Hope this is helpful and remember shared knowledge is the best knowledge 😊

    Best Regards,

    Timmy Malmgren

    ---If the Answer is helpful, please click "Accept Answer" and upvote it as it helps others to find what they are looking for faster!  

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 26,216 Reputation points Microsoft Employee
    2024-02-22T01:02:00.36+00:00

    @mooneyn

    Thank you for getting back.

    I understand you are following the tutorial here and are running into an issue while running the az network vnet subnet update command.

    The issue here due to the location of the VNET created.

    When you run this command from the tutorial to create the Vnet, as no location parameter is mentioned the Vnet is created in the resource-group's location.

    Please modify the create vnet command as below and you should not face the error again.

    az network vnet create --name vnet-1 --resource-group WWTGroup --address-prefix 10.0.0.0/16 --subnet-name subnet-1 --subnet-prefixes 10.0.0.0/24 --location eastus2

    After this please run the subnet update command below

    az network vnet subnet update --name subnet-1 --resource-group WWTGroup --vnet-name vnet-1 --nat-gateway nat-gateway

    In the tutorial as a new resource group is created in eastus2 location, hence all the other resources are created in eastus2 by default.

    I am currently working on updating the tutorial so that no such issues will occur in the future.

    Hope this helps! Please let me know if you have any additional questions.

    ---Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.