Questions tagged [azure-cli]

Azure CLI (az) is a command-line tool for deploying and managing resources in the Azure cloud.

24 questions
13
votes
4 answers

Azure CLI to check VM status

Azure CLI allows people to start & stop VMs. However, is there any Azure CLI command that can show the VM status? I.e., whether it is started or being stopped? Thx.
xpt
  • 9,385
  • 44
  • 120
  • 178
3
votes
2 answers

Establishing an Azure VPN connection from CLI/PowerShell

I've installed Azure VPN Client app and configured an Azure VPN profile. It works when I manually start it via the app's UI. How do I initiate the connection via command line, Azure CLI or PowerShell? Rasdial doesn't seem to work with Azure VPN…
noseratio
  • 2,963
3
votes
0 answers

How I can stop a Azure VM without deallocating via Portal

If I work with VMs from Azure CLI, I can start, stop and deallocate my VM. It works like expected. If I use the portal web interface, I see the start function and a stop function. But this stop function works like stop and deallocate. How can I stop…
Mario
  • 201
3
votes
1 answer

Azure CLI reports missing credentials to access storage service after login

I'm trying to figure out how login works for Azure CLI. I've already logged in with: az login and everything seems to work perfectly, but when I try to run any other commands, e.g.: az storage blob list --container-name my_container it…
peidaqi
  • 131
2
votes
2 answers

Azure from Powershell, deploying to the wrong subscription

I'm trying to figure out if i deploy something from my powershell, that it is deploying to the wrong subscription which is in no way connected to eachother, except for that i have previously been logged in with it in powershell. I have used az…
1
vote
1 answer

How to successfully Install Azure CLI

I'm having problem installing Azure CLI. I've tried three methods but all failed. The first two are from Install Azure CLI on Windows, I've tried install the Azure CLI using PowerShell, and Download and install the latest release of the Azure CLI…
xpt
  • 9,385
  • 44
  • 120
  • 178
1
vote
2 answers

How do I check if a VM already exists via Azure CLI?

This is a working solution but not very clean: if [ "$(az vm list -d -o table --query "[?name=='VM_NAME']")" == "$(az vm list -d -o table --query "[?name=='ABSURD_NAME_THAT_CERTAINLY_DOES_NOT_EXIST']")" ]; then printf "VM DOES NOT EXIST…
Lavair
  • 123
1
vote
0 answers

Azure CLI Login through a Proxy

Ok .. so I'm pretty much lost. Task : execute a successful az login --service-principal -u XXX -p XXX --tenant something.onmicrosoft.com (Or tenant ID) From A server on the Azure Cloud that has no internet , and no service endpoint connection of…
Miroot
  • 11
1
vote
0 answers

Azure CLI to list opened ports

Following up on Azure CLI to open ports, now, is there any Azure CLI command that can show/list what the open ports are of a VM? Thanks
xpt
  • 9,385
  • 44
  • 120
  • 178
1
vote
1 answer

Getting an “you must upgrade Azure CLI” error when attempting to run Enterprise Bot Template in Visual Studio 2017 but my Azure CLI is up to date

I’m trying to deploy the Enterprise Bot Template using VS 2017 and I got the following error when running the msbot clone services code in the ReadMe file. C:\Users\xxx\Documents\Visual Studio 2017\Projects\SovereignBot\SovereignBot>msbot clone…
femi
  • 121
0
votes
0 answers

Terraform and Azure issues with terraform init

Some points to clarify: Using Windows 10 lastest version, Using terraform in this version via WSL: With the Ubuntu 22.04.5: I'm trying to do a terraform init and it happens this error: Using direnv allow to export mysecrets, My main.tf: My…
0
votes
1 answer

Azure ACR Auth Error - "aad access token with sp failed client id must be guid"

Using this guide: https://github.com/Azure/acr/tree/main/docs/preview/quarantine Endpoint to generate Token: GET https://quarantinetest1.azurecr.io/oauth2/token?service=quarantinetest1.azurecr-test.io&scope=repository:helloworld:pull,push I am…
ianh11
  • 21
  • 1
  • 5
0
votes
1 answer

How to delete all resource groups forcibly without prompt for confirmation using Azure CLI cmdlets?

Tried the below cmdlet to delete all resource groups in particular location: az group list --query "[?location=='westus']".name -o tsv | xargs -otl az group delete -n It is asking me to prompt for every resource group deletion. Also tried adding…
anon
0
votes
1 answer

PowerShell update Azure Service Principals Properties Tags

Using PowerShell to update Service Principals IDs found here on Microsoft Docs: https://docs.microsoft.com/en-us/graph/api/resources/serviceprincipal?view=graph-rest-1.0#properties Service Principal -> Properties -> tags How can I add custom tag to…
ianh11
  • 21
  • 1
  • 5
0
votes
1 answer

Getting TSV file output excluding 2 resource types from the az resource list in Azure CLI

Kindly concern that I need to get the azure resource list from the azure CLI excluding 2 kinds of resource types and output the file to a TSV file. I was able do this particular operation via PowerShell from the following command. PowerShell Command…
1
2