Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

MSAL.PS in Azure Automation with 7.2 Runbook #65

Open
Jakke2440 opened this issue Apr 7, 2023 · 0 comments
Open

MSAL.PS in Azure Automation with 7.2 Runbook #65

Jakke2440 opened this issue Apr 7, 2023 · 0 comments

Comments

@Jakke2440
Copy link

Jakke2440 commented Apr 7, 2023

I get an error when importing the module and a few more when requesting and Token

import-module MSAL.PS
--------------------------------------------------------------------------------------------
Join-Path: C:\usr\src\PSModules\MSAL.PS\internal\Import-Config.ps1:21
Line |
  21 |  … = Join-Path ([System.Environment]::GetFolderPath([System.Environment+ …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'Path' because it is an empty string.


Join-Path: C:\usr\src\PSModules\MSAL.PS\internal\Import-Config.ps1:22
Line |
  22 |          $Path = Join-Path $AppDataDirectory $Path
     |                            ~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'Path' because it is null.
--------------------------------------------------------------------------------------------
Get-Msaltoken -ClientId $clientId -tenantid $tenantID -UserCredential $Cred

--->> I need to use usercredential because I want to assign an Label to a Group
--------------------------------------------------------------------------------------------
New-MsalClientApplication: C:\usr\src\PSModules\MSAL.PS\Select-MsalClientApplication.ps1:56
Line |
  56 |  … plication = New-MsalClientApplication -ErrorAction Stop @paramNewMsal …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "Build" with "0" argument(s): "Error: ClientId is not a GUID. "


PropertyNotFoundException: C:\usr\src\PSModules\MSAL.PS\Select-MsalClientApplication.ps1:88
Line |
  88 |          Write-Debug ('Adding Application with ClientId [{0}] and Redi …
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The property 'AppConfig' cannot be found on this object. Verify that the property exists.


Add-MsalClientApplication: C:\usr\src\PSModules\MSAL.PS\Select-MsalClientApplication.ps1:89
Line |
  89 |          Add-MsalClientApplication $ClientApplication
     |                                    ~~~~~~~~~~~~~~~~~~
     | Cannot bind argument to parameter 'PublicClientApplication' because it is null.


InvalidOperation: C:\usr\src\PSModules\MSAL.PS\Get-MsalToken.ps1:252
Line |
 252 |  …             $AquireTokenParameters = $PublicClientApplication.Acquire …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.


InvalidOperation: C:\usr\src\PSModules\MSAL.PS\Get-MsalToken.ps1:338
Line |
 338 |  …            elseif ($TenantId) { [void] $AquireTokenParameters.WithAut …
     |                                           ~~~~~~~~~~~~~~~~~~~~~~
     | The variable '$AquireTokenParameters' cannot be retrieved because it has not been set.


PropertyNotFoundException: C:\usr\src\PSModules\MSAL.PS\Get-MsalToken.ps1:343
Line |
 343 |  …             Write-Debug ('Aquiring Token for Application with ClientI …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The property 'ClientId' cannot be found on this object. Verify that the property exists.


InvalidOperation: C:\usr\src\PSModules\MSAL.PS\Get-MsalToken.ps1:385
Line |
 385 |  … lureAuthenticationError' -TargetObject $AquireTokenParameters -ErrorA …
     |                                           ~~~~~~~~~~~~~~~~~~~~~~
     | The variable '$AquireTokenParameters' cannot be retrieved because it has not been set.
--------------------------------------------------------------------------------------------

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant