Error 404 Az PowerShell adding a virtual subnet

Vincenzo De Martino 21 Reputation points
2022-05-18T11:37:54.27+00:00

Hi,
few days ago i decided to start a new jurney of learning about Virtual Networking, i'm following a book step by step, but right at the beginning i got a problem, i created a Vnetwork and tried to add a new subnet but when i try to get my network show an Error 404, i don't understand why.
Code:
$VirtualNetwork = GetAzVirtualNetwork -name (network's name) -ResourceGroupName (resource's name)
Error:
The Resource 'Microsoft.Network/virtualNetworks/Ambrella' under resource group 'ResidentEvil' was not found.

At the same time if i go to resource group ResidentEvil from the portal i see the network ambrella what do i do wrong?

Thanks

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Luis Rodriguez 6,231 Reputation points Microsoft Employee
    2022-05-18T12:04:44.143+00:00

    Hi @vicenzodemartino-9989

    Welcome to Microsoft Q&A Platform,

    If the syntax and parameters are correct you shouldn't get a 404, please check again.

    I'd suggest checking the examples from the article below and try them directly from the browser using the "Try It" option (you'll be redirect to the Azure Portal):

    https://learn.microsoft.com/en-us/powershell/module/az.network/get-azvirtualnetwork?view=azps-7.5.0#example-1-retrieve-a-virtual-network

    I hope this helps!

    ----------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Vincenzo De Martino 21 Reputation points
    2022-05-18T14:41:19.94+00:00

    Solved XD
    the syntax was correct but i've created a network on "Virtual Network (Classic)" instead of "Virtual Network" i didn't know was different...
    well thanks :)

    0 comments No comments

Your answer

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