Logic App to SharePoint: Set Custom Credentials with ARM Template

Paul Baker 21 Reputation points
2021-07-12T15:38:52.673+00:00

It is pretty easy to create a logic app that connects to SharePoint Online and creates list items. However, when I create the connection, it defaults to connecting as the developer (me). I'd like to run this as a "service account" for prod and need to deploy via ARM template. When attempting to authenticate as a different user from the browser (in the "authenticate" button from the Edit API Connection), it may ask for the username, but still defaults to my credentials.

Is there any way to set the username/password/token in the ARM template for automated deployment? Is there a way to have the browser log on options actually prompt for service account credentials?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,141 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,713 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,451 Reputation points
    2021-07-13T05:19:10.807+00:00

    @Paul Baker At the moment, the sharepoint authorization works with the OAuth 2.0 Authorization Code Grant Type, which means, you can only get the authorization code by getting the user sign in to get the code. This behavior of the API is by design. Thus, there is no way to fully automate this.

    • Consider not re-creating api connection after initial manual authentication since there's no need unless cred changes, and only include logic apps in arm template for subsquent deployment.
    • Consider using HTTP with MSI to call graph API directly.

    For connection resource define you can refer to this.
    More details : https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-deploy-azure-resource-manager-templates#authorize-oauth-connections

    For other issue can you try with incognito browser window then to authenticate the connection and see if it helps you.

    0 comments No comments

0 additional answers

Sort by: Most 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.