Skip to content

🪲 Bug report - Az.Storage and ExchangeOnlineManagement with Get-EXO cmdlets #174

@a-nicholls

Description

@a-nicholls

Description

Trying to connect Az.Storage and ExchangeOnlineManagement together in Azure Runbook running PowerShell 7.6, as soon as you use a Get-EXO cmdlet like Get-EXOMailbox it returns a DLL related error

Expected Behavior

The cmdlet should just work with the help of your module

Current Behavior

Currently tested with PowerShell 7.4 and 7.6 in Azure Runbook with ExchangeOnlineManagement 3.9.0 and 3.9.2 with Az.Storage 9.6.0. (with other Az modules)
connecting to Azure Storage first then using Connect-ExchangeOnline,
it's when I run Get-EXOMailbox that it comes up with the error

Could not load file or assembly 'Microsoft.OData.Core, Version=7.22.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (0x80131621)

This explains the situation;
Azure/azure-powershell#14416
now I've tried the workaround by randomnote1 Oct 25, 2024
Azure/azure-powershell#14416 (comment)
and that has worked, albeit with having to overwrite files and creating a customised Az.Storage module with the dll files from ExchangeOnlineManagement.

Possible Solution

Is it possible for this module to workaround this issue wihtout having to use a customised Az.Storage module?

Steps to Reproduce

Create runbook environment with Az.Storage 9.6.0 and ExchangeOnlineManagement 3.9.0/3.9.2 modules as above

Import-Module DLLPickle
Import-DPLibrary

import-module Az.Storage
import-module ExchangeOnlineManagement

Connect-ExchangeOnline -ManagedIdentity -Organization $TenantName
Get-EXOMailbox

Context (Environment)

I'm trying to be able to export mailbox details and perform actions upon them, but also need to save results hence why I need to use the Az.Storage component with a Managed System Identity.

Note I'm testing this within an Azure RunBook

  • Operating System and version as reported by $PSVersionTable.OS: Microsoft Windows 10.0.20348
  • PowerShell versions as reported by $PSVersionTable.PSEdition: Core

Metadata

Metadata

Assignees

Labels

blockedBlocked by another party, such as Microsoft's PowerShell modules or other dependencies.bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions