DEV Community

Cover image for How to import (many) modules into Azure Automation | Command Line | en-us
Ewerton Jordão
Ewerton Jordão

Posted on • Updated on

How to import (many) modules into Azure Automation | Command Line | en-us

How to import local modules into your automation service by command line.

Hy everyone, how are u? Bringing a cool tip for those who use the automation service available in Azure (Azure Automation). The import process via the graphical interface is intuitive and helps a lot when there is not much intimacy with the command line, but it becomes somewhat repetitive if you need to search for various modules and perform an import.

Sometimes, when we are developing some automation, we carry out local tests. And, often, it uses modules to help the tasks. If for some reason you have module numbers, how do you put that list in your automation account? I will demonstrate how to execute the process in the script below:

⚠ When do you use the first script you can receive an error because the import-module on Azure Automation has a limited number of jobs simultaneously.

Creating Jobs in Azure using a connection created in the Visual Studio Code terminal. Connect-AzAccount

Visualization of module import jobs in the Azure portal with import status

Visualization of the module import jobs in the Azure portal with the status of available from this moment we can use the modules in the scripts

After all modules are finished importing, we can use them in our PowerShell runbooks, without any problem of failing due to lack of any reference.

That's it, folks. Don't forget, PWSH + Azure Automation is life

Top comments (0)