Recently PowerShell Gallery received a feature that you can deploy Modules from PowerShell Gallery to Azure Automation (part of OMS). You can upload PowerShell Modules to Azure Automation with little or not change to the module. If you want to make your PowerShell module more appealing and easy to use in Azure Automation you can create so called Connection. You can read more here. Recently I was able to confirm that if you publish your PowerShell Module with Connection to the PowerShell gallery that Connection will be imported as well when you import your module to Azure Automation. My fellow MVP Tao Yang helped me in confirming this. Basically when you import your module to the PowerShell Gallery make sure that the json file needed for the connection is included in the files for upload:
It is interesting that I think I’ve included that json file in the OMSSearch Module since its first release in the PowerShell Gallery and before that feature Deploy to Azure Automation was available.
When you import the OMSSearch module from the PowerShell gallery to your Azure Automation account you will be able to create OMSSearch Connection:
I hope this was useful for you and also I hope more PowerShell module authors will include connections in the modules.