-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
The 'Connect-AzAccount' command was found in the module 'Az.Accounts', but the module could not be loaded. #13145
Comments
@sgiovinetti Can you please try the following to get some mroe detail on the error:
|
@markcowl Tried your commands I receive this error:
Maybe is this issue? https://devblogs.microsoft.com/powershell/resolving-powershell-module-assembly-dependency-conflicts/#solving-the-issue-in-powershell-itself How can I solve it? |
@dingmeng-xue let's investigate further |
@dingmeng-xue I probably discover the origin. The error is related with the VSCode PowerShell extension in fact running the same commands with the extension disabled work fine. I opened an issue also in the VSCode PowerShell extension repository Issue 3012 |
Related issue: PowerShell/vscode-powershell#3012 |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
I'm having the same issue. Any updates would be appreciated! |
@austica the updates are in the related issue in the vscode-powershell repo indicated above. |
Restarting VSCode resolved this issue for me |
I also had the same issue. ran this command and it resolved. |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
Yup this seems to work. please note to run this you need to run VScode with administrator privileges. |
Hit the same issue with a fresh, first-time install of VS Code, the PowerShell extension, and the latest Azure PowerShell module. Upon further exploration, I thought maybe the conflict was due to having both the Az and AzureRM modules loaded. There is an explicit warning about this being unsupported when you run Connect-AzAccount and the like. I ran |
@changov , please create a new issue to provide environment information to us. You need to share the module installed on PowerShell, and debug message. Close current issue now. |
@dcaro 2022-01-06, I'm in Windows 10 / VSC 1.63, PS v 7.2, all up to date. Ran following as @markcowl suggested, see below screeen Ran the command in one line:
Shut down VSC and restarted as Admin, still the same. |
Worked! Run: Summary: Install Required Modules: Before loading the AzFilesHybrid module, ensure that you have the necessary modules installed. In this case, you need the Az.Network module. You can install the Az.Network module using the following command: Install-Module -Name Az.Network -Force -AllowClobber Load Modules in the Correct Order: Modules should be loaded in the correct order to resolve dependencies. First, load the Az.Network module and then load the AzFilesHybrid module: Import-Module -Name Az.Network -Global -ErrorAction Stop Run Your Desired Command: After loading the modules successfully, you can run the Join-AzStorageAccount cmdlet or any other cmdlets from the AzFilesHybrid module as needed. |
Description
In VSCode terminal I'm unable to run any Az commands. They all end up with error
The Az* command was found in the module 'Az.Accounts', but the module could not be loaded.
Same commands in a standalone cmd windows seem to work fine even though I compared the 2 sessions (cmd and VSCode) and apart from ms-vscode.powershell-2020.6.0\modules the same modules seems to be installed on both.
Environment data
Here the details of pwsh in VSCode
The text was updated successfully, but these errors were encountered: