Azure / Azure/azure-powershell

Az.Accounts 5.3.2 and 5.3.3 fail to work with PS 5.1 in Azure Automation runbook

Open
#29,276 4 comments 3 reactions 1 assignee Claimed by @isra-fel View on GitHub
Accounts act-identity-squad assembly-conflict bug Possible-Solution Similar-Issue
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

### Description

Connect-Az.Accounts fails in PS 5.1 with Az.Accounts 5.3.2 or 5.3.3 for cloud jobs

Connect-AzAccount : Method 'GetTokenAsync' in type 'Azure.Identity.ManagedIdentityCredential' from assembly 'Azure.Identity, Version=1.13.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' does not have an implementation. At line:5 char:1 + Connect-AzAccount -Identity + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Connect-AzAccount], TypeLoadException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Profile.ConnectAzureRmAccountCommand

The issue is reproduceable with Az.Accounts 5.3.2 and 5.3.3, same command works well with PS 7.4 in same Automation account

### Issue script & Debug output

```PowerShell
Directory: C:\usr\src\PSModules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 5.3.3 Az.Accounts {Disable-AzDataCollection, Disable-AzContextAutosave, Enabl...

Directory: C:\AzAt\Modules\11.2.0

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 2.15.0 Az.Accounts {Disable-AzDataCollection, Disable-AzContextAutosave, Enabl...

Directory: C:\usr\src\PSModules

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 9.6.0 Az.Storage {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountMan...

Directory: C:\AzAt\Modules\11.2.0

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 6.1.0 Az.Storage {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountMan...

Name Value
---- -----
PSVersion 5.1.17763.8385
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.8385
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Mode : Process
ContextDirectory : None
ContextFile : None
CacheDirectory : None
CacheFile : None
KeyStoreFile : None
Settings : {[InstallationId, **]}
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 5.1.17763.8385
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.8385
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

### Module versions

```PowerShell
Az.Accounts 5.3.3 or 5.3.2
```

### Error output

```PowerShell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.