Azure CLI にサインインする
Azure CLI にサインインしてみます。
この記事は「Azure CLI をインストールする(Windows 10)」という記事の続きでもあります。
■PC環境
Windows10
■Azure CLI にサインインする
Azure CLI にサインインしてみますので、まずはWindows10のコマンドプロンプトを起動します。
>az login
起動後、上記のコマンドを入力し、Enterキーを押します。Azureにログインを行います。
A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
Enterキーを押すと、上記のメッセージが出力され、自動的にWebブラウザ(今回はGoogleChrome)が起動します。
起動後、「アカウントにサインイン(https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?client_id=****)」というページが表示されます。ページ内には「Microsoft Azure」と表記されており、Azureのサインインページのため、お持ちのアカウント(無料アカウントも含む)を選択します。
You have logged into Microsoft Azure!(Microsoft Azure にログインしました。)You can close this window, or we will redirect you to the Azure CLI documents in 10 seconds.(このウィンドウを閉じてもかまいません。10 秒以内に Azure CLI ドキュメントにリダイレクトされます。)
選択すると、「localhost:5255」のページに移動します。ページ内には上記のメッセージが表示され、これでMicrosoft Azureへのログインが完了します。完了後、ページを閉じます。
[{
"cloudName": "AzureCloud",
"homeTenantId": "**----*****",
"id": "**----*****",
"isDefault": true,
"managedByTenants": [],
"name": "Azure subscription 1",
"state": "Enabled",
"tenantId": "**----*****",
"user": {
"name": "*****@outlook.jp",
"type": "user"
}
}
]
閉じた後に、Windows10のコマンドプロンプトを確認すると、上記のメッセージが出力されており、これが表示されていれば、正常にサインインが完了しています。



