a few days ago the customer's system to do upgrade, need to use Azure CLI, the new kid over there is not connected to my tutorial for an afternoon. After he told me, I rushed to help him find out what went wrong, always put the error analysis. I've tried it myself a couple of times and I can even get it right. At the end of the day, when I found out where the problem was, I was a small-faced animal. Well, the most reliable is always self. Write an article for your client. No nonsense to start doing.
Use The Azure CLI connects to the subscription, and there is a requirement that the CLI must be installed. Ha ha.
about Installation Several methods of the CLI, how to install. You can refer to the Microsoft Azure century Internet version (China version) of the online guidance, landlord Pro-Test, no problem, link to paste you:
Https://www.azure.cn/documentation/articles/xplat-cli-install
through Azure CLI There are two ways to connect to your subscription:
use a work or school account or Microsoft Account ID sign in to Azure - This can be authenticated using either of the account identities. The current CLI also supports interactive authentication for accounts that have multi-factor authentication enabled. After you log on interactively, you can use the Resource Manager or classic (service management) commands.
Download and use the Publish settings file - This installs the certificate on the local computer, and you can perform administrative tasks as long as the subscription and certificate are valid. This method only allows you to use Classic (service management) commands.
Here we use the second kind.
my own The CLI version is 0.9.19, and you can use interactive logins. ( Note here: The following type must be entered Azurechinacloud, or run to the global version of the go, your Chinese version of the account can not be verified )
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M02/7E/76/wKiom1cAvt7wNVwwAAAyb4DKmW4037.jpg "title=" 2.jpg " alt= "Wkiom1cavt7wnvwwaaayb4dkmw4037.jpg"/>
type:Azure Login–e Azurechinacloud–u < account >-p < password >
650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/7E/76/wKiom1cAvu6QSpRZAADZJX0dy7w618.jpg "title=" 1.jpg " alt= "Wkiom1cavu6qsprzaadzjx0dy7w618.jpg"/>
As we said earlier, we use the Publish settings file method to connect to the subscription.
1, First, use the command to download the Publish settings file for your account. ( in general, the Internet's official website does not add -azurechinacloud so the total automatic generation of international version of the document, the customer got several times to find, especially to note. )
type:Azure account Download–e Azurechinacloud
650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7E/73/wKioL1cAv7-g-jZzAAD2WJMuEys900.jpg "title=" 3.jpg " alt= "Wkiol1cav7-g-jzzaad2wjmueys900.jpg"/>
This will open the default browser and prompt you to log in to the Azure Portal . Once logged in, download and note the address you downloaded to.
2, Import the Publish settings file,
type:Azure account import< The file address you just downloaded >
650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/7E/73/wKioL1cAv9DTJIW3AABTUEk_yF4557.jpg "title=" 4.jpg " alt= "Wkiol1cav9dtjiw3aabtuek_yf4557.jpg"/>
The above is done on the Windows operating system using the CLI to connect to the Azure subscription.
This article from the "11142118" blog, reproduced please contact the author!
Why can't you always connect to Microsoft Azure 21V version using CLI under Windows system