microsoftgraph / microsoftgraph/entra-powershell

🪲 Entra Module Fails to Load in Azure Automation 5.1 Runbooks

Open
#1,513 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Investigating ToTriage
Dominant language
PowerShell
Stars
213
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Thanks for reporting the bug. Please ensure you've gone through the following checklist before opening an issue:

  • Make sure you can reproduce this issue using the latest released version of Microsoft.Entra or Microsoft.Entra.Beta.
  • Please search the existing issues to see if there has been a similar issue filed.

Describe the bug

Azure Automation runbooks running in Azure (through containerization) frequently fail to start and execute *-Entra commands due to error 'System.Threading.ThreadStartException: Thread failed to start. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.'

To Reproduce

Steps to reproduce the behavior:

  1. Create an Azure Automation runbook.
  2. Connect to Entra and run Entra commands such as Get-EntraUser or Set-EntraUserLicense

Expected behavior

The runbook executes successfully.

Module Version

This has occurred since we started using the module as of 1.0.6 and continues today up to 1.0.10

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.0.10      Microsoft.Entra                     Enable-EntraAzureADAlias
Script     1.0.10      Microsoft.Entra.Applications        {Add-EntraApplicationOwner, Add-EntraServicePrincipalDeleg...
Script     1.0.10      Microsoft.Entra.Authentication      {Add-EntraEnvironment, Connect-Entra, Disconnect-Entra, Fi...
Script     1.0.10      Microsoft.Entra.CertificateBased... {Get-EntraUserCBAAuthorizationInfo, Get-EntraUserCertifica...
Script     1.0.10      Microsoft.Entra.DirectoryManagement {Add-EntraAdministrativeUnitMember, Add-EntraCustomSecurit...
Script     1.0.10      Microsoft.Entra.Governance          {Get-EntraDirectoryRoleAssignment, Get-EntraDirectoryRoleD...
Script     1.0.10      Microsoft.Entra.Groups              {Add-EntraGroupMember, Add-EntraGroupOwner, Add-EntraLifec...
Script     1.0.10      Microsoft.Entra.Reports             {Get-EntraAuditDirectoryLog, Get-EntraAuditSignInLog, Get-...
Script     1.0.10      Microsoft.Entra.SignIns             {Get-EntraAuthorizationPolicy, Get-EntraConditionalAccessP...
Script     1.0.10      Microsoft.Entra.Users               {Get-EntraDeletedUser, Get-EntraUnsupportedCommand, Get-En...

Environment Data

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

Additional context

This same error is sometimes observed when executing the runbook on a hybrid worker.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified. Reproduce the failure in an Azure Automation runbook using PowerShell 5.1 and Microsoft.Entra 1.0.10, then compare it with execution on a hybrid worker while investigating the module-loading OutOfMemoryException. Done means the runbook starts and executes commands such as Get-EntraUser or Set-EntraUserLicense without the startup failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.