Azure - Virtual Network does not exist when deploy to Cloud Service
Asked Answered
S

4

6

I tried to add Cloud Service (classic) to Virtual Network (classic), but an error appears when I deploy (new portal - Update your deployment):

The update deployment operation failed for the domain 'developementtajgowebservicev1' in the deployment slot 'staging' with the name 'not working': 'The virtual network devvirtual-Network does not exist.'.

I added this code after Role tag into config file.

<NetworkConfiguration>
    <VirtualNetworkSite name="devvirtual-Network"/>
    <AddressAssignments>
        <InstanceAddress roleName="WorkerRole1">
            <Subnets>
                <Subnet name="Subnet-1"/>
            </Subnets>
        </InstanceAddress>
    </AddressAssignments>
</NetworkConfiguration>

The virtual network with this name exist in same subscription.

Slaver answered 12/2, 2016 at 7:24 Comment(0)
H
9

There's a solution for this issue here: https://thelonedba.wordpress.com/2015/07/17/new-azurevm-badrequest-the-virtual-network-foo-does-not-exist/

Basically, the problem seems to be that the Azure portal's name for the network isn't the same as the name you need to use in the cloud service configuration.

I was able to get the "correct" name by using the Azure CLI tools:

azure network export networks.json

And then examining the networks.json file.

In my case, the "correct" name of the Virtual Network was "Group [ResourceGroup] [NetworkName]". (ie, the network is called "network1" which is in the Resource Group "group1", so the "correct" name is "Group group1 network1") This was for a "classic" Virtual Network - I haven't tried with the Resource Manager based Virtual Networks.

Hephzipah answered 20/4, 2016 at 19:9 Comment(0)
P
3

You should double check the virtual network name. Do not use the name you just created, just use "Virtual network site name (for .cscfg file) " column in virtual network details in Azure portal.

Packaging answered 5/8, 2019 at 14:42 Comment(1)
I don't see this column. How do I display this?Antofagasta
C
0

When you are deploying in the new portal, you are deploying to resource manager. You have to recreate the vnets in resource manager or migrate them to resource manager.

Mor info on classic vs resource manager: resource-manager-deployment-model

Conidiophore answered 12/2, 2016 at 22:6 Comment(1)
Thank for your answer, I created new VNET (Resource Manager), but the same error appears.Slaver
D
0

At this point of time Cloud services cannot connect to a Virtual network (Resource manager type), you can only connect them to a Virtual network (classic). I hope they add the support for Resource manager type Virtual networks in a near future.

Deucalion answered 15/7, 2017 at 9:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.