Skip to content

🪲 Entra Module Fails to Load in Azure Automation 5.1 Runbooks #1513

@CATgwalker

Description

@CATgwalker

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions