navcontainerhelper icon indicating copy to clipboard operation
navcontainerhelper copied to clipboard

Allow Module Publish in Azure Automation Account

Open ChrisBlankDe opened this issue 1 year ago • 5 comments

Describe the issue Currently its not possible to publish the Modul in an Azure Automation Account

Exception Message

Error importing the module BcContainerHelper. Import failed with the following error: Orchestrator.Shared.AsyncModuleImport.ModuleImportException: An error occurred when trying to import the module to an internal PowerShell session. Either the module dependencies are not imported correctly or the module is unsupported. Internal Error Message: The term 'whoami' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. The module to process 'BcContainerHelper.psm1', listed in field 'ModuleToProcess/RootModule' of module manifest 'C:\Users\Client\Temp\WHYIRLVTYA\BcContainerHelper\BcContainerHelper.psd1' was not processed because no valid module was found in any module directory. . 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)

Additional context

  • does it happen all the time? Yes
  • did it use to work? No

ChrisBlankDe avatar Jul 03 '23 07:07 ChrisBlankDe

Is this about publish or is this about importing the module?

freddydk avatar Jul 03 '23 18:07 freddydk

Its about adding the module to the automation account. sorry about the bad wording. image image image image

or just click here: https://www.powershellgallery.com/packages/BcContainerHelper/ image

ChrisBlankDe avatar Jul 03 '23 18:07 ChrisBlankDe

It complains about the whoami command, which works fine on Windows and Linux. I don't know what lies behind Azure Automation, but if whoami doesn't work, I am afraid that other things also wouldn't work. This isn't something I have time to work on right now, sorry. If somebody finds out which things works and what not, I would be happy to review a PR.

freddydk avatar Jul 03 '23 19:07 freddydk

actually it's only the container functions that have a problem with the current implementation. for example i only need the BC.SaasHelper, it works great without the whoami.

Q1: would it be ok for you if we just print a warning and a hint that the execution in Azure Automation is not officially supported?

Q2: Do I see it right that the BC.* modules are a bit behind? are they not released regularly?

ChrisBlankDe avatar Jul 03 '23 19:07 ChrisBlankDe

Currently, the BC.* modules are not being updated regularly - that is on my todo list If we can identify Azure Automation and print that this is experimantal support - and then maybe use a different mechanism to get the username (like identity.name instead) - that's fine. What always becomes problematic is when we change mainstream code to support something one-off - that always comes back to haunt me:-)

freddydk avatar Jul 03 '23 20:07 freddydk