Unit 6 - Route traffic through the NVA (Subnet publicsubnet) does not exist

Anwaruddin Tokhy 0 Reputation points


I am in unit 6 of "Route traffic through the NVA" but cannot create an public VM because I get the following error:

when I run the command:

az vm create \
    --resource-group learn-b23ce92d-ght5-4c6b-8f95-5196f6a798ce \
    --name public \
    --vnet-name vnet \
    --subnet publicsubnet \
    --image Ubuntu2204 \
    --admin-username azureuser \
    --no-wait \
    --custom-data cloud-init.txt \
    --admin-password <password>

I get the following error:

Subnet(publicsubnet) does not exist, but failed to create a new subnet with address prefix It may be caused by name or address prefix conflict. Please specify an appropriate subnet name with --subnet or a valid address prefix value with --subnet-address-prefix.

As per the error, it says obviously that the subnet does not exist and could not create a new one. I have not created any other subnets with this name so how come I get this error. Is this something that you have also had? Looking forward to hearing from you.

Best regards,

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop skilled behavior.
347 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anwaruddin Tokhy 0 Reputation points

    Hi @Luis Arias , Thanks for your time to answer my question. It is actually solved by logging out and re-login.

    and yes it is a course on MS learn:

    Best regards,