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 Set Azure App scope after creating the new App using Azure CLI

I am trying to create an app and try to create scope for that, I am able to create the app but I am unable to create the scope. I already tired to search for the solution, I found this link but it seems like it's outdated. Here is the script for the…
0
votes
1 answer

Azure DevOps Pipeline Az CLI task: ERROR: 'NoneType' object is not iterable

I have an Azure DevOps pipeline that runs every month to renew an SSL certificate with Let's Encrypt via terraform. The certificate is saved to an Azure Key Vault with policy-enforced soft delete and purge protection. since terraform's idea of…
0
votes
1 answer

How to pass a script argument with spaces to Azure CLI task

There is an Azure CLI v2 task in one of my Azure DevOps release pipelines. Its Script Type is set as Shell and Script Location is set as Inline Script. I am trying to pass a script argument with spaces to an environment variable defined within the…
user1451111
  • 1,735
  • 3
  • 18
  • 30
0
votes
1 answer

How to pass more than 5000 characters as command to Azure CLI task?

There is an Azure CLI v2 task in one of my Azure DevOps release pipelines. Its Script Type is set as Shell and Script Location is set as Inline Script. The script contains a large az container create command at the moment and it works fine. I need…
user1451111
  • 1,735
  • 3
  • 18
  • 30
0
votes
2 answers

Azure CLI Task Yaml

I am trying to execute Get-AzSqlServer from AzureCli@2 yaml pipeline and it is throwing an error: The term 'Get-AzSqlServer ' is not recognized as the name of a cmdlet Here is my task - task: AzureCli@2 inputs: azureSubscription:…
0
votes
1 answer

How to pass AzureCLI credential to docker run (to be used by DefaultAzureCredential inside the container)?

I am new to Azure Pipeline, and trying to create a job to create Azure ML resources. Because the CI pipeline runs in a self-hosted agent, and can't run the pipeline in a container, I have to call docker run command in AzureCLI@2 task. something…
0
votes
1 answer

az keyvault key rotation-policy update - CLI supported version

From which CLI version below mentioned CLI command is supported az keyvault key rotation-policy update
0
votes
1 answer

Azure : ResourceNotFound from az cli but resource exist in Portal

Facing this "ResourceNotFound" issue (JPG-1), but I can see the logicapp resource in Azure portal(JPG-2) (ResourceNotFound) The Resource 'Microsoft.Web/sites/us-analytics-dev-dsvm-auto-deletion-logicapp-eastus2' under resource group…
praveen
  • 179
  • 1
  • 3
  • 16
0
votes
1 answer

When using Azure CLI to create an ML environment it is not always built

I am using Azure CLI as follows to create an ML environment: az ml environment create --name $(AML_ENVIRONMENT_NAME) --version $(AML_ENVIRONMENT_VERSION) --resource-group $(RESOURCE_GROUP) --workspace-name $(WORKSPACE_NAME) --image…
jarmniku
  • 151
  • 1
  • 2
  • 10
0
votes
1 answer

How to send text/plain body via Azure CLI rest sub-command

Trying to figure how to capture rest payload in a text file for Azure CLI "rest" sub-command. This works: az rest --method get --uri "https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Virtual Machines' and armRegionName eq…
Parag Doke
  • 863
  • 7
  • 17
0
votes
1 answer

Azure az login after successful login not to display details

Are there any option in azure cli not to display the JSON formatted output with tenantid, subscription details after successfully authenticated using az login command. I am building a shell script, where i first use az login then fetch secret info…
Tim
  • 1,321
  • 1
  • 22
  • 47
0
votes
1 answer

In Azure Devops yaml, I am unable to use pipeline variables in a "Azure CLI task v.2"

I am unable to use pipeline variables from the AzureCLI@2 task. In the yml below, thing2 outputs as expected, but thing does not output anything at all. Why doesn't thing output and how do I use AzureCLI@2 to set variables in the pipeline? stages: …
Philosophene
  • 80
  • 1
  • 7
0
votes
1 answer

How to Get All the Containers From a Specific Azure Storage Account using Azure CLI?

How to Get All the Containers From a Specific Azure Storage Account using Azure CLI? How to set context in azure cli like we set context in Powershell? $ctx = $storageAccount.Context How can we achieve this using Azure CLI? Get the storage account…
0
votes
1 answer

How to check the existance of a Loganalytic alertrule using azure CLI

Is there any way to check the existance of a Loganalytic rule by the alertrulename using Az commands or shell script. Looking for some solution where I can check whether the given alertrule name in Azuredevops pipeline runtime paramenter is existing…
Vowneee
  • 956
  • 10
  • 33
0
votes
2 answers

Azure graph query to fetch VM Name and Private IP address

I am trying to filter instances based on tags. I am using the below command to list instances that have wknhscale == 'active' tag. It is working fine and returns the instance name and resource group. az graph query -q "Resources | where type =~…
Eva
  • 515
  • 4
  • 28