Closed majguo closed 6 months ago
ERROR DETAILS
Microsoft.PowerShell.Commands.WriteErrorException: This module requires Az.Accounts version 2.13.2. An earlier version of Az.Accounts is imported in the current PowerShell session. Please open a new session before importing this module. This error could indicate that multiple incompatible versions of the Azure PowerShell cmdlets are installed on your system. Please see https://aka.ms/azps-version-error for troubleshooting information.
at 2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.PSScriptCmdlet.RunClause(Action
1 clause, Object dollarUnderbar, Object inputToProcess)
at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
at
Debug info:
$PSVersionTable
Name Value
---- -----
PSVersion 7.0.13
PSEdition Core
GitCommitId 7.0.13
OS Linux 5.10.102.2-microsoft-standard #1 SMP Mon Mar 7 17:36:34 UTC 2022
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
There are two Az.Accounts loaded.
PS /mnt/azscripts/azscriptinput> Get-Module -ListAvailable
Directory: /root/.local/share/powershell/Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 5.0.0 Az Core,Desk
Script 2.13.2 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-A…
Script 2.9.1 Az.Accounts Core,Desk {Disable-AzDataCollection, Disable-A…
Script 1.1.1 Az.Advisor Core,Desk {Get-AzAdvisorRecommendation, Enable…
Script 2.0.0 Az.Aks Core,Desk {Get-AzAksCluster, New-AzAksCluster,…
Script 1.1.4 Az.AnalysisServices Core,Desk {Resume-AzAnalysisServicesServer, Su…
Script 2.1.0 Az.ApiManagement Core,Desk {Add-AzApiManagementApiToGateway, Ad…
Script 1.1.0 Az.ApplicationInsights Core,Desk {Get-AzApplicationInsights, New-AzAp…
Script 1.4.0 Az.Automation Core,Desk {Get-AzAutomationHybridWorkerGroup, …
Script 3.1.0 Az.Batch Core,Desk {Remove-AzBatchAccount, Get-AzBatchA…
Script 2.0.0 Az.Billing Core,Desk {Get-AzBillingInvoice, Get-AzBilling…
Script 1.6.0 Az.Cdn Core,Desk {Get-AzCdnProfile, Get-AzCdnProfileS…
Script 1.8.0 Az.CognitiveServices Core,Desk {Get-AzCognitiveServicesAccount, Get…
Script 4.6.0 Az.Compute Core,Desk {Remove-AzAvailabilitySet, Get-AzAva…
Script 1.0.3 Az.ContainerInstance Core,Desk {New-AzContainerGroup, Get-AzContain…
Script 2.0.0 Az.ContainerRegistry Core,Desk {New-AzContainerRegistry, Get-AzCont…
Script 1.1.0 Az.DataBoxEdge Core,Desk {Get-AzDataBoxEdgeJob, Get-AzDataBox…
Script 1.0.1 Az.Databricks Core,Desk {Get-AzDatabricksVNetPeering, Get-Az…
Script 1.11.0 Az.DataFactory Core,Desk {Set-AzDataFactoryV2, Update-AzDataF…
Script 1.0.2 Az.DataLakeAnalytics Core,Desk {Get-AzDataLakeAnalyticsDataSource, …
Script 1.2.8 Az.DataLakeStore Core,Desk {Get-AzDataLakeStoreTrustedIdProvide…
Script 1.0.0 Az.DataShare Core,Desk {New-AzDataShareAccount, Get-AzDataS…
Script 1.1.0 Az.DeploymentManager Core,Desk {Get-AzDeploymentManagerArtifactSour…
Script 2.0.0 Az.DesktopVirtualization Core,Desk {Disconnect-AzWvdUserSession, Get-Az…
Script 1.0.2 Az.DevTestLabs Core,Desk {Get-AzDtlAllowedVMSizesPolicy, Get-…
Script 1.1.2 Az.Dns Core,Desk {Get-AzDnsRecordSet, New-AzDnsRecord…
Script 1.3.0 Az.EventGrid Core,Desk {New-AzEventGridTopic, Get-AzEventGr…
Script 1.7.0 Az.EventHub Core,Desk {New-AzEventHubNamespace, Get-AzEven…
Script 1.6.1 Az.FrontDoor Core,Desk {New-AzFrontDoor, Get-AzFrontDoor, S…
Script 2.0.0 Az.Functions Core,Desk {Get-AzFunctionApp, Get-AzFunctionAp…
Script 4.0.0 Az.HDInsight Core,Desk {Get-AzHDInsightJob, New-AzHDInsight…
Script 1.1.0 Az.HealthcareApis Core,Desk {New-AzHealthcareApisService, Remove…
Script 2.6.0 Az.IotHub Core,Desk {Add-AzIotHubKey, Get-AzIotHubEventH…
Script 3.0.0 Az.KeyVault Core,Desk {Add-AzManagedHsmKey, Get-AzManagedH…
Script 1.0.0 Az.Kusto Core,Desk {Add-AzKustoClusterLanguageExtension…
Script 1.3.2 Az.LogicApp Core,Desk {Get-AzIntegrationAccountAgreement, …
Script 1.1.3 Az.MachineLearning Core,Desk {Move-AzMlCommitmentAssociation, Get…
Script 1.1.0 Az.Maintenance Core,Desk {Get-AzApplyUpdate, Get-AzConfigurat…
Script 1.2.0 Az.ManagedServiceIdentity Core,Desk {Get-AzSystemAssignedIdentity, Get-A…
Script 2.0.0 Az.ManagedServices Core,Desk {Get-AzManagedServicesAssignment, Ne…
Script 1.0.2 Az.MarketplaceOrdering Core,Desk {Get-AzMarketplaceTerms, Set-AzMarke…
Script 1.1.1 Az.Media Core,Desk {Sync-AzMediaServiceStorageKey, Set-…
Script 2.2.0 Az.Monitor Core,Desk {Get-AzMetricDefinition, Get-AzMetri…
Script 4.1.0 Az.Network Core,Desk {Add-AzApplicationGatewayAuthenticat…
Script 1.1.1 Az.NotificationHubs Core,Desk {Get-AzNotificationHub, Get-AzNotifi…
Script 2.3.0 Az.OperationalInsights Core,Desk {New-AzOperationalInsightsAzureActiv…
Script 1.3.1 Az.PolicyInsights Core,Desk {Get-AzPolicyEvent, Get-AzPolicyStat…
Script 1.1.2 Az.PowerBIEmbedded Core,Desk {Remove-AzPowerBIWorkspaceCollection…
Script 1.0.3 Az.PrivateDns Core,Desk {Get-AzPrivateDnsZone, Remove-AzPriv…
Script 3.0.0 Az.RecoveryServices Core,Desk {Get-AzRecoveryServicesBackupPropert…
Script 1.4.0 Az.RedisCache Core,Desk {Remove-AzRedisCachePatchSchedule, N…
Script 1.0.3 Az.Relay Core,Desk {New-AzRelayNamespace, Get-AzRelayNa…
Script 3.0.0 Az.Resources Core,Desk {Get-AzProviderOperation, Remove-AzR…
Script 1.4.1 Az.ServiceBus Core,Desk {New-AzServiceBusNamespace, Get-AzSe…
Script 2.2.0 Az.ServiceFabric Core,Desk {Add-AzServiceFabricClientCertificat…
Script 1.2.0 Az.SignalR Core,Desk {New-AzSignalR, Get-AzSignalR, Get-A…
Script 2.11.1 Az.Sql Core,Desk {Get-AzSqlDatabaseTransparentDataEnc…
Script 1.1.0 Az.SqlVirtualMachine Core,Desk {New-AzSqlVM, Get-AzSqlVM, Update-Az…
Script 3.0.0 Az.Storage Core,Desk {Get-AzStorageAccount, Get-AzStorage…
Script 1.3.0 Az.StorageSync Core,Desk {Invoke-AzStorageSyncCompatibilityCh…
Script 1.0.1 Az.StreamAnalytics Core,Desk {Get-AzStreamAnalyticsFunction, Get-…
Script 1.0.0 Az.Support Core,Desk {Get-AzSupportService, Get-AzSupport…
Script 1.0.4 Az.TrafficManager Core,Desk {Add-AzTrafficManagerCustomHeaderToE…
Script 2.0.0 Az.Websites Core,Desk {Get-AzAppServicePlan, Set-AzAppServ…
Directory: /opt/microsoft/powershell/7-lts/Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Manifest 1.2.5 Microsoft.PowerShell.Archive Desk {Compress-Archive, Expand-Archive}
Manifest 7.0.0.0 Microsoft.PowerShell.Host Core {Start-Transcript, Stop-Transcript}
Manifest 7.0.0.0 Microsoft.PowerShell.Management Core {Add-Content, Clear-Content, Clear-I…
Manifest 7.0.0.0 Microsoft.PowerShell.Security Core {Get-Credential, Get-ExecutionPolicy…
Manifest 7.0.0.0 Microsoft.PowerShell.Utility Core {Export-Alias, Get-Alias, Import-Ali…
Script 1.4.7 PackageManagement Desk {Find-Package, Get-Package, Get-Pack…
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Fin…
Script 2.0.5 PSDesiredStateConfiguration Core {Configuration, New-DscChecksum, Get…
Script 2.0.4 PSReadLine Desk {Get-PSReadLineKeyHandler, Set-PSRea…
Binary 2.0.3 ThreadJob Desk Start-ThreadJob
PS /mnt/azscripts/azscriptinput>
Import-Module Az.ManagedServiceIdentity
Import-Module: /root/.local/share/powershell/Modules/Az.ManagedServiceIdentity/1.2.0/ManagedServiceIdentity.Autorest/Az.ManagedServiceIdentity.psm1:30
Line |
30 | … ntsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 - …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.18.0.315,
| Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Write-Error:
This module requires Az.Accounts version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps
Import-Module: The module to process '/root/.local/share/powershell/Modules/Az.ManagedServiceIdentity/1.2.0/ManagedServiceIdentity.Autorest/Az.ManagedServiceIdentity.psm1', listed in field 'NestedModules' of module manifest '/root/.local/share/powershell/Modules/Az.ManagedServiceIdentity/1.2.0/Az.ManagedServiceIdentity.psd1' was not processed because no valid module was found in any module directory.
Root cause: the PowerShell runtime is 7.0.13
even the template specified version 5.0
. Az.ManagedServiceIdentity
module has been loaded to runtime by default in PowerShell 7.0.13. No need to import the module in userscript.
Solution: upgrade AzurePowerShell version from 5.0
to 8.3
. Do not import Az.ManagedServiceIdentity
module in userscript.
Problem
When deploying a WebLogic cluster with application gateway and TLS/SSL certificate option Generate a self-signed certificate using Oracle WebLogic Server Cluster on Azure VMs offer, the deployment failed with the following raw error message:
How to reproduce