Open
Description
creating automation module using following script sometimes fails
resource azurerm_automation_module az_resources {
name = "Az.Resources"
resource_group_name = azurerm_resource_group.test.name
automation_account_name = azurerm_automation_account.test.name
module_link {
uri = "https://www.powershellgallery.com/api/v2/package/Az.Resources/1.11.0"
}
}
this is the server error message:
Orchestrator.Shared.AsyncModuleImport.ModuleImportException: An error occurred during module validation. When importing the module to an internal PowerShell session, it was not able to be loaded by PowerShell. There is likely an issue with the contents of the module that results in PowerShell's not being able to load it. Please verify that the module imports successfully in a local PowerShell session, correct any issues, and then try importing again.
Internal error message: The specified module 'Az.Accounts' with version '1.7.2' was not loaded because no valid module file was found in any module directory.
Could not load file or assembly 'Microsoft.Azure.PowerShell.Clients.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Azure.PowerShell.Clients.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'Microsoft.Azure.PowerShell.Clients.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
.
at Orchestrator.Activities.SetModuleVersion.GetPsModuleVersion(String moduleName, String moduleFullPath, Guid accountId, Guid moduleVersionId, InitialSessionState defaultSessionState)
at Orchestrator.Activities.SetModuleVersion.InsertModuleVersion(String moduleName, ModuleLanguage moduleLanguage, String pythonModuleVersion, String moduleFullyQualifiedName, ActivitiesMetadataWorkflowExtension activitiesMetadataWorkflowExtension, Guid accountId, Guid moduleVersionId, Int64 moduleContentByteSize, ContentUriInfo contentUri, String storageUri, Int32 moduleVersion)
at Orchestrator.Activities.SetModuleVersion.ExecuteInternal(CodeActivityContext context, String moduleName, ModuleLanguage moduleLanguage, String pythonModuleVersion, String modulePath, Guid accountId, Guid moduleVersionId, Int64 moduleContentByteSize, String storageUri, Int32 moduleVersion)
at Orchestrator.Activities.SetModuleVersion.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
I think there may be some problem with this module link, but there is no reason that sometimes it's success and sometimes it failed