Custom Module (MSOnline) fail in Azure Automation RRS feed

  • Question

  • Hi,

    I've created a module based on the MSOnline files. The module seems to import fine into the Azure Automation. When a command is used from the module I get the error below.

    26-06-2014 23:40:05, Error: Connect-MSOLService : The Microsoft Online Services Module is not configured properly. Please uninstall and then reinstall the module.At AssignOffice365License:71 char:71

    Any help or input is much appreciated! Thanks

    Peter Selch Dahl - - Blog: - Twitter @PeterSelchDahl

    Thursday, June 26, 2014 10:13 PM

All replies

  • Found a workaround for the first issue. Now I'm stuck with this issue:

    27-06-2014 00:56:13, Error: Connect-MsolService : The type initializer for 'Microsoft.Online.Administration.Automation.ConnectMsolService' threw an 

    Peter Selch Dahl - - Blog: - Twitter @PeterSelchDahl

    Thursday, June 26, 2014 11:05 PM
  • Hi Peter,

    Can you attach the MSOnline module you created so I can take a look?

    Friday, June 27, 2014 10:36 PM
  • Peter, did you ever resolve this issue?
    Monday, July 14, 2014 6:13 PM
  • Yes i can.

    Peter Selch Dahl - - Blog: - Twitter @PeterSelchDahl

    Tuesday, July 15, 2014 9:14 AM
  • Hi Joe,

    Thanks for getting back to me!

    I have not tested it Again. I will test it today and get back to you.


    PS: I'm also an Azure Advisor so you can find me on the Yammer site

    Peter Selch Dahl - - Blog: - Twitter @PeterSelchDahl

    Tuesday, July 15, 2014 9:18 AM
  • Hi Joe,

    I still get the same error.

    Peter Selch Dahl - - Blog: - Twitter @PeterSelchDahl

    Tuesday, July 15, 2014 10:00 PM
  • Hi Joey,

    Have you seen this feedback post.


    Peter Selch Dahl - - Blog: - Twitter @PeterSelchDahl

    Tuesday, July 22, 2014 8:46 AM
  • Yup. We are looking into it.
    Tuesday, July 22, 2014 11:54 PM
  • Hi Joe,

    Sounds Good. I've been writing with Beth Cooper and she mentioned the following about the issue "This requires installing the MS Online msi in order for the required files to be available.  The sandboxes that run the automation jobs do not allow us to do this as of now".

    Just found your script about storing Git Repo on the sandbox server and that made me think :) How much access/control do we have to the underlying host. Would I be able to install the msi my self?

    Wednesday, July 23, 2014 9:53 AM
  • Yes Beth is correct. You cannot install anything on the runbook worker sandbox. All modules used in Azure Automation must be self-contained. However it looks like you managed to encapsulate all the module's dependencies into a folder, so in theory you should be able to use it in Azure Automation. The best way to test if you correctly placed everything within the module folder is to go to a host that does not have MSOnline installed, and see if you can use the module you created from regular PowerShell.

    Looking at the link you sent -- what is the difference between MSOnline and MSOnlineExtended?

    My Download Github Repository runbook works because it does not rely on git or any install-able product, just HTTP.

    Wednesday, July 23, 2014 7:58 PM