Unable to Import AIP and PnP Modules in Azure Automation Runbook

Lucie 1 Reputation point
2025-01-07T08:32:01.82+00:00

I'm encountering issues while attempting to write scripts in an Azure Automation Runbook for decrypting files encrypted by IRM. The following errors occur when trying to import the required modules:

Import-Module -Name PnP.PowerShell 
Import-Module -Name AIPService 

Error messages:

Import-Module: Line | 2 | Import-Module -Name PnP.PowerShell | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | The specified module 'PnP.PowerShell' was not loaded because no valid module file was found in any module directory.

Import-Module: Line | 4 | Import-Module -Name AIPService | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | The specified module 'AIPService' was not loaded because no valid module file was found in any module directory.

Additionally, there is no [Modules] menu under [Shared Resources] in my [Automation Account], making it impossible to import or check modules from the menu. What could be causing these issues, and how can the functionality to manage modules be restored?

Any assistance would be appreciated. Thank you in advance.

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,289 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ashok Gandhi Kotnana 1,935 Reputation points Microsoft Vendor
    2025-01-08T13:43:38.5366667+00:00

    Hi @Lucie,

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    **1.**PnP.PowerShell

    Functionality: Connect to Office 365 and most related services and get ready to administer all services. The commandlet supports saving your administrative credentials in a safe manner so that it can be used in unattended files and allows easy recall from the command line using autocompletion of saved credentials. Allows PowerShell administration of: O365, Azure AD, Azure RMS, Exchange Online, SharePoint Online including PNP PowerShell

    The below module does above functionality Import it from shared Gallery if this what you are looking for

    User's image

    2 AIPService

    There is not direct module to for AIP please imports from powershellgallery link below

    Refer: https://www.powershellgallery.com/profiles/AzureRMS

    Click highlighted and import into your automation account

    User's image

    let us know if you have any further queries. I’m happy to assist you further.   

    Please do not forget to "Accept the answer” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.