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

Ashley's Avatar

Ashley

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:
https://arcanecode.com/2017/04/19/what-happened-to-save-azurermprof...
https://github.com/Azure/azure-powershell/releases

  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
    

    Ilya

  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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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