-
Notifications
You must be signed in to change notification settings - Fork 525
Missing or incomaptible module version. #317
Comments
Hello @ranabanerjee15 , Change the line 26 from After this, import the module againg and write your actual UPN when the code ask. With this, everything works. I used Az.Account 1.9.5 version. For the version 2.2.1 the field TokenCache it's missing, so I highly recommend use the module on version 1.9.5 Try for yourself! Hello @Vikram1988, I didn't find any way to get the current user, maybe you know a way for this cases. Thanks! |
@shoootyou , your analysis about TokenCache missing for the latest Az.Account version is correct as found here: Azure/azure-powershell#13337 While it is recommended even in this thread to use the lower version of 1.9.5, I am working towards the changes required in AzMig_Dependencies.psm1 with the dev team. |
I have made some edits to the module AzMig_Dependencies.psm1 and tested it with PowerShell 5.1 and Cloud Shell. PFA the module (renamed as .txt), rename the extension to .psm1 and import the module and try running the following cmdlet again: Get-AzMigDependenciesAgentless. Please let me know if you continue to hit the issue. |
Hi Team, However our cx updated to version 2.2.1 but still have same issue, please reopen to check: for further use. To select another subscription, use Set-AzContext. 11/26/2020 5:49:09 AM Output 1 - Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext 11/26/2020 5:49:09 AM Error You cannot call a method on a null-valued expression. At line:69 char:1
11/26/2020 5:49:10 AM Error Cannot index into a null array. At line:70 char:1
|
Closing this issue based on the response from @MSNina123456. @ranabanerjee15 if you still experience problems, let us know and we'll reopen this issue. |
?? I mentioned the issue should be fixed, but it still persists, could you please check my update with error message again? Thanks |
I got possible solution: TokenCache is removed from the updated Az.Accounts, you should use Get-AzAccessToken in the script |
Getting the following error while executing Get-AzMigDependenciesAgentless
I have tried running in Version 5.1 Powershell 7.1, both have the same error

Az.Accounts version is 2.2.1
On further investigation found that
$TokenCache = $CurrentContext.TokenCache in the function function GetRequestProperties() is null. I have tried with Az module 1.9.5 still no luck. my scenario is B2B. I am assuming this should work regardless
maybe Get-AzAccessToken can be used to make it compatible
Is there any other way to extract this data? am keen to use the Bi template
hope for a fix soon, Plz Help
The text was updated successfully, but these errors were encountered: