0

I am creating my first logic app which connects to SharePoint and adds entries into some sharepoint list.

Whenever I create a SharePoint Connection it adds below resource to my logic app.

{
  "type": "MICROSOFT.WEB/CONNECTIONS",
  "apiVersion": "2018-07-01-preview",
  "name": "[parameters('sharepointonline_1_Connection_Name')]",
  "location": "[parameters('logicAppLocation')]",
  "properties": {
    "api": {
      "id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sharepointonline')]"
    },
    "displayName": "[parameters('sharepointonline_1_Connection_DisplayName')]",
    "nonSecretParameterValues": {
      "token:TenantId": "[parameters('sharepointonline_1_token:TenantId')]"
    }
  }

Could anyone give an explanation of "token:TenantId". How/where to get this value in my dev tenant. How this can be moved to UAT/PROD environment?

Whenever I recreate my logic app with the SharePoint connection it loses the connection and shows me below screen with a warning icon.

enter image description here

Is there a way we can authenticate this connection via PowerShell or via Azure DevOps deployment?

0

There are multiple ways to find the SharePoint Online Tenant ID, although since the Logic App designer created that connection for you, you can probably find that value in the .parameters file in your project. If it is not already there, then probably the easiest is described in this blog:

Navigate to https://yourtenantname.sharepoint.com/_layouts/appprincipals.aspx. Identify the row with your registered application and look at the App Identifier column. The unique identifier after the @-sign in the App Identifier is the app realm. Copy the realm (not the whole App Identifier just the last part after the @-sign).

You can also get the Tenant ID using powershell by using the cmdlet Login-AzureRmAccount.

If you are attempting to deploy your Logic App using a DevOps pipeline, then you will want to grab that Tenant ID ahead of time and store it in a pipeline parameter variable.

  • Thanks @willman for the help. I have updated my parameter file with the tentnat id but the connection is still not authenticated. The only way I am able to authenticate is via Logic App Designer – Ravi Khambhati 2 days ago
  • How are you deploying your Logic App? If you are deploying using the tools in Visual Studio, or if you are deploying from a DevOps pipeline, either one of those should use the json you posted in your question to generate an API Connection in Azure that your app will use. – willman 2 days ago
  • As per your suggestion, I have added parameter for tokenid in my parameter file. Currently, I am doing deployment with Visual Studio. – Ravi Khambhati 2 days ago
  • After deploying, can you view API Connections in your Azure Portal too see if it got created? – willman 2 days ago
  • Its there but unauthorized. – Ravi Khambhati 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.