Azure Stack Azure Cloud Shell

Connect to Azure Stack from Azure Cloud Shell

A little while ago Microsoft announced the Azure Cloud Shell. The Azure Cloud Shell is a perfect tool to manage your Azure resources using the Azure CLI or Azure PowerShell. Wouldn’t it be great to also manage your resources running on Azure Stack? Thanks to the consistency between Microsoft Azure and Microsoft Azure Stack, you can use the same tools to manage your hybrid cloud.

First of all login to your Azure Cloud Shell on shell.azure.com or in the Azure Portal.

Azure Cloud Shell

After the login you have to register Azure Stack as a new cloud by running the following command:

Azure Stack Cloud List Azure CLI

Now you can list the new Azure Stack cloud by using:

To switch to the Azure Stack Cloud use the following command:

If you are doing this the first time and you use another account you can use az login to login.

One thing you should do is to switch the profile version to an Azure Stack compatible version

Azure Cloud Shell Azure Stack

Now you can start using the Azure CLI in the Azure Cloud Shell to manage your Azure Stack. First of all yes this works also if you just use the Azure CLI. In the case of the Azure Cloud Shell the Azure Stack needs to be accessible from the internet. If your Azure Stack is not accessible from the internet, you can just use the Azure CLI directly from your management machine.

Azure Stack Cloud Shell Visual Studio Code

Fun Fact, since you an also run the Azure Cloud Shell directly in Visual Studio Code, you can also just open up the shell session and start working from Visual Studio Code.