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
6
votes
1 answer

How to tell if my VM is Gen1 or Gen2 in Azure?

I would like to figure out if my Azure VM (Windows + Linux) is Gen1 or Gen2. Ideally I want to get this to work via az cli or from the actual server itself. I have tried az vm list -g RG-Name -d but it does not really display this information. Does…
souser
  • 5,868
  • 5
  • 35
  • 50
6
votes
3 answers

Azure Cli How to enable Application Insights for webapp

Consider the following code. It creates an application insight, then it retrieves the instrumentationkey and assigns it to my webapp. az monitor app-insights component create -g $resourceGroup --app $webapp --application-type web --kind web…
Sam
  • 13,934
  • 26
  • 108
  • 194
6
votes
2 answers

Where are auto generated SSH keys stored in Windows using azure cli --generate-ssh-keys

I am trying to create linux VM with azure cli from local machine. I was able to create VM using following command but now when I want to ssh into the VM, I need to have public key on my local machine? How can I get the required public key to connect…
Kundan
  • 1,394
  • 1
  • 13
  • 26
6
votes
1 answer

Use bash, Azure CLI and REST API to access CosmosDB - how to get token and hash right?

My ultimate goal is to upload a document to an existing CosmosDB (SQL) instance using bash and Azure CLI. Trouble is: Azure CLI does not offer a command to modify documents. To work around this I looked into the az rest command and was hoping to…
Krumelur
  • 32,180
  • 27
  • 124
  • 263
6
votes
1 answer

Expecting property name enclosed in double quotes when passing JSON string to Azure CLI (from PowerShell)

To create diagnostic settings on an Azure Firewall I want to pass in logs and metrics settings. I define these in 2 variables and then pass 'em into Azure CLI: $logsSetting = "[{'category': 'AzureFirewallApplicationRule','enabled':…
Kai Walter
  • 3,485
  • 2
  • 32
  • 62
6
votes
3 answers

Azure DevOps: Powershell 'Get-AzSubscription' is not recognized

I am deploying an ARM template from azure DevOps using Azure PowerShell as shown below. This is subscription level deployment. I am getting below error. The term 'Get-AzSubscription' is not recognized as the name of a cmdlet, function, script…
Sakaldeep Yadav
  • 392
  • 1
  • 6
  • 20
6
votes
3 answers

Azure CLI aks install cli permission denied and sudo does not work

I'm trying to run az aks install-cli but I get an error that says Downloading client to "/usr/local/bin/kubectl" from "https://storage.googleapis.com/kubernetes-release/release/v1.14.0/bin/linux/amd64/kubectl" Connection error while attempting to…
Kathrine Stack
  • 189
  • 1
  • 2
  • 14
6
votes
2 answers

Can the default error color be changed in python?

When running python scripts or programs built using python, errors are emitted in dark red. As I get older, this is getting harder for me to read, to the point I have to squint, magnify, or fuss with the console properties and re-run commands. I…
StingyJack
  • 19,041
  • 10
  • 63
  • 122
6
votes
3 answers

Setting signInAudience of application registration with azure cli

I'm creating and app registration with azure cli using az ad app create ... function. In the manifest of app registration there is a field:signInAudience which i want to set to: AzureADandPersonalMicrosoftAccount Calling az ad app update --id…
Dzior
  • 1,485
  • 1
  • 14
  • 30
6
votes
4 answers

Use Azure CLI within Azure Powershell Task

I want to create a Powershell script which executes some AzureRm... commands and follows those up with some Az commands. Reason being that some commands are only available via Az. When trying to execute these scripts in a release pipeline, the…
6
votes
2 answers

Schedule Azure CLI Script

I've searched a bit about this, but is there documentation at all on how to schedule jobs that run with Azure CLI commands? I want to run in the cloud, but azure automation doesn't support CLI (yet), so i am leaning towards perhaps using Azure…
m1nkeh
  • 1,337
  • 23
  • 45
6
votes
3 answers

Is there a way to configure CosmosDB to use both the SQL (DocumentDB) and MongoDB APIs?

When I create a new CosmosDB database in the Azure Portal, I have to choose between the various APIs (Gremlin, MongoDB, SQL/DocumentDB, and Table.) As with soo many other limitations of the Azure Portal, I'm hoping that there is a way to configure…
Greg Thatcher
  • 1,303
  • 20
  • 29
6
votes
2 answers

Use the Azure Cli to access Azure storage using a SAS

Is there a way of using a SAS (shared access signature) to access an Azure storage container from the CLI? It's clearly possible using an account name and a key, or using a connection string. But I want to use the CLI in a script that should only…
Malt
  • 28,965
  • 9
  • 65
  • 105
5
votes
3 answers

Az login without manual interaction

I am trying to automate azure login in a powershell script and for that, I am using the below command as suggested in the Microsoft doc here: az login --tenant --use-device-code But the script is pausing here with the below warning…
Mounika
  • 371
  • 4
  • 18
5
votes
2 answers

az: 'upgrade' is not in the 'az' command group

I want to upgrade azure cli to 2.26.1 version from 2.0.81 in window subsystem of linux(wsl ubuntu). I am trying to use command az upgrade . It is giving following error: az: 'upgrade' is not in the 'az' command group. See 'az --help'. If the…