I have a Teams Channel where Admins upload their Scripts. We want to establish a Cloud Flow that checks for new files and triggers via HTTP Post a Pipeline which uploads everything in that Teams Folder into a Azure DevOps Repo. My Question is what is the best way to authenticate the Pipeline to SharePoint. I currently find no suitable Way.
I tried using the Link from the Share Option in Sharepoint but its refusing to connect. Should i use a Managed Identity TM or a ServicePrincipal TM or maybe just a new user and use the login credentials.
For anyone attempting something similar, I successfully implemented this using Power Automate. Here's a detailed breakdown of my approach:
Triggering the Flow: Start the flow with a SharePoint trigger, specifically "When a file is created or modified (properties only)."
Retrieving Necessary Values: Fetch required values from Azure Key Vault.
Getting File Content: Use a SharePoint flow action to get the file content. This action requires the Identifier parameter from the trigger body.
Handling Multiple Files: Incorporate logic to determine if one or multiple files are created or modified.
Pushing to the Repository: Perform an HTTP POST API call to push the file(s) to the Azure DevOps repository. For detailed API documentation, refer to Azure DevOps REST API - Pushes.