Del via


Connect to Azure Germany by using Azure CLI

Important

Since August 2018, we have not been accepting new customers or deploying any new features and services into the original Microsoft Cloud Germany locations.

Based on the evolution in customers’ needs, we recently launched two new datacenter regions in Germany, offering customer data residency, full connectivity to Microsoft’s global cloud network, as well as market competitive pricing.

Additionally, on Sept 30th, 2020, we announced that the Microsoft Cloud Germany would be closing on October 29th, 2021. More details are available here: https://www.microsoft.com/cloud-platform/germany-cloud-regions.

Take advantage of the breadth of functionality, enterprise-grade security, and comprehensive features available in our new German datacenter regions by migrating today.

To use the Azure CLI, you need to connect to Azure Germany instead of global Azure. You can use the Azure CLI to manage a large subscription through scripts or to access features that are not currently available in the Azure portal. If you have used Azure CLI in global Azure, it's mostly the same.

Azure CLI

There are multiple ways to install the Azure CLI.

To connect to Azure Germany, set the cloud:

az cloud set --name AzureGermanCloud

After the cloud is set, you can log in:

az login --username your-user-name@your-tenant.onmicrosoft.de

To confirm that the cloud is correctly set to AzureGermanCloud, run either of the following commands and then verify that the isActive flag is set to true for the AzureGermanCloud item:

az cloud list
az cloud list --output table

Azure classic CLI

There are multiple ways to install Azure classic CLI. If you already have Node installed, the easiest way is to install the npm package.

To install CLI from an npm package, make sure you have downloaded and installed the latest Node.js and npm. Then, run npm install to install the azure-cli package:

npm install -g azure-cli

On Linux distributions, you might need to use sudo to successfully run the npm command, as follows:

sudo npm install -g azure-cli

Note

If you need to install or update Node.js and npm on your Linux distribution or OS, we recommend that you install the most recent Node.js LTS version (4.x). If you use an older version, you might get installation errors.

After Azure CLI is installed, log in to Azure Germany:

azure login --username your-user-name@your-tenant.onmicrosoft.de  --environment AzureGermanCloud

After you're logged in, you can run Azure CLI commands as you normally would:

azure webapp list my-resource-group

Next steps

For more information about connecting to Azure Germany, see the following resources: