Background: our team has been using the Azure PowerShell pipeline task v3 for a while, with the Preferred Azure PowerShell Version pinned to 5.1.1. We use this pipeline task to deploy both ARM resources and classic resources so we need to be able to load both the ASM module and the ARM module in the same pipeline.
During this task we install and import AzureRM v6.13.1. Everything has been working for months but something changed in the last few days and we can no longer import AzureRM v6.13.1 in this task. The following error now appears when you try to import it:
_##[error]The following error occurred while loading the extended type data file: Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer": The TypeConverter was ignored because it already occurs.
Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer": The member SerializationDepth is already present.
Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache": The member PropertySerializationSet is already present.
Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.ProtectedFileTokenCache": The member SerializationMethod is already present.
Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache": The member PropertySerializationSet is already present.
Error in TypeData "Microsoft.Azure.Commands.Common.Authentication.AuthenticationStoreTokenCache": The member SerializationMethod is already present.
Error in TypeData "Microsoft.Azure.Commands.Profile.Models.PSAzureContext": The member SerializationDepth is already present.
Error in TypeData "Microsoft.Azure.Commands.Profile.Models.PSAzureProfile": The member SerializationDepth is already present._
The change we noticed is that this pipeline task used to pre-load v5.8.2 of AzureRM.Profile, but now it loads v5.8.3. This is impactful because now when you call Import-Module for AzureRM v6.13.1 it fails because that module requires v.5.8.2 of the AzureRM.Profile dependency-- but v5.8.3 is already loaded.
Two possible solutions:
Edit: I have also reported this issue at https://developercommunity.visualstudio.com/content/problem/582983/azure-powershell-task-v3-now-loads-an-incompatible.html, in case these issues here are for docs only, and not functionality.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@keithbabinec You're correct that this repo is for documentation issues only, but considering that this is a situation where something that has reliably worked has suddenly stopped working means that there may be a gap. Note: You can also try the Stack Overflow community
@RoopeshNair Could you take a look at this and provide any context that might help in addition to whatever is learned through the community?
Hi @RoopeshNair and @thomps23 -- I finally received word back from AzDo support that running a single pipeline script that authenticates to both Classic and RM authentication is not recommended. We had to rewrite some of our deployment code to make them two separate pipeline steps. One pipeline step just for Azure Classic resources, and one pipeline step just for Azure RM resources. That ultimately unblocked us and got a working CI again.
It doesn't seem like they are going to fix the incompatibility, so it should be advised somewhere that attempting to run them both in the same pipeline is either not recommended or not supported. If we had known that from the start we could have avoided this issue entirely. That warning would be a helpful addition to this doc.
https://github.com/microsoft/azure-pipelines-tasks/issues/7898 - tracked as part of this issue