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

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.

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.

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.

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

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.

Related

Create external network between Azure API Manager and a virtual machine

I have created an API Manager Service (AMS) in Azure with its subnet.
I have created a Virtual Machine with Ubuntu that exposes some APIs on the port 8000. It has a public IP and an internal IP (10.0.1.5). This is the network configuration.
I don't want a public IP on this machine. What I want is that only the AMS speaks with the Virtual Machine to expose the API.
I can't find a way to create a private network (or external network in the AMS point of view) between the AMS and the virtual machine. In the network configuration of the virtual machine, the AMS subnet is not available.
In a normal network I would create a NAT between the 2 subnets but in Azure I don't know how to do it.
Do you have any advice?
Create a Virtual network first in some region . Then , while creating APIM services go to the Virtual network tab and select type as external instead of none and select the same Virtual network that you have created earlier.
Once the APIM service is deployed then create a VM and while creating the VM go to the networking tab and select the same virtual network that you have used in APIM but different subnet for the VM (as APIM and VM cannot use same subnet , it is not supported in azure) . You can add a new subnet in the same Vnet for using it in the VM by going to the VNet resource you have created and in Subnets page clicking on add subnet.
(Note : All the resources must be in same region)
After this configuration is done the resources can communicate which are present inside the VNet even if they have different subnets. As by default resources under the same vnet can communicate in azure.

Unable to delete subnet and virtual network in azure

I am just practicing the azure. And I created a virtual network and subnets.
Now I am not able to delete the subnet. I have disconnected all connected devices from the virtual network.
Here is the error getting while deleting subnet
Please help me to clean up the subnet and virtual network.
Thanks
Additional details
All resources in my account
And here is the subnets tab and error getting while deletion:
Subnet configuration:
As the error shows the subnet PrivateSubnet should be in use. And you can see it's delegated to the service Microsoft.Web/serverfarms. So you need to remove the delegated service first. Do it follow the steps here. When the delegated service list is empty, then you can delete the subnet as you want.
Update:
According to my experience, your subnet is in use network/PrivateSubnet/AppLink, it means there is a Web App integrate with your subnet at least. And I didn't see the Web App in your resource group. So I guess there someone else uses your subnet and his Web App still exists. You need to check it yourself.

Steps for deployment of Container Instance with Virtual Network

I'd like to automate the deployment of a virtual network (that is peered with another network) and container instance connected to that network.
I'd just want to confirm that I'd do the correct steps. I'll be using Azure REST API.
Deploy a Virtual Network with a subnet
Create a Peering to the other virtual network
Create a Network Profile
Deploy the Container with the created network profile.
Step 3 is a bit weird for me because it's different than what I do in the Azure Portal. In the Portal, I just select the virtual network that I want my container to be connected to. Looking at MSDN Docs it seems to me that REST API requires me to create that Network Profile first. Am I right?
When you deploy an container using az container create the az cli will create the network profile for you in the background.
This might be why you might not have seen explicit creation of the network profile before.
A network profile is a network configuration template for Azure resources. It specifies certain network properties for the resource, for example, the subnet into which it should be deployed. When you first use the az container create command to deploy a container group to a subnet (and thus a virtual network), Azure creates a network profile for you. You can then use that network profile for future deployments to the subnet.
https://learn.microsoft.com/en-us/azure/container-instances/container-instances-vnet#network-profile
You steps are looking good.

Azure AD not showing Networks when Enabling Directory Services

I am attempting to link my Azure AD to a Network to enable Azure Directory Services. I have created a network but every time I try to enable the Azure Directory Services no networks show up under the 'CONNECT DOMAIN SERVICES TO THIS VIRTUAL NETWORK' dropdown menu. Does anyone know what might be causing this issue?
According to your description, I guess you create your virtual network in Azure new portal(ARM module).
For now, Azure AD Domain Services cannot be enabled in virtual networks created using Azure Resource Manager.
In your scenario, I think we should use VNet peering or site-to-site VPN to connect classic Vnet and ARM vnet. You can connect a Resource Manager-based virtual network to the Azure classic virtual network in which you have enabled Azure AD Domain Services. This connection enables you to use the managed domain with your workloads deployed in the Resource Manager-based virtual network.
More information about select a virtual network for AD DS, please refer to the link.

Can I create virtual machine without virtual network in Azure Resource Manager

I am trying to create virtual machine (VM) in Azure using ARM templates. In classical model of IAAS, we can create a virtual machine without virtual network in cloud service. Similar to classical model i don't want to put VM in virtual network.
Does anyone tried to create vm without virtual network in Azure resource manager.
Thanks in advance.
V2Vms, i.e. Resource manager VMs have a dependency on a network card, which has a dependency on a subnet.
A VNet is used to provide DHCP and Security Group services to the VM. Without it a VM couldn't obtain an IP Address.
It is not possible to create an Azure VM without a vnet, in the same way that it was not possible to create a V1Vm without a cloud service.
For more information see Understanding Resource Manager deployment and classic deployment

Resources