Questions tagged [azure-cli2]

Azure CLI 2.0 is optimized for managing and administering Azure resources from the command line, and for building automation scripts that work against the Azure Resource Manager.

https://learn.microsoft.com/en-us/cli/azure/overview?view=azure-cli-latest

156 questions
1
vote
1 answer

Unable to backup Function/Web App using Azure Cli az webapp config backup create

I am facing an issue when executing the Azure Cli command to backup my Azure App Service: Cli Command : az webapp config backup create --resource-group --webapp-name --backup-name testbackup --container-url I generated a new SaS key to be passed…
1
vote
5 answers

Azure CLI - Get newest package from a view (az artifacts universal download)?

Using az artifacts universal download, how can I download the latest package under a specific view in a feed, e.g. @Prerelease? I can't seem to find any documentation on how to specify the view Edit - Requests: User Voice…
1
vote
1 answer

Upate Release Definition using Azure DevOps REST API fails with old copy

I'm trying to leverage the DevOps API to update a new release definition. Ultimately, I will be adding a new environment to the release definition but for now I'm just trying to get the update (PUT) method to work. I've referenced post this post…
user2503078
  • 737
  • 1
  • 8
  • 24
1
vote
1 answer

az pipeline embedded ampersand (&) breaks when passing key=value

How to pass a value that has ampersand (&) and possibly other characters. the following powershell script fails $groupname = "owtest" $tags = @() $key="test" $value="some=&this&that" $tags += "$key=$value" $creation = az pipelines…
user2503078
  • 737
  • 1
  • 8
  • 24
1
vote
1 answer

az devops powershell passing space delimited values

The AZ devops command az pipelines variable-group create takes --variables defined as "Variables in format key=value space separated pairs" I need to create a variable group with 20+ key=value pairs. I'm finding it hard to do so as a variable. This…
user2503078
  • 737
  • 1
  • 8
  • 24
1
vote
2 answers

File path from within Azure CLI task

I have an Azure CLI task which references a PowerShell script (via build artifact) running az commands. Most of these commands work successfully, but when attempting to execute the following command: az appconfig kv import --name $resourceName -s…
1
vote
1 answer

Add Graph API via az ad app permission fails

I'm attempting to add the Graph API via CLI 2.x. Here is the PowerShell script I'm running: # # (1) Register the app, replyUrl, enable implicitflow # Write-Host " - Create Application " + $appName az ad app create --display-name…
user2503078
  • 737
  • 1
  • 8
  • 24
1
vote
2 answers

How to add preAuthorizedApplications using CLI 2.x

In Azure AD, under the expose an API section, I'm looking to automate the registration of an API and web app using CLI 2.x. I've looked through documents here but find nothing that addresses preAuthorizedApplications. Searching has yielded only…
user2503078
  • 737
  • 1
  • 8
  • 24
1
vote
1 answer

install Azure client on ubuntu virtual machine public key is not available

I am following this link to install Azure client on a Ubuntu virtual machine on Azure. This virtual machine is probably on a private network and behind a…
thotwielder
  • 1,563
  • 7
  • 44
  • 83
1
vote
2 answers

"az login" signs you in to which tenant?

I am trying to understand the default behavior of "az login" command. Suppose I have freshly installed Azure CLI and am doing a login for the first time using the command - az login Now say I belong to multiple tenants, which tenant will I get…
user3740951
  • 1,109
  • 2
  • 20
  • 39
1
vote
1 answer

Restart Tomcat using azure cli/cli2

I'm trying to restart Tomcat server hosted on a Docker container using Azure CLI. What is the best approach to do that. I saw that I could do it running a .sh/powershel script via Azure CLI. Is there a better solution to restart the Tomcat? Thanks &…
1
vote
1 answer

Getting error of Expecting Value in Azure CLI for deploying Custom Script Extension

Thanks in advance, I'm trying to deploy custom script extension from Azure CLI from Cloud Shell. But getting error of expecting value. I'm using SAS key to download the PS file. I've tried to use every possible way of adding Protected settings, and…
1
vote
1 answer

Invalid Syntax : Azure CLI with Python

Thanks in advance, I'm trying to Update Azure VM. Eventually my code gets the certificate from Azure key vault and will save it in local certificate store. I've accomplished successfully using Azure CLI on Bash. code is present below secret=$(az…
1
vote
2 answers

Saving output to variable not working in Azure-CLI DevOps task

Trying to save an output of azure advisor recommendation on to a variable so that i can pass on to next task. However no matter what syntax I try, and believe me i have tried all possible combinations, the variable doesn't get saved. Interestingly,…
Sumesh
  • 123
  • 2
  • 13
1
vote
3 answers

Is there any way do create a vm in azure without temporary storage drive?

I used this command to spin up a virtual machine : az vm create -n $virtualMachine -g $resourceGroup --size Standard_D2_v3 --image win2016datacenter --data-disk-sizes-gb 40 --location $location --admin-username $admin --admin-password…
Ehsan Zargar Ershadi
  • 24,115
  • 17
  • 65
  • 95