-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 2.18.0 broken - Method not found: error #2703
Comments
Hi @marckean thank you for reporting this issue. I successfully logged in after going through the reproduction steps. Kindly let me know which PowerShell version you are using. |
I am using version 2.17.0 now, whereas before using version 2.18.0 failed for me. I am running: if (-not(Get-Module -ListAvailable -Name Microsoft.Graph.Groups)) { Sign into the Microsoft Graph
Note, as this doesn't specify a required version, it pulls the latest version (2.18.0). So adding this: -RequiredVersion '2.17.0' gets me past this error. Also note, I am running this as an Azure Deployment Script resource which is executed using Bicep - for this, it spins up a container instance and runs the script. |
I'm experiencing same issue. Downgrading to v2.17 temporarily solves issue |
Same issue, downgrading to v2.17 is great workaround. My PS version info:
|
Could this be a PowerShell 5 problem? I have no issue connecting with a user provided access token and using the Groups module with PS 7.4.2 and SDK 2.18. |
@12Knocksinna I also have no issue connecting from PowerShell 5. |
I have the same issue. Error 1 Error 2 Error 3 |
As suggested by @marckean , @KnudsenMorten and @dp-h I have manually reverted all 3 modules from version 2.18.0 back down to version 2.17.0 in my Azure Automation Account and my runbooks complete OK without any errors/messages. If it assists anyone else having this issue in Azure Automation, to revert back to an older stable version:
|
I noticed that two versions of So, if you are executing any scripts in a PowerShell 5 environment, please revert to 2.18.0 for now as suggested by @marckean, @KnudsenMorten, @dp-h and @MainDBA. |
This seems to be the same type of issue as #2148
But when you flip the order of imports - things work
|
I noticed the Microsoft.Graph modules were updated to version 2.19.0 but this issue #2.18.0 was not included in the release notes - any updates on its progress please? |
I spotted Az 12.0.0 was made available earlier today (21/05) on the PowerShell Gallery so I ran my module update script and also moved my MS.Graph modules from [working] version 2.17.0 to 2.19.0 and my two affected automation accounts' runbooks have run OK, so, issue [for me] appears to be resolved. |
Describe the bug
I am running this:
if (-not(Get-Module -ListAvailable -Name Microsoft.Graph.Groups)) {
Install-Module -Name Microsoft.Graph.Groups -Scope CurrentUser -AllowClobber -Force
Import-Module -Name Microsoft.Graph.Groups
}
Sign into the Microsoft Graph
$resource = "https://graph.microsoft.com"
$token = (Get-AzAccessToken -TenantId $tenantID -ResourceUrl $resource).Token
Create a SecureString from the token
$SecureToken = ConvertTo-SecureString $token -AsPlainText -Force
Use the SecureString token to connect
Connect-MgGraph -AccessToken $SecureToken
But I get this error:
Method not found: 'Void Microsoft.Graph.Authentication.AzureIdentityAccessTokenProvider..ctor(Azure.Core.TokenCredential, System.String[], Microsoft.Kiota.Authentication.Azure.ObservabilityOptions, System.String[])'.
Expected behavior
I should get something like this:
Welcome to Microsoft Graph!
Connected via userprovidedaccesstoken access using c288694f-2e16-4c20-928d-c262d8008520
How to reproduce
It's due to the latest Microsoft.Graph.Groups module that's just been released version 2.18.0- https://www.powershellgallery.com/packages/Microsoft.Graph.Groups/2.18.0
Running this instead in my script, to force it to use the previous version 2.17.0, it works:
if (-not(Get-Module -ListAvailable -Name Microsoft.Graph.Groups)) {
Install-Module -Name Microsoft.Graph.Groups -RequiredVersion '2.17.0' -Scope CurrentUser -AllowClobber -Force
Import-Module -Name Microsoft.Graph.Groups
}
SDK Version
2.18.0
Latest version known to work for scenario above?
2.17.0
Known Workarounds
Go back to the last known working version:
if (-not(Get-Module -ListAvailable -Name Microsoft.Graph.Groups)) {
Install-Module -Name Microsoft.Graph.Groups -RequiredVersion '2.17.0' -Scope CurrentUser -AllowClobber -Force
Import-Module -Name Microsoft.Graph.Groups
}
Debug output
Click to expand log
```The text was updated successfully, but these errors were encountered: