How can I setup a new custom connector from Power Automate that should use a Service principal

Håkan Champ Bondesson 20 Reputation points
2024-11-13T06:40:58.1533333+00:00

I have tried to create a custom connector within Power Automate where I need to replicate the standard connector "Create a pipeline run" but I need it to use a service principal account as people not having access to data factory should still be able to use a Power App that I have created.

I have created everything within Azure, like App, secret, redirect url etc.. and I have also setup everything in Postman and I'm able to get a token and my pipeline is started with 5 input parameters that is to be used within my pipeline.

I would really like to know if it even possible to get the authentication to work with using a custom connector?

Below is my details:
Under the App -> Authentication I have added the Redirect_URI that I received when I created the customer connector.

Under the App -> API Permissions I have added "Azure Service Management" -> user_impersonation...however the Status is not set to be "Granted", does it need to be?!

I started to create my new connector from scratch and filled in all fields: Authentication Type => OAuth 2.0

Identity Provider => Azure Active Directory

Enable Service principal support => TRUE

Client Id => from my App

Client Secret => from the secret created under the App

Authorization URL => https://login.microsoftonline.com/TENANT_ID/oauth2/v2.0/authorize

Tenant Id =our tenant id

Resource URL => https://management.azure.com/

Enable on-behalf-of-login => ?? It's by default set to false, I don't know if this needs to be set to true

Scope => https://management.azure.com/.default

Redirect URL => set by the system after connector is created, This URL is added under the App's Authentication web redirects.

What I find strange about this is that there is no URL for the token? Is this not needed?

Error after all if this is that I'm not getting authenticated:
Failed to acquire access token for service using client credentials flow: IdentityProvider=aad. Correlation Id=907d2481-19c5-438c-a161-d44f90afb816, UTC TimeStamp=11/13/2024 6:38:16 AM, Error: Failed to exchange client credentials for token. Response code=NotFound, Details:

I have also tested to export the Postman collection and created a new connector based on this and entered all other information, still same issue with authentication

Any guidance to get this to work is highly appreciated!

Thank you.

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,119 questions
0 comments No comments
{count} votes

Accepted answer
  1. Syed Saleem Peera 8,835 Reputation points Microsoft Vendor
    2024-11-13T08:52:10.4433333+00:00

    Hi Håkan Champ Bondesson,

    Thank you for reaching out to us on the Microsoft Q&A forum. 

    This topic is currently not supported in the Q&A forums. 

    We recommend initiating a new discussion through the https://community.powerplatform.com/forums/thread/?groupid=46ce02a3-e1a7-4176-81fc-d93a4001d287&page=1

    Moderators are readily available there to assist you and provide guidance. 

    Please don't forget to Accept/Upvote helpful answer and close this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Syed Saleem Peera 8,835 Reputation points Microsoft Vendor
    2024-11-13T08:51:55.49+00:00

    Hi Håkan Champ Bondesson,

    Thank you for reaching out to us on the Microsoft Q&A forum. 

    This topic is currently not supported in the Q&A forums. 

    We recommend initiating a new discussion through the https://community.powerplatform.com/forums/thread/?groupid=46ce02a3-e1a7-4176-81fc-d93a4001d287&page=1

    Moderators are readily available there to assist you and provide guidance. 

    Please don't forget to Accept/Upvote helpful answer and close this thread.

    0 comments No comments

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.