DevScope/powerbi-powershell-modules

Microsoft.IdentityModel.Clients.ActiveDirectory.dll is downloaded when not available

Stijnc opened this issue · 2 comments

The function 'Get-PBIAuthToken' calls the function 'Ensure-ActiveDirectoryDll' to download Microsoft.IdentityModel.Clients.ActiveDirectory.dll if it is not available.

This poses an issue when you want to use this module in Azure automation or any other sandboxed environment.

Basically there are 3 options:

  1. include the Microsoft.IdentityModel.Clients.ActiveDirectory.dll in the module and load it using the manifest and make minor modifications to 'Get-PBIAuthToken'
  2. or use the existing https://github.com/tiander/OMSsearchAPI AzureActiveDirectory module published by @Tiander (written by @eamonoreilly). But then a couple of functions needs to be re-written as 'Get-PBIAuthToken' returns the token and reconstructs the header using 'Get-PowerBIRequestHeader' whereas the 'Get-AzureADtoken' function in the AzureActiveDirectory module already includes the bearer.
    Note that the 'Get-AzureADtoken' function also has the clientID set to a fixed guide and does not allow it to be set using the ADcredential parameterset, so this function will need some rework as well

I want to demo this module at the ExpertsLive.nl event, so how do we proceed?
Can I create a pull request to make the needed changes? What do you prefer?
Personally (since the AzureActiveDirectory module is not published in its own repo, I would choose option 1)

Thanks,
Stijn

Hi Stijnc, sorry for the late reply...

Yes I agree with you in the option 1 but I dont now the OMSearchAPI module.

You are free to demo & use this module in any way you want, and any pull request to help me evolve this module is more than welcome!

Thanks

the dll is now included into the module.