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

How to clean up multiple Azure resources with single powershell command or script?

I am trying to clean up the unused resources in my Azure subscription. there are about 80-90 resources in each subscriptions. It is possible to select and search one by one and delete them. Is there anyway to export the resource names and call a "az…
0
votes
1 answer

Azure cli to run Query Pack query

I can connect to log-analytics using azure cli ok but when listing the saved queries: az monitor log-analytics workspace saved-search list the Query Pack query I created doesn't show. The Query Pack query works in the Azure Portal when I load…
codebrane
  • 4,290
  • 2
  • 18
  • 27
0
votes
1 answer

How to do this query (az --query "custom-headers host")

I can't just print the (value) information. ], "id": "/subscriptions/x/resourceGroups/x/providers/Microsoft.Network/trafficManagerProfiles/x", "location": "global", "maxReturn": null, "monitorConfig": { "customHeaders": [ { "name":…
0
votes
1 answer

Azure pipeline foreach loop

I am having some problem to figure out the issue in this pipeline. I have a GitHub repo which contains one folder named dist. This folder has inside multiple files and folder. Here is the structure of my git hub: ├── README.md ├──…
Nayden Van
  • 1,133
  • 1
  • 23
  • 70
0
votes
3 answers

Az CLI query not displaying all columns properly

I have run the command az account list locations --output table and it displays me three columns with values in them: DisplayName, Name, RegionalDisplayName. Now I want to view only two columns e.g Name and RegionalDisplayName. So I run the…
Pallab
  • 1,915
  • 2
  • 19
  • 46
0
votes
1 answer

Azure CLI Commands to add templates to workitems

I have Product backlog item, I am able to see templates from Azure Board UI. I want to use Azure CLI commands to add templates to the product backlog item. I have query to create Backlog which is working fine but I am not getting how to add…
Shetty20
  • 3
  • 2
0
votes
1 answer

Cannot upgrade azure cli to the latest version

az --version showing an updated version available as shown below. kali@kali:~$ az --version azure-cli 2.18.0 * core 2.18.0 * telemetry 1.0.6 Extensions: interactive …
whoami
  • 1,689
  • 3
  • 22
  • 45
0
votes
1 answer

How to use bash variable in Azure CLI

I am trying to use a bash variable (ID in the below script) in azure CLI command. but seems its not working and throwing below error: usage error --scope: must be a fully qualified ARM ID. The error is happening on line az policy assignment list…
Rezoan
  • 1,745
  • 22
  • 51
0
votes
1 answer

Azure Python CLI: launch script with run-command invoke fails when passing the script file with @ but not with inline commands

I have a project designed to launch PowerShell scripts to run in Azure VMs using AZCLI with the following structure * /myAPP * /main (package) * main.py * /util (package) * auth.py * launchscript.py *…
AbianG
  • 33
  • 2
  • 8
0
votes
1 answer

Is it possible to set the a variable group scope using DevOps CLI or via REST

I am able to add/modify DevOps release definitions through a combination of CLI and CLI REST methods. The release definition object does not include (as far as I can tell) a property that controls the variable group scope. The release definition…
0
votes
1 answer

Does create service endpoint work? REST method fails, CLI Hangs

I am trying to create a service endpoint (aka service connection) in Azure DevOps. I first attempted to use the DevOps CLI but this method hangs. Using az devops as shown below. az devops service-endpoint azurerm create --name “Azure subscription…
user2503078
  • 737
  • 1
  • 8
  • 24
0
votes
1 answer

How ubuntu parameter by uuidgen and remove "-" format

What trouble I have : What I'd like to: input : az acr create --resource-group demo --name somefuntion(uuidgen) --sku Basic expectd : az acr create --resource-group demo --name "daf506ea86a64c478f5762238a3cc208" --sku Basic What I've tried : I…
Wei Lin
  • 3,591
  • 2
  • 20
  • 52
0
votes
1 answer

Microsoft example for installing Azure extension always gives error Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

az vm extension set \ --resource-group QuickstartAnsible-rg --vm-name QuickstartAnsible-vm --name customScript --publisher Microsoft.Azure.Extensions --version 2.1 --settings…
itye1970
  • 1,654
  • 7
  • 31
  • 62
0
votes
1 answer

Do you know how to create a custom domain name with azure command line?

https://learn.microsoft.com/en-us/cli/azure/?view=azure-cli-latest 1.Resource Group | az group create -l westeurope -n Domains 2.CDN > profile > create | az cdn profile create -g Domains -n HomeProfile --sku…
0
votes
1 answer

Multiple DevOps REST methods throwing 'command failed with an unexpected error'

I'm having trouble running DevOps API's via 'az rest' The two methods I attempted return the same result The code snippet I'm working with $resource = "https://graph.microsoft.com" $uribase = "https://dev.azure.com/{org}/{project}" $requestpath =…
user2503078
  • 737
  • 1
  • 8
  • 24