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
9
votes
4 answers

Set Output Variable in Azure CLI task on VSTS

I am getting crazy to achieve this very simple task. I need to set an Output Variable in an Azure CLI task on Visual Studio Team Services, because next task in the Release definition will be executed according to the value of this variable. I wrote…
9
votes
1 answer

login to Azure from a script

I want to run shell script on Linux using azure-cli (az command) that login to Azure without entering password and run other azure-cli commands without login again. First, I once run 'az login', it create a .azure under my home directory, who save…
user1980099
  • 573
  • 1
  • 8
  • 30
8
votes
2 answers

Azure CLI in WSL2 uses Windows home directory

Running this in WSL2 (current folder /home/my-linux-user/): az aks get-credentials --resource-group my-resource-group --name cluster-name Outputs: Merged "cluster-name" as current context in C:\Users\my-windows-user\.kube\config What do I need to do…
Joel
  • 8,502
  • 11
  • 66
  • 115
8
votes
1 answer

How to access AAD B2C tenant with Azure CLI

I need to get user details in AAD B2C tenant I have access to: az ad user show --id 0cbb4fd6-7091-44fb-ab5e-d2bd9c366f59 This cannot find the user because I'm logged into my organization regular AAD tenant. B2C tenants do not have subscriptions,…
8
votes
4 answers

Network Rules of storage account blocking container creation

Following the instructions for the Azure CLI "quickstart" on creating a blob. It looks like something in the default storage account is blocking the ability to create new containers; yet, the "defaultAction" is Allow: The following Azure CLI: az…
lenards
  • 141
  • 1
  • 8
8
votes
5 answers

How to enable "Allow Azure services and resources to access this server" through PowerShell (Azure CLI)?

After creating a new Azure SQL server using az sql server create, how can I enable the following options through PowerShell(Azure CLI)?
Mason
  • 1,007
  • 1
  • 13
  • 31
8
votes
4 answers

How to split a CLI command in Azure Devops over multiple lines? (Running on Windows)

I am running the following in a CLI task on Azure Devops (inline) rem Create the Service Plan call az appservice plan create --resource-group %RESOURCE_GROUP% --name %SERVICE_NAME% --sku B1 Whch works just fine. However, I'm having to scroll to see…
Jon Ryan
  • 1,497
  • 1
  • 13
  • 29
8
votes
5 answers

Azure Logic Apps: how to run Powershell script or Azure CLI?

I'm building my Azure Logic Apps worklow which is supposed to check some conditions and run following Powershell: Stop-AzureWebsiteJob -Name MyWebsite -JobName MyWebJob Start-AzureWebsiteJob -Name MyWebsite -JobName MyWebJob -JobType Continuous The…
mickl
  • 48,568
  • 9
  • 60
  • 89
8
votes
1 answer

How to get private IP of VMSS using CLI

I'm trying to automate few of our BAT script and for this our script need to know the private IP of each instances of VMSS(no public IP for instances). Is there a way to query the private IP of all instances under a particular VMSS using azure cli.…
lambodar
  • 3,495
  • 5
  • 34
  • 58
8
votes
2 answers

How to create a dind docker image with azure-cli on Alpine linux?

I am trying to install the azure-cli in the dind:latest image based on alpine. For context, I want to use it to connect to AKS and deploy an app to Kubernetes via Gitlab. In my gitlab-ci.yml file I start with this image: docker:latest services: -…
Kostas Demiris
  • 3,415
  • 8
  • 47
  • 85
8
votes
3 answers

Is it possible to create a SendGrid account through Azure CLI?

Every tutorial and resource I've seen has you create a SendGrid account through the GUI, but I want to be able to use the cli. Is it possible? Something like: az sendgrid create
user3052659
  • 161
  • 1
  • 5
8
votes
2 answers

Azure AD add keys via Azure CLI

I'm trying to add a key in my Azure AD application using Azure CLI. But looking throught the Azure CLI API it seems that there is no such command. For exmaple: I'm trying to automate the task from the link below via Azure…
7
votes
1 answer

How to run multiple commands using terraform local-exec

I am trying to run a few az cli commands using terraform using local-exec provisioner but I keep running into an error that says: Error: Invalid expression On modules/eventgrid/main.tf line 68: Expected the start of an expression, but found an…
rb16
  • 129
  • 4
  • 11
7
votes
1 answer

az login on specific subscription

If you want to connect to a specific subscription with Az.Accounts, you do something like: Connect-AzAccount -SubscriptionId etc... I see that there is no possibility of specifying the SubscriptionId with az login. If my account for example…
Vivere
  • 1,919
  • 4
  • 16
  • 35
7
votes
1 answer

Is there some tool/command to run azcli files from powershell?

I'm using VS Code, and to get some intellisense when writing the azure cli script I've put everything in a .azcli file. My question now is how do I execute that file from a powershell terminal? Also, is it possible to use parameters in such a script…
Tomas Jansson
  • 22,767
  • 13
  • 83
  • 137