Closed peppekerstens closed 4 years ago
@erich-wang Would you please help to look at the Azure.Core load issue?
@peppekerstens After the issue happen, would you please run "Get-module | ft path" to see which modules are already loaded, and show us the result?
'clean'/new 7.0.3
C:\Users\peppe> get-module | ft path
Path
----
C:\Program Files\PowerShell\7\Microsoft.Management.Infrastructure.CimCmdlets.dll
C:\program files\powershell\7\Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1
C:\program files\powershell\7\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\posh-git\0.7.3\posh-git.psm1
C:\program files\powershell\7\Modules\PSReadLine\PSReadLine.psm1
C:\Users\peppe> import-module az -requiredversion 4.6.0
Import-Module: C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Storage\2.5.0\Az.Storage.psm1:113
Line |
113 | Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azu …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Azure.Core, Version=1.3.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.
C:\Users\peppe> get-module | ft path
Path
----
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\az\4.6.0\Az.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Accounts\2.0.1\Az.Accounts.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Advisor\1.1.1\Az.Advisor.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Aks\1.2.0\Az.Aks.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.AnalysisServices\1.1.4\Az.AnalysisServices.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ApiManagement\2.1.0\Az.ApiManagement.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ApplicationInsights\1.1.0\Az.ApplicationInsights.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Automation\1.4.0\Az.Automation.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Batch\3.1.0\Az.Batch.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Billing\1.0.3\Az.Billing.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Cdn\1.4.3\Az.Cdn.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.CognitiveServices\1.5.1\Az.CognitiveServices.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Compute\4.3.0\Az.Compute.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ContainerInstance\1.0.3\Az.ContainerInstance.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ContainerRegistry\1.1.1\Az.ContainerRegistry.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataBoxEdge\1.1.0\Az.DataBoxEdge.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataFactory\1.10.0\Az.DataFactory.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataLakeAnalytics\1.0.2\Az.DataLakeAnalytics.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataLakeStore\1.2.8\Az.DataLakeStore.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataShare\1.0.0\Az.DataShare.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DeploymentManager\1.1.0\Az.DeploymentManager.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DesktopVirtualization\1.0.0\Az.DesktopVirtualization.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DevTestLabs\1.0.2\Az.DevTestLabs.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Dns\1.1.2\Az.Dns.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.EventGrid\1.3.0\Az.EventGrid.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.EventHub\1.5.0\Az.EventHub.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.FrontDoor\1.6.1\Az.FrontDoor.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Functions\1.0.1\Az.Functions.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.HDInsight\3.5.0\Az.HDInsight.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.HealthcareApis\1.1.0\Az.HealthcareApis.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.IotHub\2.5.0\Az.IotHub.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.KeyVault\2.1.0\Az.KeyVault.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.LogicApp\1.3.2\Az.LogicApp.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.MachineLearning\1.1.3\Az.MachineLearning.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Maintenance\1.1.0\Az.Maintenance.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ManagedServices\1.1.0\Az.ManagedServices.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.MarketplaceOrdering\1.0.2\Az.MarketplaceOrdering.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Media\1.1.1\Az.Media.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Monitor\2.1.0\Az.Monitor.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Network\3.3.0\Az.Network.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.NotificationHubs\1.1.1\Az.NotificationHubs.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.OperationalInsights\2.3.0\Az.OperationalInsights.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.PolicyInsights\1.3.1\Az.PolicyInsights.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.PowerBIEmbedded\1.1.2\Az.PowerBIEmbedded.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.PrivateDns\1.0.3\Az.PrivateDns.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.RecoveryServices\2.11.1\Az.RecoveryServices.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.RedisCache\1.2.1\Az.RedisCache.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Relay\1.0.3\Az.Relay.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Resources\2.5.0\Az.Resources.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ServiceBus\1.4.1\Az.ServiceBus.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ServiceFabric\2.1.0\Az.ServiceFabric.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.SignalR\1.2.0\Az.SignalR.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Sql\2.9.1\Az.Sql.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.SqlVirtualMachine\1.1.0\Az.SqlVirtualMachine.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Storage\2.5.0\Az.Storage.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.StorageSync\1.3.0\Az.StorageSync.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.StreamAnalytics\1.0.1\Az.StreamAnalytics.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Support\1.0.0\Az.Support.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.TrafficManager\1.0.4\Az.TrafficManager.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Websites\1.11.0\Az.Websites.psm1
C:\Program Files\PowerShell\7\Microsoft.Management.Infrastructure.CimCmdlets.dll
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Functions\1.0.1\custom\HelperFunctions.ps1
C:\program files\powershell\7\Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1
C:\program files\powershell\7\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\posh-git\0.7.3\posh-git.psm1
C:\program files\powershell\7\Modules\PSReadLine\PSReadLine.psm1
import-module az -requiredversion 4.5.0
Import-Module: C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Storage\2.4.0\Az.Storage.psm1:113
Line |
113 | Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azu …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Azure.Core, Version=1.2.2.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.
C:\Users\peppe> get-module | ft path
Path
----
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\az\4.5.0\Az.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Accounts\2.0.1\Az.Accounts.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Advisor\1.1.1\Az.Advisor.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Aks\1.2.0\Az.Aks.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.AnalysisServices\1.1.4\Az.AnalysisServices.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ApiManagement\2.1.0\Az.ApiManagement.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ApplicationInsights\1.1.0\Az.ApplicationInsights.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Automation\1.3.7\Az.Automation.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Batch\3.1.0\Az.Batch.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Billing\1.0.3\Az.Billing.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Cdn\1.4.3\Az.Cdn.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.CognitiveServices\1.5.1\Az.CognitiveServices.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Compute\4.2.1\Az.Compute.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ContainerInstance\1.0.3\Az.ContainerInstance.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ContainerRegistry\1.1.1\Az.ContainerRegistry.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataBoxEdge\1.1.0\Az.DataBoxEdge.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataFactory\1.9.0\Az.DataFactory.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataLakeAnalytics\1.0.2\Az.DataLakeAnalytics.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataLakeStore\1.2.8\Az.DataLakeStore.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DataShare\1.0.0\Az.DataShare.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DeploymentManager\1.1.0\Az.DeploymentManager.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DesktopVirtualization\1.0.0\Az.DesktopVirtualization.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.DevTestLabs\1.0.2\Az.DevTestLabs.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Dns\1.1.2\Az.Dns.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.EventGrid\1.3.0\Az.EventGrid.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.EventHub\1.5.0\Az.EventHub.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.FrontDoor\1.6.1\Az.FrontDoor.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Functions\1.0.1\Az.Functions.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.HDInsight\3.4.0\Az.HDInsight.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.HealthcareApis\1.1.0\Az.HealthcareApis.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.IotHub\2.5.0\Az.IotHub.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.KeyVault\2.0.0\Az.KeyVault.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.LogicApp\1.3.2\Az.LogicApp.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.MachineLearning\1.1.3\Az.MachineLearning.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Maintenance\1.0.0\Az.Maintenance.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ManagedServices\1.0.2\Az.ManagedServices.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.MarketplaceOrdering\1.0.2\Az.MarketplaceOrdering.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Media\1.1.1\Az.Media.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Monitor\2.0.2\Az.Monitor.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Network\3.3.0\Az.Network.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.NotificationHubs\1.1.1\Az.NotificationHubs.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.OperationalInsights\2.3.0\Az.OperationalInsights.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.PolicyInsights\1.3.1\Az.PolicyInsights.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.PowerBIEmbedded\1.1.2\Az.PowerBIEmbedded.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.PrivateDns\1.0.3\Az.PrivateDns.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.RecoveryServices\2.11.1\Az.RecoveryServices.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.RedisCache\1.2.1\Az.RedisCache.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Relay\1.0.3\Az.Relay.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Resources\2.4.0\Az.Resources.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ServiceBus\1.4.1\Az.ServiceBus.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.ServiceFabric\2.1.0\Az.ServiceFabric.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.SignalR\1.1.1\Az.SignalR.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Sql\2.9.1\Az.Sql.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.SqlVirtualMachine\1.1.0\Az.SqlVirtualMachine.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Storage\2.4.0\Az.Storage.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.StorageSync\1.3.0\Az.StorageSync.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.StreamAnalytics\1.0.1\Az.StreamAnalytics.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Support\1.0.0\Az.Support.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.TrafficManager\1.0.4\Az.TrafficManager.psm1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Websites\1.11.0\Az.Websites.psm1
C:\Program Files\PowerShell\7\Microsoft.Management.Infrastructure.CimCmdlets.dll
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\Az.Functions\1.0.1\custom\HelperFunctions.ps1
C:\program files\powershell\7\Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1
C:\program files\powershell\7\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1
C:\Users\peppe\OneDrive\Documenten\PowerShell\Modules\posh-git\0.7.3\posh-git.psm1
C:\program files\powershell\7\Modules\PSReadLine\PSReadLine.psm1
@peppekerstens You have loaded old preview module Az.Accounts 2.0.1-preview in the powershell console. But the latest stable Az.Accounts has version 1.9.3.
Not sure why you have installed Az.Accounts 2.0.1-preview. @erich-wang, do you know what's version for? Is it for Azure Stack only?
@peppekerstens Would you please remove Az.Accounts 2.0.1-preview, and make sure Az.Accounts 1.9.3 is installed, then try again? If you don't want to remove Az.Accounts 2.0.1-preview, you can run "Import-Module Az.accounts -RequiredVersion 1.9.3" at the begin of each PSH session to make the correct Az.Accounts is loaded, them import other module of Az.
Az.Accounts 2.0.1-preview is preview release for MSAL support. It is used in Azure Stack environment or ADFS. Since Az modules always loads the latest version of Az.Accounts, 2.0.1-preview is loaded. The latest Az.storage depends on Az.Accounts 1.9.x. Please remove 2.0.1-preview. Thanks.
I was also having this issue but trying to load different version of v2.5.0 using powershell 7.0.3 on ubuntu 20 LTS,
import-module az.storage
Import-Module: /home/mattduguid/.local/share/powershell/Modules/Az.Storage/2.5.0/Az.Storage.psm1:113
Line |
113 | Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azu …
| ~~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Azure.Core, Version=1.3.0.0, Culture=neutral,
| PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified.
However if I use the following it works fine,
install-module az.storage -requiredversion 4.0.2-preview -allowprerelease import-module az.storage
@mattduguid Would you please check which version of Az.Accounts have you loaded? Would you please run Get-module and show the result?
BTW, Az.Storage 4.0.2-preview is for Azure stack. If you don't use it on Azure stack, we don't suggest you to use it.
@blueww we have to load 2.0.1-preview for az.accounts due to a known issue where login from linux/ADFS was taking us through the device login route and failing, using the 2.0.1-preview works as it redirects to webpage for auth
install-module az.accounts -requiredversion 2.0.1-preview -allowprerelease
With regard to Az.Storage 4.0.2-preview I tried loading a number of other versions but had same error, it was only this one that let us proceed.
@mattduguid Az.Storage 1.9.3 is released with Az.Accounts 2.5.0, and can only work with Az.Account 2.5.0 or later. az.accounts 2.0.1-preview is released much early before Az.Account 2.5.0, it can't work with Az.Storage 1.9.3. (Az.Storage 2.0.1-preview should work with it, anyway it should miss many new changes.)
For the know issue of login from linux/ADFS, do you have a issue to track it? If not, would you like to open another issue to track it, as this issue is for Az.storage load.
this is the link for the device login issue -> https://github.com/Azure/azure-powershell/issues/9427
i'll test that combination soon of Az.Storage 1.9.3 & Az.Accounts 2.5.0 thanks 👍🏼
@blueww following non-preview combo has worked without error thanks
Install-Module Az.Accounts -requiredversion 1.9.3 Install-Module Az.Storage -requiredversion 2.5.0 Import-Module -Name az.accounts Import-Module -Name az.storage Connect-AzAccount
Thanks @mattduguid for the update! I will close this issue as you issue is resolved, and @peppekerstens have no responds for a long time.
Feel free to contact us again if need any further assistance on Azure Powershell.
Description
When importing az module version 4.50 & 4.6.0 within PS7, I receive load errors on az.storage.
Steps to reproduce
PS7 env
(clean PS session each time)
PS5 env
(clean PS session each time)
Module versions
PS5 env
PS7 env
Debug output
This provides no extra info
Error output