8

Install & Configure Azure CLI

 2 years ago
source link: https://kenanbek.medium.com/install-configure-azure-cli-af72245ee07c
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Install & Configure Azure CLI

This short tutorial covers topics like install Azure CLI, log in so you can use command via terminal and select account/subscription.

First, install Azure CLI:

brew update && brew install azure-cli

Then, log in to your Azure account by executing the following command:

az login

This command will open a browser window where you can sign to Azure. If the login was successful you will see a list of your current subscriptions.

[
{
"cloudName": "AzureCloud",
"id": "subscripion1-id",
"isDefault": true,
"name": "Pay-As-You-Go",
"state": "Enabled",
"tenantId": "tenant-id",
"user": {
"name": "your-account-id-or-email",
"type": "user"
}
},
{
"cloudName": "AzureCloud",
"id": "subscription2-id",
"isDefault": false,
"name": "Pay-As-You-Go",
"state": "Enabled",
"tenantId": "tenant-id",
"user": {
"name": "your-account-id-or-email",
"type": "user"
}
}
]

I have 2 subscriptions so for me it’s 2 items. You can output this data any time by typing az account list or az account list — output table for table output.

Now, it is important that you select correct subscription so you can see related resources in this subscription. To do so, execute:

az account set --subscription <enter-your-subscription-id>

To check if it works or not you can list your current resources in the selected subscription:

az resource list# oraz resource list --output table

Finally, if you want to see details of the subscription you can use the following command:

az account show -s <enter-subscription-id-or-name>

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK