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
5
votes
5 answers

Azure-Web-sites: How to cancel a deployment?

I have an Azure Function App / Azure Website setup with continuous deployment from source-control. This App has a custom deployment script that takes quite a bit of time to run. Occasionally I push out a change to git which was a mistake, and I want…
Doug
  • 6,446
  • 9
  • 74
  • 107
5
votes
2 answers

New-AzureRmResourceGroup : 'this.Client.SubscriptionId' cannot be null

I'm trying to create a new web app service in Azure from powershell, but running into the following error: New-AzureRmResourceGroup : 'this.Client.SubscriptionId' cannot be null. $webAppName = "powershelldemowebapp" $ResourceGroupName =…
5
votes
2 answers

Invoke-RestMethod - how to pass "ETag does not represent the latest state of the resource."

Question How to pass the exception having the following message? Invoke-RestMethod : {"Message":"ETag does not represent the latest state of the resource."} Seeing the reference, I think "passing If-Match: "*" header" should be a key, but don't…
grantaka36
  • 277
  • 1
  • 2
  • 14
5
votes
2 answers

Stop multiple Azure VMs at the same time using Azure PowerShell

Get-AzureRmVM -ResourceGroupName RG-VNETS | ForEach-Object { Get-AzureRmVM -ResourceGroupName RG-VNETS -Name $_.Name -Status } | ForEach-Object { if (-Not ($_.Statuses[1].DisplayStatus -like "*deallocated*")) { …
5
votes
2 answers

Azure PowerShell DSC install extra modules

As part of an Azure resource group template I have a PowerShell DSC extension setup for my VM which provisions various Windows features. As part of this automated setup I want to be able to open some ports in the firewall, after a bit of research I…
Mike Norgate
  • 2,393
  • 3
  • 24
  • 45
5
votes
2 answers

Retrieve Service Bus event hub connection string

I have an existing Service Bus with one queue and event hub deployed using Azure Resource Manager. Now I am interested to retrieve the primary key and connection string using Azure PowerShell wiithout using the ServiceBus.dll. Is it possible?? As a…
5
votes
0 answers

Long running operation failed with status Failed

I've created an Azure Application Gateway (Azure RM) via Azure Powershell and it worked perfectly fine.Then I tried to create it using Azure SDK for Ruby (Link to SDK: https://github.com/Azure/azure-sdk-for-ruby) and received and Exception / Error…
Haider Ali
  • 81
  • 6
5
votes
2 answers

Azure BreakLease returns 409 Conflict error

I am unable to delete an Azure blob because it has an infinite lease on it. I am now trying to break that lease using the BreakLease() method. Here are the commands I'm executing in PowerShell: $StorageAccountName = "storage account…
Patrick
  • 356
  • 1
  • 10
5
votes
2 answers

How to configure github etc for Azure via Powershell

Is it possible to configure a source control repository to deploy code to an Azure Web App slot via Powershell. (or even just the primary site) Ideally for v2 / ARM but I'm willing to consider anything at the moment! I have looked through the…
5
votes
2 answers

Change Azure website web hosting plan mode using Powershell

I've been reading the following article that describes how to change the web hosting plan for your site. http://azure.microsoft.com/en-us/documentation/articles/azure-web-sites-web-hosting-plans-in-depth-overview/ That seems to work fine but if I…
emp
  • 4,926
  • 2
  • 38
  • 50
5
votes
2 answers

"azure" not recognized in Azure powershell

For the first time I'm trying out Azure Powershell. I'm selected my subscription and am trying to run the following command: azure site log tail websitename However when I run the command I get the following error: azure : The term 'azure' is not…
user3397240
  • 239
  • 1
  • 3
  • 11
5
votes
2 answers

Azure Powershell cmdlets for 1.7, June 2012: what's happened to Get-OperationStatus?

The new Powershell cmdlets (documented here: http://msdn.microsoft.com/en-us/library/windowsazure/jj152841) look lovely, but there's one that appears missing: Get-OperationStatus -WaitToComplete Without this my Azure operations (e.g.…
Jeremy McGee
  • 24,842
  • 10
  • 63
  • 95
4
votes
1 answer

Az CLI - Register an Azure AD B2C Application

I am struggling to find an Az-Cli command that will enable me to register or create an Azure AD B2C application. Anyone able to point me in the right direction? By the way, I wouldn't mind Azure Powershell as a possible solution either.
4
votes
1 answer

How to change the value of a YAML variable between tasks inside the same job

How to set a new value of a YAML variable in YAML file through a task, and the subsequent task will display the new value using powershell? (both tasks are in the same job) I am trying with below code, but its not working. The second/subsequent task…
4
votes
2 answers

In Azure pipeline, how can Powershell make a task fail?

I am working on Azure Pipelines on a Windows Self hosted Agent. I need my pipeline to run a PowerShell script and if the script is successful, the next stage do the deployment, else the task fails, we have to fix something and resume the task I'll…
ClaudeVernier
  • 427
  • 4
  • 20