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.
After the login you have to register Azure Stack as a new cloud by running the following command:
az cloud register \
-n AzureStack \
--endpoint-resource-manager "https://management.region.url.com" \
--suffix-storage-endpoint "region.url.com" \
Now you can list the new Azure Stack cloud by using:
az cloud list -o table
To switch to the Azure Stack Cloud use the following command:
az cloud set -n AzureStack
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
az cloud update --profile 2017-03-09-profile
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.
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.