runner-images icon indicating copy to clipboard operation
runner-images copied to clipboard

[Ubuntu, Windows] Az Powershell module will be updated to v11.3.1 on March 18

Open mikhailkoliada opened this issue 2 years ago • 1 comments

Breaking changes

Pre-installed Az powershell module on Ubuntu & Windows will be updated to v11.3.1.

Target date

The image rollout process will be started on March 18th and take 3-4 days.

The motivation for the changes

We want to provide a more recent version preinstalled.

Possible impact

If you use direct invocations of Az cmdlets they might be incompatible between major versions of the module so you may need to downgrade your version if it affects your pipeline in workflows unexpected way, we from our side unlikely to help with the code adoption to the new version and most likely all the reports to the runner-images repo will be marked as external and later closed.

Platforms affected

  • [X] Azure DevOps
  • [X] GitHub Actions

Runner images affected

  • [X] Ubuntu 20.04
  • [X] Ubuntu 22.04
  • [ ] macOS 11
  • [ ] macOS 12
  • [ ] macOS 13
  • [ ] macOS 13 Arm64
  • [ ] macOS 14
  • [ ] macOS 14 Arm64
  • [X] Windows Server 2019
  • [X] Windows Server 2022

Mitigation ways

GitHub:

Use the azure/powershell action, it lets you to specify a module version you would like using by passing the azPSVersion parameter.

Actions:

Use the AzurePowershell@5 Azure DevOps task to specify a desired version

mikhailkoliada avatar Mar 04 '24 13:03 mikhailkoliada

Love it

JADSKTPSVR avatar Mar 10 '24 08:03 JADSKTPSVR

Deployed

mikhailkoliada avatar Mar 20 '24 23:03 mikhailkoliada

hey @mikhailkoliada , there is an issue with 11.3.1 which is fixed in 11.4.0. are we able to pin the new version to be pre-installed in the agents instead of 11.3.1 ??

its related to using what-if flag in deployments and causing failures in pipelines using ubuntu and windows agent images, issue is also mentioned here --> https://github.com/Azure/bicep/issues/12112

d3vinda avatar Mar 27 '24 03:03 d3vinda

"Actions:

Use the AzurePowershell@5 Azure DevOps task to specify a desired version"

how to set desired version of Az module? from the link I understand that its the version of Powershell but not of the Az modules how to downgrade Az module on the MS hosted agents? Thanks

chromebohemian448 avatar Mar 28 '24 10:03 chromebohemian448

@chromebohemian448 , used below to install a specific version of Azure PowerShell.

image

azurePowerShellVersion: "OtherVersion"
preferredAzurePowerShellVersion: "11.4.0"

Problem with this approach is that it takes time to install Az modules after a new agent is allocated when running the pipeline using Microsoft hosted agents. It also adds additional time if you have parallel stages since you'll be allocated a new agent/s I believe for a parallel stage/s in your pipeline.

Was hoping versions pinned to *-latest images are patched regularly when issues are identified.
--> https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md --> https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md image

References: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-powershell-v5?view=azure-pipelines https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml#software

cc: @mikhailkoliada

d3vinda avatar Mar 30 '24 10:03 d3vinda

So I am experiencing an issue with our build pipeline last seen to work on the 21st March - now fails, no code changes.

The 'New-AzSubscriptionDeployment' command was found in the module 'Az.Resources', but the module could not be loaded due to the following error: [Assembly with same name is already loaded] For more information, run 'Import-Module Az.Resources'.

We are running New-AzSubscriptionDeployment inside a powershell script that runs from AzurePowerShell@5.

Have tried azurePowerShellVersion: OtherVersion preferredAzurePowerShellVersion: 9.3.0

Which i think seems to line up with the previous version - and i still get the same error.

I tried changing the ubuntu image too (mainly because I got confused as to when the definition of 'latest' had changed) but i get the same message for pinned ubuntu-20.04

What is odd if there is very little 'out there' about this error.

if I do as it suggests I get

image

Anyone help?

clRecruitment21 avatar Apr 15 '24 11:04 clRecruitment21

If i do that, I am back to the highlighted error.

image

I added the import because the error said to try it... but it sheds no light what-so-ever.

I am stumbling around to try and understand what might have changed with the 'ubuntu-latest' which last ran successfully on the 21st March.

Looking further at this you can see the image versions etc here:

WORKED image

DOESN'T image

clRecruitment21 avatar Apr 15 '24 11:04 clRecruitment21

it may be relevent it may not.. but notice that the image AzurePowerShell version has changed.

clRecruitment21 avatar Apr 15 '24 12:04 clRecruitment21

If i compare the 'included software' between the two reported urls OLD: https://github.com/actions/runner-images/blob/ubuntu22/20240317.1/images/ubuntu/Ubuntu2204-Readme.md?plain=1

NEW: https://github.com/actions/runner-images/blob/ubuntu22/20240407.1/images/ubuntu/Ubuntu2204-Readme.md?plain=1

You can see an announcement "Az Powershell module will be updated to v11.3.1" however across both versions new and old it is/already 11.3.1

and the link it refers to is here...

clRecruitment21 avatar Apr 15 '24 12:04 clRecruitment21

So @chromebohemian448's message appears to have disappeared.. you were asking me to remove the 'import' I'd added as the error advised. See my findings.

However, I have noticed that in the same time window an awesome package we use 'RegionOrebroLan.Transforming' had changed a version number, and reverting this back - our error disappears.

I have no idea at this stage what they could have changed, but the thrust of my investigation goes that way now.

@jonathh21

clRecruitment21 avatar Apr 15 '24 18:04 clRecruitment21