Azure / Azure/azure-powershell
Az.Accounts=5.5.1 has missing dependencies
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
The latest version of `Az.Accounts` module ships without some of the required libraries. Any attempt to authenticate fails due to missing libraries. Any attempt to use a module that depends on `Az.Accounts=5.5.1` fails as well.
The issue does not occur when loading `Az.Accounts=5.5.0` and modules that depend on that version.
### Issue script & Debug output
```PowerShell
❯ Get-AzStorageAccount
Get-AzStorageAccount: Your Azure credentials have not been set up or have expired, please run Connect-AzAccount to set up your Azure credentials.
SharedTokenCacheCredential authentication failed: Unable to load shared library 'msalruntime' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/home/user/.local/opt/pwsh-v7.6.3/msalruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/msalruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/libmsalruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/msalruntime: cannot open shared object file: No such file or directory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/msalruntime: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime: cannot open shared object file: No such file or directory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/libmsalruntime: cannot open shared object file: No such file or directory
See https://aka.ms/msal-net-wam#troubleshooting
```
### Environment data
```PowerShell
❯ $PSVersionTable
Name Value
---- -----
PSVersion 7.6.3
PSEdition Core
GitCommitId 7.6.3
OS KDE neon User Edition
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```
### Module versions
```PowerShell
❯ get-module Az* | Select ModuleType,Version,Prefix,Name
ModuleType Version Prefix Name
---------- ------- ------ ----
Script 5.5.1 Az.Accounts
Script 9.7.1 Az.Storage
```
### Error output
```PowerShell
❯ Resolve-AzError
HistoryId: 1
Message : Your Azure credentials have not been set up or have expired, please run Connect-AzAccount to set up yo
ur Azure credentials.
SharedTokenCacheCredential authentication failed: Unable to load shared library 'msalruntime' or one o
f its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If
you're using glibc, consider setting the LD_DEBUG environment variable:
/home/user/.local/opt/pwsh-v7.6.3/msalruntime.so: cannot open shared object file: No such file or di
rectory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/ms
alruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime.so: cannot open shared object file: No such file or
directory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/li
bmsalruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/msalruntime: cannot open shared object file: No such file or direc
tory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/ms
alruntime: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime: cannot open shared object file: No such file or di
rectory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/li
bmsalruntime: cannot open shared object file: No such file or directory
See https://aka.ms/msal-net-wam#troubleshooting
StackTrace : at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.GetServiceClientC
redentials(IAzureContext context, String targetEndpoint, String resourceId, ICmdletContext cmdletConte
xt)
at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.GetServiceClientC
redentials(IAzureContext context, String targetEndpoint, ICmdletContext cmdletContext)
at Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory.CreateArmClient[TClient](
IAzureContext context, String endpoint, ICmdletContext cmdletContext)
at Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory.CreateArmClient[TClient](
IAzureContext context, String endpoint)
at Microsoft.Azure.Commands.Management.Storage.StorageManagementClientWrapper..ctor(IAzureContext c
ontext)
at Microsoft.Azure.Commands.Management.Storage.StorageAccountBaseCmdlet.get_StorageClient()
at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet()
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.<>c__3`1.b__3_0(T c)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T]
(T cmdlet, Action`1 executor)
at Microsoft.WindowsAzure.Commands.Utilities.Common.CmdletExtensions.ExecuteSynchronouslyOrAsJob[T]
(T cmdlet)
at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception : Microsoft.Azure.Commands.Common.Exceptions.AzPSArgumentException
InvocationInfo : {Get-AzStorageAccount}
Line : Get-azstorageaccount
Position : At line:1 char:1
+ Get-azstorageaccount
+ ~~~~~~~~~~~~~~~~~~~~
HistoryId : 1
Message : SharedTokenCacheCredential authentication failed: Unable to load shared library 'msalruntime' or one o
f its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If
you're using glibc, consider setting the LD_DEBUG environment variable:
/home/user/.local/opt/pwsh-v7.6.3/msalruntime.so: cannot open shared object file: No such file or di
rectory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/ms
alruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime.so: cannot open shared object file: No such file or
directory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/li
bmsalruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/msalruntime: cannot open shared object file: No such file or direc
tory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/ms
alruntime: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime: cannot open shared object file: No such file or di
rectory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/li
bmsalruntime: cannot open shared object file: No such file or directory
See https://aka.ms/msal-net-wam#troubleshooting
StackTrace : at Azure.Identity.CredentialDiagnosticScope.FailWrapAndThrow(Exception ex, String additionalMessage
, Boolean isCredentialUnavailable)
at Azure.Identity.SharedTokenCacheCredential.GetTokenImplAsync(Boolean async, TokenRequestContext r
equestContext, CancellationToken cancellationToken)
at Azure.Identity.SharedTokenCacheCredential.GetTokenAsync(TokenRequestContext requestContext, Canc
ellationToken cancellationToken)
at Microsoft.Azure.PowerShell.Authenticators.MsalAccessToken.GetAccessTokenAsync(String callerClass
Name, String parametersLog, TokenCredential tokenCredential, TokenRequestContext requestContext, Cance
llationToken cancellationToken, String tenantId, String userId, String homeAccountId)
at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.Authenticate(IAzu
reAccount account, IAzureEnvironment environment, String tenant, SecureString password, String promptB
ehavior, Action`1 promptAction, IDictionary`2 optionalParameters)
at Microsoft.Azure.Commands.Common.Authentication.Factories.AuthenticationFactory.GetServiceClientC
redentials(IAzureContext context, String targetEndpoint, String resourceId, ICmdletContext cmdletConte
xt)
Exception : Azure.Identity.AuthenticationFailedException
InvocationInfo : {Get-AzStorageAccount}
Line : Get-azstorageaccount
Position : At line:1 char:1
+ Get-azstorageaccount
+ ~~~~~~~~~~~~~~~~~~~~
HistoryId : 1
Message : Unable to load shared library 'msalruntime' or one of its dependencies. In order to help diagnose load
ing problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG
environment variable:
/home/user/.local/opt/pwsh-v7.6.3/msalruntime.so: cannot open shared object file: No such file or di
rectory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/ms
alruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime.so: cannot open shared object file: No such file or
directory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/li
bmsalruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/msalruntime: cannot open shared object file: No such file or direc
tory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/ms
alruntime: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime: cannot open shared object file: No such file or di
rectory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/li
bmsalruntime: cannot open shared object file: No such file or directory
See https://aka.ms/msal-net-wam#troubleshooting
StackTrace : at Microsoft.Identity.Client.Platforms.Features.RuntimeBroker.RuntimeBroker.<>c.<.cctor>b__26_0()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultCons
tructor)
at System.Lazy`1.CreateValue()
at Microsoft.Identity.Client.Platforms.Features.RuntimeBroker.RuntimeBroker.IsBrokerInstalledAndInv
okable(AuthorityType authorityType)
at Microsoft.Identity.Client.ClientApplicationBase.GetAccountsFromBrokerAsync(String homeAccountIdF
ilter, ICacheSessionManager cacheSessionManager, CancellationToken cancellationToken)
at Microsoft.Identity.Client.ClientApplicationBase.GetAccountsInternalAsync(ApiIds apiId, String ho
meAccountIdFilter, CancellationToken cancellationToken)
at Azure.Identity.MsalPublicClient.GetAccountsAsync(IPublicClientApplication client, Boolean async)
at Azure.Identity.MsalPublicClient.GetAccountsCoreAsync(Boolean async, Boolean enableCae, Cancellat
ionToken cancellationToken)
at Azure.Identity.MsalPublicClient.GetAccountsAsync(Boolean async, Boolean enableCae, CancellationT
oken cancellationToken)
at Azure.Identity.SharedTokenCacheCredential.GetAccountAsync(String tenantId, Boolean enableCae, Bo
olean async, CancellationToken cancellationToken)
at Azure.Identity.SharedTokenCacheCredential.GetTokenImplAsync(Boolean async, TokenRequestContext r
equestContext, CancellationToken cancellationToken)
Exception : Microsoft.Identity.Client.MsalClientException
InvocationInfo : {Get-AzStorageAccount}
Line : Get-azstorageaccount
Position : At line:1 char:1
+ Get-azstorageaccount
+ ~~~~~~~~~~~~~~~~~~~~
HistoryId : 1
Message : Unable to load shared library 'msalruntime' or one of its dependencies. In order to help diagnose load
ing problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG
environment variable:
/home/user/.local/opt/pwsh-v7.6.3/msalruntime.so: cannot open shared object file: No such file or di
rectory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/ms
alruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime.so: cannot open shared object file: No such file or
directory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/li
bmsalruntime.so: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/msalruntime: cannot open shared object file: No such file or direc
tory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/ms
alruntime: cannot open shared object file: No such file or directory
/home/user/.local/opt/pwsh-v7.6.3/libmsalruntime: cannot open shared object file: No such file or di
rectory
/home/user/.local/share/powershell/Modules/Az.Accounts/5.5.1/StartupScripts/../lib/netstandard2.0/li
bmsalruntime: cannot open shared object file: No such file or directory
StackTrace : at Microsoft.Identity.Client.NativeInterop.API.x64.MSALRUNTIME_Startup()
at Microsoft.Identity.Client.NativeInterop.API.x64.Startup()
at Microsoft.Identity.Client.NativeInterop.Module.AddRefImpl(String handleName, Boolean isHandle)
at Microsoft.Identity.Client.NativeInterop.Module.Startup(String moduleName)
at Microsoft.Identity.Client.NativeInterop.Core..ctor()
at Microsoft.Identity.Client.Platforms.Features.RuntimeBroker.RuntimeBroker.<>c.<.cctor>b__26_0()
Exception : System.DllNotFoundException
InvocationInfo : {Get-AzStorageAccount}
Line : Get-azstorageaccount
Position : At line:1 char:1
+ Get-azstorageaccount
+ ~~~~~~~~~~~~~~~~~~~~
HistoryId : 1
```
Contributor guide
Research direction
Reproduce the failure with Get-AzStorageAccount under Az.Accounts 5.5.1, then compare the installed module contents and dependencies with version 5.5.0. Confirm the fix when authentication and dependent modules work without the missing msalruntime library error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- authentication, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100