A unified data governance solution that helps manage, protect, and discover data across your organization
Hi @Krunal E. More , Hope you are doing well.
Thank you for your question.
Based on current supportability, the behavior you are seeing is expected.
- Connect-IPPSSession does not currently support Managed Identity authentication.
- Azure Automation Runbooks using a Managed Identity cannot establish a connection to the Security & Compliance (Purview) PowerShell endpoint through
Connect-IPPSSession. - For non-interactive automation scenarios, Microsoft recommends using Certificate-Based Authentication (App-Only Authentication) instead of Managed Identity.
However, there is an important limitation:
- While Certificate-Based Authentication can be used for many Exchange Online PowerShell operations, Purview retention policy management is currently not fully supported through app-only/non-interactive authentication and typically requires an interactive administrative session.
For your specific questions:
Is Connect-IPPSSession supported in Azure Automation Runbooks?
Yes, but not with Managed Identity authentication.
Does Connect-IPPSSession support Managed Identity authentication?
No. Managed Identity is not currently supported for the Compliance PowerShell endpoint.
Are there additional permissions or roles required?
Appropriate Purview/Compliance roles are required, but permissions alone will not enable Managed Identity support.
Is there a Microsoft-recommended alternative?
For unattended Exchange Online PowerShell operations, use Certificate-Based Authentication (CBA). If you are managing classic Exchange Online MRM retention policies, you may be able to perform the assignment through Exchange Online PowerShell without using the Compliance endpoint.
Are there known limitations with Azure Automation and Compliance PowerShell?
Yes. The primary limitation is the lack of Managed Identity support and the requirement for interactive authentication for certain Purview retention policy operations.
Reference: Microsoft App-Only Authentication for Exchange Online PowerShell: https://learn.microsoft.com/powershell/exchange/app-only-auth-powershell-v2?view=exchange-ps
The key design consideration is whether you are assigning classic Exchange Online (MRM) retention policies or Microsoft Purview retention policies. That distinction determines whether the Compliance endpoint is required and whether automation is currently feasible in a fully unattended manner.
Best Regards,
Microsoft Support Team.