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

Azure CLI v1 vs v2?

what are some of the advantages and disadvantage of using Azure CLI v2 over Azure CLI v1? I have searched various articles online. Sounds like Azure CLI v2 is more developer friendly, built on python and provides auto complete capabilities and works…
explorer
  • 737
  • 1
  • 8
  • 23
1
vote
1 answer

How to use --attach-data-disks when creating new VM using Azure CLI2?

I'm trying to create a new VM using existing Managed disks and I keep running into problems because the parameters are not very well documented. One problem that I haven't figured out is the format of --attach-data-disks From the name and…
Zack
  • 2,291
  • 2
  • 23
  • 38
1
vote
3 answers

Azure CLI choose a option from a table

I am trying to get a table output with numbers in the Azure CLI which gives this as a output Number Location Name ---------- ----------- ------------- 1 somewhere ResourceGroup1 2 somewhere ResourceGroup2 The…
Brynn
  • 97
  • 2
  • 13
1
vote
4 answers

Getting SAS tokens in Azure CLI

Is there any way to list SAS tokens of a storage account in Azure CLI? I can generate one and it spits out the generated token immediately. However, there seems to be no way to list/show/get the same token later using Azure CLI. I see it's possible…
1
vote
1 answer

Every "az" commands are now failing, how do I fix it?

I managed to break az, by using CTRL-C after the command "az login". Now, all I can get is this message : Traceback (most recent call last): File "runpy.py", line 193, in _run_module_as_main File "runpy.py", line 85, in _run_code File…
grokolon
  • 13
  • 4
1
vote
2 answers

BASH - Read value from array into command

I am relatively new to bash and I need to create 127 VNET security rules for an Azure MySQL server instance using the Azure CLI, which needs a rule name and associated subnet ID. The rule name is the subnet name. I can read the subnet name and ID…
1
vote
2 answers

Azure CLI. Is it possible to update/set default documents for web app?

I have a web app on azure and i want to add a value app_offline.htm in Default Documents through azure cli 2.0: I looked at az webapp config appsettings set, but this sets the config and not the default document. Did someone encounter this? Is…
GrimSmiler
  • 561
  • 1
  • 4
  • 21
1
vote
1 answer

Azure CLI How to iterate over list

I have need to reboot all Nodes in Azure Batch. How can i do that using Azure CLI ? Essentially how can i iterate over List/Collection in Azure CLI and call command within that loop to stop the VM
NSS
  • 1,835
  • 2
  • 29
  • 66
1
vote
1 answer

ssh to azure-vm after building from image

I have created an image from an existing ubuntu-vm. After that I have created some vms based on that image using azure-documentation. The command I used in the CLI for creating the VMs was az vm create --resource-group --name…
derzeit
  • 43
  • 1
  • 5
1
vote
0 answers

Azure ARM policy assignment error - api-version s invalid

I am trying to run a simple command to assign an arm policy to a resource group. My command to create the definitions works fine, and my assignment commands work fine when using a scubscription scope. However, when I try to run the command I get the…
Pectus Excavatum
  • 3,593
  • 16
  • 47
  • 68
1
vote
2 answers

Azure ARM policies, using the predefined definitions via CLI

I would like to know if it is possible to use the default pre-defined ARM policies for assignments through the CLI. Essentially, I have noticed that there is a default policy to restrict the location within the portal, so if you use the portal you…
Pectus Excavatum
  • 3,593
  • 16
  • 47
  • 68
1
vote
1 answer

How do I send diagnostic data to Application Insights? (automated deployment)

I would like to link diagnostic data from an azure resource to Application Insights which is similarly described here:…
1
vote
1 answer

Only blobs formatted as VHDs can be imported

I am following these https://learn.microsoft.com/en-us/azure/virtual-machines/linux/upload-vhd instructions to create a VM in Azure. At this stage though az disk create --resource-group myResourceGroup --name myManagedDisk \ --source…
Barnsley
  • 117
  • 2
  • 17
1
vote
2 answers

How to run simple custom commands on a Azure VM (win 7,8,10, Server) post deploy?

I'm looking into how I can run commands remotely on a freshly deployed windows VM in Azure, and have a few basic questions. It seems like the 'Custom Script Extension' is the answer, but according to the documentation, is stated as only applicable…
David
  • 197
  • 3
  • 19
1
vote
2 answers

How to manage Azure Backup with Azure Python SDK or Azure Cli

Basically the title is the question, there are no ways to interact with backup services in the Azure Cli and\or Azure Python SDK (unless I'm missing something), so how do I manage that?
4c74356b41
  • 69,186
  • 6
  • 100
  • 141