Questions tagged [azure-powershell]

The Azure module for PowerShell allows administrators to accomplish management tasks for Azure resources. The Az wrapper module includes only stable modules, the AzPreview wrapper module includes all PowerShell modules for Azure allowing to manage resources in all Azure services.

The Azure Modules for PowerShell allows administrators to accomplish many Azure management tasks through a series of cmdlets. The modules include the new Az module and the older AzureRM module (due to retire by Feb 2024).

References:

  1. Overview of Azure PowerShell

  2. PowerShell Module Browser: Search for PowerShell modules and cmdlets.

2843 questions
82
votes
12 answers

Azure CLI vs Powershell?

Not precisely able to understand the merit of Azure CLI on Windows environment. Is it targetted for the audience who want to manage Azure IAAS from Linux environment? I thought Powershell core is going to be the way for non-Windows admins. Is…
Abhijeet
  • 13,562
  • 26
  • 94
  • 175
51
votes
12 answers

Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet

I was trying to install Azure using Install-Module Azure in PowerShell. I got the following error: PS C:\Windows\system32> Install-Module Azure Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet, function, script…
Martin Erlic
  • 5,467
  • 22
  • 81
  • 153
45
votes
6 answers

Is there an API to list all Azure Regions?

I would like to list all Azure locations via some API (I need to generate some config files for every region, and use the exact naming that Azure does to avoid typos). I found this question, but it only lists regions a particular subscription is…
aoetalks
  • 1,741
  • 1
  • 13
  • 26
43
votes
4 answers

Adding an App Settings to existing Azure Web Application using Azure Power Shell

I want to write a script that run using azure power shell to automate adding the Web Application configuration Azure > MyWebApp > Application Settings > App settings It's look like key = "value" I write this script ########################### #…
Marzouk
  • 2,650
  • 3
  • 25
  • 56
42
votes
7 answers

Connect-AzAccount : The term 'Connect-AzAccount' is not recognized as the name of a cmdlet, function, script file, or operable program

I am trying to execute the following PowerShell script in Azure DevOps pipeline by using PowerShell task with inline mode. $clientId= "xxxxxxxxx" $clientSecret= "xxxxxxx" $subscriptionId= "xxxxxxxx" $tenantId= "xxxxxxxxxxxxx" # sign in Write-Host…
Pradeep
  • 5,101
  • 14
  • 68
  • 140
33
votes
5 answers

Check If Azure Resource Group Exist - Azure Powershell

I'm trying to verify if ResourceGroup exist or not so i thought that following code should return true or false, but it doesn't output anything. $RSGtest = Find-AzureRmResource | Format-List ResourceGroupName | get-unique $RSGtest -Match…
30
votes
8 answers

How do I find the Azure PowerShell version?

I need to find the installed Azure PowerShell version through cmdlets code. How do I find the Azure PowerShell version? Note: Other than cmdlets code is also welcome.
ManirajSS
  • 2,295
  • 5
  • 26
  • 50
29
votes
6 answers

Change Azure virtual machine name in Azure portal

Can we change the name of an Azure Virtual Machine in the Azure portal? I am sure we cannot change it via portal, do we have any PowerShell cmdlet to change the virtual machine name?? Note: I am not referring to VM name inside the VM, but the name…
Manjunath Rao
  • 1,397
  • 4
  • 26
  • 42
25
votes
4 answers

How to find the current Azure RM Subscription

In Azure Classic / Service Management, Get-AzureSubscription would give a list of subscriptions in the Tenant with an indicator of which was current. There was also a Get-AzureSubscription -Current flag that would give you just the current…
Michael B
  • 11,887
  • 6
  • 38
  • 74
24
votes
7 answers

Fatal: Could not read password for 'https://OrganizationName@dev.azure.com': terminal prompts disabled

I'm trying to merge the develop branch to the master branch when building with Azure Pipelines PowerShell task. But while executing the command git push, I'm getting this error: Fatal: Could not read password for …
21
votes
7 answers

How to run Azure CLI commands using python?

I want to use Azure CLI to get the list of all the VMs in my resource group. But I want to implement the same using a python script. For example, I will use the following command in Azure CLI to list the VMs in my resource group: " az vm list -g…
20
votes
2 answers

Azure Powershell script to swap Azure App Service (website) deployment slots

I'm looking for a way to use Azure PowerShell commands to do a deployment swap for an Azure App Service (previously Azure Websites). All of the posts I've seen say to use the command Move-Deployment -ServiceName but that appears to only be valid…
Jeff Treuting
  • 13,910
  • 8
  • 36
  • 47
18
votes
2 answers

KeyVault generated certificate with exportable private key

I'm attempting to create a self signed certificate in KeyVault using the "Self" issuer. $policy = New-AzureKeyVaultCertificatePolicy -SubjectName "CN=$($certificateName)" -IssuerName "Self" -ValidityInMonths 12 $policy.Exportable =…
Alex KeySmith
  • 16,657
  • 11
  • 74
  • 152
16
votes
5 answers

Warning about Breaking changes in the cmdlet 'Get-AzKeyVaultSecret' SecretValueText deprecated Az4.6.1

I upgraded Az Powershell to 4.6.1 today and started seeing the below warning. The question I have is what I am supposed to do about this warning? I could mute the warning but that wouldn't help me prepare for this breaking change at all. I checked…
Negatar
  • 637
  • 8
  • 14
16
votes
8 answers

Azure Powershell: What is the opposite command to Login-AzureRmAccount (used to be Clear-AzureProfile)

I have various scripts which I used to run in a wrapper to allow me to handle things like checking I had a valid connection and to ask the user if the connection/subscription currently selected is the one they want to run the script on before…
Dave Hodgson
  • 163
  • 1
  • 1
  • 5
1
2 3
99 100