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
11
votes
2 answers

Why does Azure Application Gateway require an empty subnet

When I try to execute New-AzureRmApplicationGatewayIPConfiguration to create an application gateway, I get an exception: Subnet xxx cannot be used for application gateway yyy since subnet is not empty. I encountered this error when I tried to add…
Tom Deseyn
  • 1,735
  • 3
  • 17
  • 29
11
votes
2 answers

SQL Azure and Powershell for DACPAC deploy

I am deploying a dacpac built on visual studio 2012 to SQL Azure using powershell and running into issues which I think could be related to some version incompatiblity. The publish works fine when I do it from visual studio but throws an exception…
infinity
  • 1,900
  • 4
  • 29
  • 48
10
votes
4 answers

How to get Access Policies of the Azure KeyVault using Azure PowerShell

I'm working on an Azure Powershell script which compares the secrets and the access policies of two Azure KeyVaults. For comparing the secrets of the Azure KeyVault I've used the command Get-AzureKeyVaultSecret which worked fine, but for the access…
Just Shadow
  • 10,860
  • 6
  • 57
  • 75
10
votes
1 answer

import Azure Devops pipeline variables from json file

I want to use json file to store variables used by powershell script. In azure devops I have configured pipeline, pipeline contains powershell script with a list of variables in it. I would like to use json file and store in this file all variables.…
tester81
  • 533
  • 2
  • 9
  • 28
10
votes
5 answers

Using Az module in Azure DevOps Release Pipeline

I want to use the Azure PowerShell Module (aka Az Module) in an Azure DevOps Release Pipeline. However, the existing PowerShell options don't seem to work. I've tried various things, but installing the new Az module just brings up a ton of errors,…
Colin Mackay
  • 18,736
  • 7
  • 61
  • 88
10
votes
1 answer

Azure ARM Template Unit Test

How to test Azure ARM Templates and validate them whether these are written correctly or not from local VM. I have tried it from Power Shell but it just validate only. I want to Unit Test the ARM templates
10
votes
2 answers

Login-AzureRmAccount from VS Code terminal

When I try to login to Azure RM from VS Code terminal it just hangs. No prompt with login / password is shown. Is there any way to get logged in from that terminal? Otherwise running / debugging Azure PS scripts becomes more complicated than it…
the_joric
  • 11,986
  • 6
  • 36
  • 57
10
votes
2 answers

PowerShell script error: the string is missing the terminator:

Incredibly simple powershell script... #Server side storage copy $SourceStorageAccount = "myStorageAccount" $SourceStorageKey = "myKey" $SourceStorageContext = New-AzureStorageContext –StorageAccountName $SourceStorageAccount -StorageAccountKey…
Mick
  • 6,527
  • 4
  • 52
  • 67
10
votes
2 answers

Get-AzureRmResourceGroup : The term 'Get-AzureRmResourceGroup' is not recognized as the name of a cmdlet

I'm trying to retrieve a resource group name from my Azure subscription in PowerShell: Get-AzureRmResourceGroup | select resourcegroupname But I get the following error: Get-AzureRmResourceGroup : The term 'Get-AzureRmResourceGroup' is not…
Martin Erlic
  • 5,467
  • 22
  • 81
  • 153
10
votes
2 answers

No default subscription has been designated. Use Select-AzureSubscription -Default to set the default subscription

I’m keep getting the above error when trying to execute Start-AzureService. Following information prompted when executing Get-AzureAccount: Id Type Subscriptions Tenants -- …
albertsha
  • 189
  • 1
  • 2
  • 15
10
votes
2 answers

How does Azure PowerShell work with username/password based auth?

I want to understand how Azure PowerShell makes Azure API calls using AAD username/password based credentials. My understanding is that an app needs a client-id before it can make Azure API calls. This client ID must be registered with a user’s…
dhaundy
  • 242
  • 1
  • 2
  • 9
10
votes
4 answers

Azure Powershell throws "Unknown User Type"

I'm trying to authenticate Powershell script against the AD Account (as per this guide): $userName = "username@mydomain.com" $securePassword = ConvertTo-SecureString -String "myPassword1" -AsPlainText -Force $cred = New-Object…
trailmax
  • 34,305
  • 22
  • 140
  • 234
9
votes
5 answers

Difference between Azure CLI and PowerShell

I am asking this question as Windows user but I request you not to limit the answer for windows only. I tried executing Azure CLI commands in Power-Shell and they are executing successfully but not the other way around. In that case why do we have 2…
Devang
  • 299
  • 2
  • 4
  • 14
9
votes
4 answers

Invoke-Sqlcmd with AAD authentication

In an Azure DevOps 'release pipeline', I provision Azure resources - including SQLServer databases - and try to configure access to databases using managed identities. After ensuring the DevOps service principal is a member of the AAD group defined…
9
votes
2 answers

Create a consumption based App Service Plan with Powershell

I found this answer for the question Does anyone know how to create a Consumption app-service-plan with Azure? When I look at the properties (using https://resources.azure.com/ ) of one I made (by the Gui), I see the following properties; }, …
granadaCoder
  • 26,328
  • 10
  • 113
  • 146