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
1 answer

PowerShell 7. ForEach-Object -Parallel Does Not Autheticate Against Azure PowerShell

We wrote a script that supposed to execute Azure PowerShell commands in parallel. The problem is when we increase -ThrottleLimit higher than one, some of the commands are not being performed properly. The script is: # Writing IPs for whitelisting…
WinBoss
  • 879
  • 1
  • 17
  • 40
5
votes
4 answers

I am getting "PackageManagement\Install-Package : Access to the cloud file is denied" errors while installing Az module in power shell

I am trying to install Az module on windows power shell by "Install-Module -Name Az -Scope CurrentUser -Force -Allowclobber command". But i am getting below error. PS C:\WINDOWS\system32> Install-Module -Name Az -Scope CurrentUser -Force…
5
votes
2 answers

Azure CLI - Delete resource without deleting resource group

The goal is to delete all resources in a resourcegroup without deleting it using azure CLI. From reading the doc, I can do this: az resource delete -g MyResourceGroup -n MyVm Therefore I assumed I can do the following az resource list …
user3622142
  • 360
  • 4
  • 18
5
votes
3 answers

Update Azure CDN custom domain certificate from a script

How do you trigger Azure CDN to read the latest version of custom certificate from Key Store without downtime? My CDN-setup is working ok, but given Let's Encrypt, the certificate is short lived and requires automation for updates. Doing az keyvault…
Jari Turkia
  • 1,184
  • 1
  • 21
  • 37
5
votes
2 answers

The 'Get-azVM' command was found in the module 'Az.Compute', but the module could not be loaded

I have used Az module in powershell script which is getting executed from powershell core but getting error while executing the script from application (.Net core SDK 2.1). $VMExistanceCheck = Get-azVM -ResourceGroupName $VMResourceGroup -Name …
SRoy
  • 61
  • 1
  • 1
  • 6
5
votes
3 answers

Get-AzureADPolicy : The term 'Get-AzureADPolicy' is not recognized

After connecting to Azure AD with Connect-AzureAD , If run the command Get-AzureADPolicy, PowerShell is prompting the message as "Get-AzureADPolicy : The term 'Get-AzureADPolicy' is not recognized"
5
votes
1 answer

Powershell Connect-AzureAD error "accessing_ws_metadata_exchange_failed"

I m writing a Powershell script where I need to connect to Azure Active Directory using code. If I connect through prompt it works fine but using code (providing user id and password in code) it throws the following error: Connect-AzureAD : One or…
user576510
  • 5,777
  • 20
  • 81
  • 144
5
votes
2 answers

How to run PowerShell from Azure Data Factory

I have PowerShell script which splits a complex CSV file to a smaller CSV file for every 1000 records. Here is the code: $i=0;Get-Content C:\Users\dell\Desktop\Powershell\Input\bigsizeFile.csv -ReadCount 1000 | %{$i++; $_ | Out-File…
5
votes
1 answer

Enable/Disable AppInsights Availability Tests with Powershell Azure ARM

Simple question, trying to use Powershell Azure ARM to Disable/Enable my Application Insights Availability Tests. We have scheduled reboots of our servers, and I want to black out those times so we don't record errors. I tried the following $alert…
5
votes
0 answers

Error: Could not find ADLA Account in any resource group - DataLakeStoreGen1

I am trying to check whether the DataLake Analytics account State is active or not with the below power shell script through Service Principal authentication. Application is given the access to datalake analytics account. And it is present in one of…
ravi kiran
  • 371
  • 1
  • 5
  • 17
5
votes
2 answers

Is it possible to recycle app pool for a Azure web app

Is it possible to recycle app pool for websites hosted in Azure Web app. Usually website hosted on a vm or as a web role we could create a powershell script which creates ps session and recycle the app pool. Is there a similar approach we can use…
kumar
  • 8,207
  • 20
  • 85
  • 176
5
votes
2 answers

How can I create an Azure policy that validates Resource Group Names

I am trying to create an Azure policy which I can assign at the subscription level, and control the naming of the resource groups in the subscription. Policies need to target a resource type or otherwise limit their application, else they apply…
Joon
  • 2,127
  • 1
  • 22
  • 40
5
votes
1 answer

"The Azure PowerShell session has not been properly initialized" error message in Octopus

I am trying to run the Get-AzureRmEventHubNamespaceKey cmdlet in an Azure Powershell step within Octopus. I am getting the following error: Get-AzureRmEventHubNamespaceKey : The Azure PowerShell session has not been properly …
5
votes
3 answers

Remove files and foldes on Azure before a new deploy from VSTS

As part of my build process in VSTS I want to delete all files and folders (except af few) from my azure site before a new deploy. My guess is, that using a Azure Powershell script would be a good idea and I would prefer making an inline script. I…
5
votes
3 answers

Azure Powershell - automating Login-AzureRmAccount AD Login - for Azure function

I have this Azure Powershell script, which successfully backs up a SQL Azure DB to Azure Blob. In its current form, it requires me to log in via AD. I now need to implement this script to execute via a Azure Function at specific intervals. The…
Peter PitLock
  • 1,823
  • 7
  • 34
  • 71