Azure / Azure/durabletask

Incompatibility between AzurePowerShell & DTF.ServiceBus

Aperta
#357 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
1.7k
Fork
335
Merge medio
2g 23h
PR unite (30g)
6

Descrizione

Hello,
Im facing an issue wih DTF.ServiceBus. Im working on a project where I use DTF to launch long running powershell tasks.
To do so, I use PowerShell SDK to run scripts directly from C#.
My script do use Azure PowerShell (https://github.com/Azure/azure-powershell) and adding DTF.ServiceBus to my project make Azure PowerShell fail.

To be more precise, one essential module of Azure PowerShell get kind of "corrupted" by DTF.ServiceBus.
It is the Az.Accounts module which initialize many things.

When adding DTF.ServiceBus, the module load into C# without problem BUT, all the commands from the module are not visible nor usable.
Removing DTF.ServiceBus make them work just fine.

For more details, you can take a look at the issue I opened in Azure Powershell project :
https://github.com/Azure/azure-powershell/issues/10680

My questions are, what is causing this ? How can I fix it ? Otherwise, what workaround can I use ?

Here is a sample where I included DTF.ServiceBus. If you run it, it will fail (error display and Get-Command does not return anything)
If you simply remove the reference to DTF.ServiceBus, it will display a success at the end and also display the available command in Az.Accounts.

[DemoAzPowershell.zip](https://github.com/Azure/durabletask/files/3987797/DemoAzPowershell.zip)

Thanks you

*edit*
When running both version (with and without DTF.ServiceBus) I notice some difference in the output console.

For the working version without DTF.ServiceBus, I can see those two DLL's loading while they are not loaded when using DTF.ServiceBus:

```
'DemoAzPowershell.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\WindowsPowerShell\Modules\Az.Accounts\1.6.4\NetCoreAssemblies\Microsoft.IdentityModel.Clients.ActiveDirectory.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'DemoAzPowershell.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\WindowsPowerShell\Modules\Az.Accounts\1.6.4\NetCoreAssemblies\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con DemoAzPowershell.zip e riproduci le due esecuzioni, con e senza DTF.ServiceBus. Confronta il caricamento degli assembly di Az.Accounts, in particolare Microsoft.IdentityModel.Clients.ActiveDirectory.dll e il relativo assembly Platform, quindi leggi la issue collegata di Azure PowerShell per individuare risultati correlati. Il lavoro è completato quando l’incompatibilità è isolata e viene documentato un fix o workaround.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, csharp, powershell
Ambito
backend, cloud, distributed-systems
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.