Questions tagged [azure-cli]

The Azure CLI allows Azure users to manage their Azure assets and interact with their Azure services, applications, containers, and infrastructure in an idiomatic way.

Learn more here!

2057 questions
15
votes
3 answers

Azure Container Registry ACR How to add tag to image?

I see you can untag an image in an Azure Container Registry https://learn.microsoft.com/en-us/cli/azure/acr/repository?view=azure-cli-latest#az-acr-repository-show-manifests But how do you add a tag?
Novaterata
  • 4,356
  • 3
  • 29
  • 51
14
votes
2 answers

Azure Kudu Access denied with curl

Trying to access Azure App log stream from curl, as suggested by Azure Kudu web page. I'm on Windows 10 command prompt. This is a sample command line I'm trying: curl -u myUserName https://myApp.scm.azurewebsites.net/api/logstream Enter host…
superjos
  • 12,189
  • 6
  • 89
  • 134
13
votes
3 answers

az cli: How to retrieve key vault secret value alone, with no double quotes?

Using az cli command of az keyvault secret show --name $SecretName --vault-name $KeyVaultName --query value) returns the secret with double quotes. This causes my subsequent REST call to fail. How do I return the secret value only, no double…
SeaDude
  • 3,725
  • 6
  • 31
  • 68
13
votes
4 answers

How to securely login in Az CLI from a DevOps Pipeline

I want to execute AZ cli commands from my Azure DevOps Pipeline. In my YAML file I have this: trigger: - master pool: vmImage: 'ubuntu-latest' variables: buildConfiguration: 'Release' steps: - task: UsePythonVersion@0 inputs: …
hlustosa
  • 348
  • 1
  • 2
  • 12
13
votes
5 answers

Creating application insights with azure cli

I would like to create application insights using AZURE CLI. I can't find any documentation on this topic. Is it possible?
Dzior
  • 1,485
  • 1
  • 14
  • 30
13
votes
3 answers

Failure to generate access token using refresh token for O365 API

I'm getting invalid_grant error while generating access token using refresh token POST https://login.microsoftonline.com/common/oauth2/v2.0/token Response { "error": "invalid_grant", "error_description": "AADSTS50173: The provided grant has…
13
votes
3 answers

Can I access multiple azure accounts with azure-cli from the same machine at same time?

We actually have multiple azure accounts (for some valid reason) and I want to be able to run azure-cli commands for different accounts at the same time from the same machine. The problem with that is, once I login to one azure account with azure…
Buchi
  • 1,322
  • 4
  • 14
  • 33
12
votes
3 answers

How does `az login` store credential information?

I am wondering what happens when I am logging to azure using az login behind the scenes. I am still logged on for a long time, meaning that something is stored on the machine that allows access. Would it be possible for an adversary who gains access…
Ilya Chernomordik
  • 27,817
  • 27
  • 121
  • 207
12
votes
2 answers

How to Get Azure AD Object by Object ID Using Azure CLI

In the Azure Portal, one can look-up an Azure AD object based on the Object ID as shown below: Is it possible to retrieve an Azure AD object by the Object ID using the Azure CLI? In order to use the Azure CLI to get the object related to the object…
PoorInRichfield
  • 1,436
  • 2
  • 19
  • 29
12
votes
2 answers

Login into Azure cli for a service principal

I'm trying to get my ansible script to get logged into azure via azure cli. For some reasons, I'm not allowed to use the ansible azure package. I have to use the shell and call directly the commands from there. I'm fairly new with azure in general,…
Flashito
  • 332
  • 1
  • 4
  • 16
12
votes
2 answers

How to get client secret from existing Azure service principal

I have created a RBAC enabled service principal in Azure to configure Key Vault access within my OS using environment variables. When you create a service principal, the Azure CLI responds with the service principal details, containing the…
marcuse
  • 3,389
  • 3
  • 29
  • 50
12
votes
2 answers

Can't get access token for custom AD Application

When attempting to get an access token for a custom AD Application, using az account get-access-token --resource '', I receive the following error: AADSTS65001: The user or administrator has not consented to use the application with ID…
Andy Hohorst
  • 381
  • 3
  • 11
12
votes
5 answers

Getting tenant name from azure CLI

I would like to retrieve the tenant name THIS-THING-HERE.onmicrosoft.com using Azure CLI. I can't really find in documentation. EDIT: When I'm calling azure account list I don't get user name in the domain provided since I'm login with corporate…
Dzior
  • 1,485
  • 1
  • 14
  • 30
12
votes
7 answers

Retrieve the host keys from an azure function app

I am trying to script an environment using the Azure cli. I have created a few function apps and would like to add a host key or at least retrieve the default one that is created automatically. The azure cli has no support at all for this. There…
Sam
  • 1,725
  • 1
  • 17
  • 28
12
votes
3 answers

mac - az command not found azure

I am trying to install Azure CLI 2.0 on my mac. I followed official documentation but facing this error. bash: az: command not found How can I fix this error on mac?
Jahanzaib Aslam
  • 2,731
  • 3
  • 21
  • 26