Upgrading Azure Powershell to v4 - Import-AzureRmProfile does not work on v4 renamed to Import-AzureRmContext

Ashley's Avatar


06 Jun, 2017 07:00 AM

I noticed that appveyor agents have Azure powershell v3.7.0 installed.

I am using Azure Service principal and as of v3.8.0 the API azure has changed.

Save-AzureRmProfile is renamed to Save-AzureRmContext

Select-AzureRmProfile is renamed to Import-AzureRmContext

Is it possible to have Azure Powershell >= 3.8.0 installed on the agents. Also is there a temporary workaround to get me going? I am using 4.0.2 locally.

Some helpful links:

  1. Support Staff 1 Posted by Ilya Finkelshte... on 06 Jun, 2017 04:50 PM

    Ilya Finkelshteyn's Avatar

    Hi Ashley,

    Please watch this GitHub issue for long term solution.

    temporary workaround is pretty straightforward -- add the following script at install stage of your build:

    Write-Host "Installing Azure PowerShell ..." -ForegroundColor Cyan
    cmd /c start /wait webpicmd /Install /Products:"WindowsAzurePowershellGet" /AcceptEula
    Write-Host "Azure PowerShell installed" -ForegroundColor Green


  2. 2 Posted by Ashley on 07 Jun, 2017 12:26 AM

    Ashley's Avatar

    Thanks Ilya, will try this out. The github url seems to be the wrong one though.

  3. Support Staff 3 Posted by Ilya Finkelshte... on 07 Jun, 2017 02:56 PM

    Ilya Finkelshteyn's Avatar

    Sorry, updated GitHub URL.

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:17 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac