Azure – You can now connect your Azure Cloud Shell to a virtual network

By now you may already know Azure Cloud Shell, available directly from the Azure/Office 365 portals or from the URL https://shell.azure.com, the shell management tool running directly from your web browser.

image

Well, you can now connect Azure Cloud Shell with a virtual network on your Azure tenant; this could be handy when you have to manage services with no public IP address.

To be able to do it you need to deploy a specific template for both the virtual network and the storage account used by Axure Cloud Shell.

Don’t worry you are not create a new virtual network

These templates are available from:

You can also create a full new Cloud Shell storage account and use the option Show VNET isolation settings

NOTE this is currently only available for West US and West Central US region for storage account

Prerequisites

You need to first register the containerinstances resource provider using either the Azure portal or the command

Register-AzureRmResourceProvider -ProviderNamespace Microsoft.ContainerInstance

image   image 

Use the VNET isolation settings

This option is only available for existing storage account

You will need to disconnect Azure Cloud Shell to be able to use it (see Reconnect Azure Cloud Shell as the end of this post)

image

Use the templates

For both just use the Deploy to Azure button

image  image

As you may know when you deploy such template you will define the subscription and the resource group where the template will be deployed as well as the specific details for each object.

Deployment of the Virtual Network Template

You will need to use an existing virtual network name.

You can get the  Azure Container Instance OID using the below command

Get-AzADServicePrincipal -DisplayNameBeginsWith ‘Azure Container Instance’

Then other settings are self-explanatory.

image  image  image

Once the deployment is completed, you will see the new subnets available in your virtual network and you can now deploy the Storage Account template.

Deployment of the Storage Account template

You will define the same virtual network and subnets as above

image

Once completed, you are done.

Reconnect Azure Cloud Shell

You just need to reconnect your Azure Cloud Shell by disconnecting from the storage account using the command

cloudrive unmount

or

dismount-cloudrive

image

Then you can connect again by re selecting the disconnected storage account

image

Leave a Comment

Your email address will not be published. Required fields are marked *