A cloud-based identity and access management service for securing user authentication and resource access
Hi @Pia
Thank you for reaching out to Microsoft Q&A.
The issue you are encountering occurs due to a known limitation with the “HTTP with Microsoft Entra ID (preauthorized)” connector when deploying Power Automate solutions across managed environments (for example, DEV → TEST → PROD). While the connection works correctly in the source environment where it was originally authorized, Power Automate requires the OAuth connection to be recreated during solution import into another environment. The preauthorized Entra ID connector does not handle this OAuth re‑creation process cleanly, which results in the error “Create and authorize OAuth connection failed.” In your case, the behavior appears inconsistent because Microsoft is gradually rolling out a newer authorization interface your Test environment is already using the new interface, while Production is still using the old one, where the deployment fails. This is not caused by misconfiguration or permissions but is a connector-level limitation.
Refer below points to resolve this issue or use as workaround:
Create the HTTP with Microsoft Entra ID (preauthorized) connection manually in the target (PROD) environment Before importing the solution, go to Power Automate → Connections in the Production environment and manually create the “HTTP with Microsoft Entra ID (preauthorized)” connection. Use the required Base Resource URL and Entra ID Resource URI (for example, https://graph.microsoft.com). During solution import, map the solution to this existing connection instead of allowing Power Automate to create a new one. This prevents OAuth re-authorization and avoids the error.
Use the non‑preauthorized “HTTP with Microsoft Entra ID” connector As an alternative, use the standard “HTTP with Microsoft Entra ID” connector instead of the preauthorized version. This requires explicit admin consent and reconfiguration after deployment, but deployments typically succeed because the OAuth flow is fully supported across environments.
Use a Custom Connector for strict ALM scenarios For enterprise or long-term ALM stability, create a Custom Connector backed by your own Microsoft Entra ID app registration and explicitly managed permissions. While this requires more setup effort, it provides full control and avoids the deployment limitations of the preauthorized connector.