On Azure Automation, Import-Module -Name Az.Resources is on error #21680
Labels
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
customer-reported
Description
Step 1 : I create a new Azure Automation
Step 2 : I create a simple Runbook on Azure Automation with this script :
import-Module -Name Az.Resources
import-Module -Name Az.Websites
Execution Result
When this Runbook run, the import instructions are on error.
1/
Register-AzModule : The type initializer for 'Microsoft.Azure.Commands.Common.AzModule' threw an exception. At C:\Modules\Global\Az.Resources\MSGraph.Autorest\Az.MSGraph.psm1:49 char:13 + $VTable = Register-AzModule + ~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Register-AzModule], TypeInitializationException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Common.RegisterAzModule
2/
Register-AzModule : The type initializer for 'Microsoft.Azure.Commands.Common.AzModule' threw an exception. At C:\Modules\Global\Az.Resources\Authorization.Autorest\Az.Authorization.psm1:49 char:13 + $VTable = Register-AzModule + ~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Register-AzModule], TypeInitializationException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Common.RegisterAzModule
3/
Register-AzModule : The type initializer for 'Microsoft.Azure.Commands.Common.AzModule' threw an exception. At C:\Modules\Global\Az.Websites\Websites.Autorest\Az.Websites.psm1:49 char:13 + $VTable = Register-AzModule + ~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Register-AzModule], TypeInitializationException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Common.RegisterAzModule
The module version are :
Az.Resources : 6.0.0
Az.WebSites : 2.11.2
Finally, we noticed that it was impossible to update these modules with a higher or lower version.
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: