Azure-PowerShell-Snippets
Azure-PowerShell-Snippets copied to clipboard
AAD DLL provided is wrong version
The updated script in AADTool (Common.ps1) relies on a newer version of the AAD dll than that which is provided. Running script with old version leads to the following error: New-Object : Cannot find type [Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters]: verify that the assembly containing this type is loaded.
Same issue here!
Replacing the "Microsoft.IdentityModel.Clients.ActiveDirectory.dll" from the latest source below worked. https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/
Same issue here!
Replacing the "Microsoft.IdentityModel.Clients.ActiveDirectory.dll" from the latest source below worked. https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/
Then what change did you make in Common.ps1 to run it again successfully? Also which version of the dll did you use?
Tried the latest source from https://www.nuget.org/packages/Microsoft.IdentityModel.Clients.ActiveDirectory/
but still not working
Cannot find an overload for "AcquireTokenAsync" and the argument count: "4". At C:\Users\shz\Desktop\Azure-PowerShell-Snippets-master\Azure-PowerShell-Snippets-master\MicrosoftAzureServiceFabric-AADHelpers\AADTool\Common.ps1:36 char:5
-
$accessToken = $authenticationContext.AcquireTokenAsync($resource ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [], MethodException
- FullyQualifiedErrorId : MethodCountCouldNotFindBest
Invoke-RestMethod : {"odata.error":{"code":"Authentication_MissingOrMalformed","message":{"lang":"en","value":"Access Token missing or malformed."}}} At C:\Users\shz\Desktop\Azure-PowerShell-Snippets-master\Azure-PowerShell-Snippets-master\MicrosoftAzureServiceFabric-AADHelpers\AADTool\Common.ps1:46 char:13
-
return (Invoke-RestMethod $uri -Method $method -Headers $headers ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand