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

风格不统一 提交于 2019-12-11 01:21:36

问题


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.


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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.



来源:https://stackoverflow.com/questions/35356964/azure-virtual-network-does-not-exist-when-deploy-to-cloud-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!