question

PaulBaker-5766 avatar image
0 Votes"
PaulBaker-5766 asked MayankBargali-MSFT edited

Logic App to SharePoint: Set Custom Credentials with ARM Template

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?

office-sharepoint-onlineazure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT edited

@PaulBaker-5766 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://docs.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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.