|

|  How to Integrate Microsoft Azure Cognitive Services with Microsoft SharePoint

How to Integrate Microsoft Azure Cognitive Services with Microsoft SharePoint

January 24, 2025

Unlock seamless collaboration by integrating Azure Cognitive Services with SharePoint. Step-by-step guide to enhance productivity and data management.

How to Connect Microsoft Azure Cognitive Services to Microsoft SharePoint: a Simple Guide

 

Set Up Your Azure Cognitive Services

 

  • Create an Azure account if you don't have one. Visit the Azure Portal to start the process.
  •  

  • In the Azure Portal, search for "Cognitive Services" and click on it.
  •  

  • Click "Create" and select the specific cognitive service you wish to integrate, such as "Computer Vision" or "Text Analytics".
  •  

  • Fill in the required details like the subscription, resource group, and pricing tier. Once configured, click on "Review + Create" and then "Create" to instantiate the service.
  •  

  • Navigate to the newly created service and get the necessary keys and endpoint URL, which will be needed for integration with SharePoint.

 

Prepare Microsoft SharePoint

 

  • Ensure you have administrative access to the SharePoint site where the integration will occur.
  •  

  • Familiarize yourself with Microsoft Graph API, as it is often used to interact with SharePoint data.

 

Azure Function as a Middleman

 

  • Log into the Azure Portal, and navigate to "Azure Functions".
  •  

  • Create a new Function App by clicking "Add". Fill in necessary details like the function app name and hosting details.
  •  

  • Once created, go to the new Function App and create a new function. Select an HTTP trigger for simplicity.
  •  

  • In the function's code editor, write the necessary code to call the Azure Cognitive Service. For instance, a Python example for Computer Vision service:

 

import requests
import json
import azure.functions as func

def main(req: func.HttpRequest) -> func.HttpResponse:
    key = "YOUR_COGNITIVE_SERVICE_KEY"
    endpoint = "YOUR_COGNITIVE_SERVICE_ENDPOINT"
    headers = {"Ocp-Apim-Subscription-Key": key, "Content-Type": "application/json"}
    params = {"visualFeatures": "Categories,Description,Color"}
    image_url = req.params.get("image_url")

    if not image_url:
        return func.HttpResponse("Image URL is required.", status_code=400)

    response = requests.post(endpoint + "/vision/v3.1/analyze", headers=headers, params=params, json={"url": image_url})
    
    if response.status_code == 200:
        return func.HttpResponse(response.text, status_code=200)
    else:
        return func.HttpResponse(response.text, status_code=response.status_code)

 

Integrate with Microsoft SharePoint

 

  • Use Microsoft Power Automate to call the Azure Function whenever an item is added or updated in SharePoint.
  •  

  • Create a new flow in Power Automate. Start with the "When an item is created or modified" trigger for SharePoint.
  •  

  • Add an action to "HTTP" to call the Azure Function. Pass necessary parameters like the document URL or any required details.

 

Test and Validate

 

  • Test the integration by adding or modifying an item in the configured SharePoint site. Monitor the flow to ensure it triggers the Azure Function successfully.
  •  

  • Check the Azure Function logs to verify it is receiving the data correctly and returning the processed information as expected.
  •  

  • Review the output within SharePoint to ensure that the desired cognitive service processes have been applied correctly.

 

Omi Necklace

The #1 Open Source AI necklace: Experiment with how you capture and manage conversations.

Build and test with your own Omi Dev Kit 2.

How to Use Microsoft Azure Cognitive Services with Microsoft SharePoint: Usecases

 

Intelligent Content Management System

 

  • Deploy Microsoft Azure Cognitive Services to automatically analyze and tag uploaded documents in a SharePoint library, enabling improved searchability of company resources.
  •  

  • Utilize Azure's form recognizer capability to extract data from scanned forms and images, automatically storing extracted data into SharePoint lists for easy accessibility and future reference.
  •  

  • Leverage language translation APIs to translate documents stored in SharePoint into multiple languages, enhancing collaboration in multinational teams.
  •  

 

Automated Document Processing Workflow

 

  • Set up a SharePoint list to initiate document processing workflows upon document submission, automatically triggering Azure Cognitive Services for necessary analysis and data extraction.
  •  

  • Create alerts and automated notifications via SharePoint when a document is processed, keeping teams informed of document availability and status changes.
  •  

  • Implement sentiment analysis using Azure text analytics on customer feedback documents, storing results in SharePoint for trend identification and service improvement initiatives.
  •  

 

Enhanced Security and Compliance

 

  • Utilize Azure's facial recognition to control and manage access to sensitive SharePoint documents, ensuring only authorized personnel can access specific content.
  •  

  • Integrate SharePoint's record management features with Azure's content moderation to ensure any uploaded content complies with organizational policies and regulatory requirements.
  •  

  • Automatically redact sensitive information from documents stored in SharePoint using Azure's text analytics, maintaining privacy and compliance within the organization.
  •  

 


from azure.ai.textanalytics import TextAnalyticsClient
from azure.core.credentials import AzureKeyCredential

# Sample code to connect Azure Cognitive Services

client = TextAnalyticsClient(endpoint="https://<your-cognitive-service>.cognitiveservices.azure.com/", credential=AzureKeyCredential("<your-key>"))

 

 

Intelligent Knowledge Retrieval

 

  • Integrate Microsoft Azure Cognitive Services to develop a sophisticated knowledge base within SharePoint, utilizing natural language processing (NLP) to understand user queries and provide precise information retrieval.
  •  

  • Deploy Azure's knowledge mining capabilities in SharePoint to automatically index and categorize large volumes of content, enabling users to quickly locate needed resources through intelligent search suggestions.
  •  

  • Implement Azure's QnA Maker service to transform traditional FAQ documents stored in SharePoint into dynamic, interactive chatbots, enhancing user engagement and accessibility.
  •  

 

Real-Time Language Assistance

 

  • Configure Azure Cognitive Services translation APIs to provide on-the-fly translation for SharePoint documents and content, fostering cross-cultural collaboration in diverse teams.
  •  

  • Enable multilingual communication by integrating Azure Speech Services to convert text within SharePoint documents into audio files in different languages, supporting auditory learning and comprehension.
  •  

  • Utilize Azure's speech-to-text service to transcribe and archive live meetings or webinars hosted on SharePoint, creating searchable transcripts for future reference and knowledge sharing.
  •  

 

Enhanced Data Insights and Visualization

 

  • Leverage Azure's cognitive services to perform in-depth data analysis on spreadsheets and datasets stored in SharePoint, extracting insights and trends for strategic decision-making.
  •  

  • Integrate Power BI with SharePoint to visualize data insights derived from Azure cognitive analytics, enabling stakeholders to access interactive dashboards and reports seamlessly.
  •  

  • Create automated data alerts and notifications for key metrics using SharePoint workflows connected with Azure Analytics, keeping teams informed of critical changes in data trends.
  •  

 

from azure.core.credentials import AzureKeyCredential
from azure.ai.language.questionanswering import QuestionAnsweringClient

# Sample code to connect QnA Maker with SharePoint knowledge base

client = QuestionAnsweringClient(endpoint="https://<your-cognitive-service>.cognitiveservices.azure.com/", credential=AzureKeyCredential("<your-key>"))

 

Omi App

Fully Open-Source AI wearable app: build and use reminders, meeting summaries, task suggestions and more. All in one simple app.

Github →

Order Friend Dev Kit

Open-source AI wearable
Build using the power of recall

Order Now

Troubleshooting Microsoft Azure Cognitive Services and Microsoft SharePoint Integration

How to integrate Azure Cognitive Services with SharePoint workflows?

 

Integrate Azure Cognitive Services

 

  • Create an Azure Cognitive Services account and obtain the endpoint and key from the Azure portal.
  •  

  • Register your web API application in Azure AD to secure your Cognitive Services API.

 

Set Up a SharePoint Workflow

 

  • Use SharePoint Designer or Microsoft Flow (Power Automate) to create a workflow where you can include calls to the Azure Cognitive Services API.
  •  

  • In the workflow, add actions that call an HTTP endpoint, using the data collected from SharePoint lists or libraries.

 

Call Azure Cognitive Services API

 

  • In your workflow, configure the HTTP Action with API’s URL, method (like POST), headers, and body.
  •  

  • Insert your Cognitive Services key in headers for authentication, and format the body with JSON as required.

 

{
  "documents": [
    {
      "language": "en",
      "id": "1",
      "text": "{{SharePointItemText}}"
    }
  ]
}

 

Process API Results

 

  • Enable the workflow to capture the API response and use it to update fields or trigger further actions within SharePoint.

 

Why is Azure Cognitive Services not recognizing documents in SharePoint?

 

Common Causes

 

  • Authentication Issues: Ensure Azure and SharePoint applications have proper authentication privileges. Check if the Azure service principal is granted necessary permissions on SharePoint.
  •  

  • File Format Support: Azure Cognitive Services might not support certain file types. Confirm that document formats are compatible with the Azure service you're using.
  •  

  • Network Configurations: Validate that network settings allow Azure services to access SharePoint. Troubleshoot for firewalls or proxy issues blocking the connection.

 

Code Implementation

 

Ensure your code correctly fetches documents from SharePoint:

 

from office365.sharepoint.client_context import ClientContext
from azure.ai.formrecognizer import DocumentAnalysisClient
from azure.core.credentials import AzureKeyCredential

site_url = "https://yoursharepointsite"
ctx = ClientContext(site_url).with_credentials("<Your Credentials>")
file = ctx.web.get_file_by_server_relative_url("/documents/docname")
azure_client = DocumentAnalysisClient(endpoint="<Your Endpoint>", credential=AzureKeyCredential("<Your Key>"))

# Replace this with actual file streaming
with file.open_binary_stream().execute() as file_data:
    poller = azure_client.begin_analyze_document("model_id", file_data)
    result = poller.result()

 

Best Practices

 

  • Logging: Implement detailed logging to capture authentication steps, file processing, and any API response statuses.
  •  

  • Error Handling: Use try-except blocks in your code to handle exceptions and provide informative error messages.

 

How to troubleshoot authentication issues between SharePoint and Azure Cognitive Services?

 

Troubleshoot Authentication Issues

 

  • Ensure Azure Cognitive Services credentials in SharePoint are correct. Check Azure portal for valid keys and endpoints.
  •  

  • Verify network connectivity. Ensure SharePoint can reach Azure services by checking firewall and network configurations.
  •  

  • Review App Settings. In the Azure portal, confirm any restrictions or configurations that might impact authentication, such as IP restrictions or VNET configurations.
  •  

  • Check for API misconfigurations. Ensure the API being called is correctly set in the Azure portal under APIs & Services.
  •  

  • Enable detailed logging. In Azure, enable logs for your Cognitive Services to get detailed error messages.

 

Code Verification

 

  • In SharePoint, ensure the correct headers are used for authentication. Use "Authorization: Bearer <YourToken>" for Azure services.
  •  

  • Sample code for initializing client:
from azure.cognitiveservices.language.textanalytics import TextAnalyticsClient
from msrest.authentication import CognitiveServicesCredentials

credentials = CognitiveServicesCredentials('YOUR-KEY-HERE')
client = TextAnalyticsClient(endpoint='YOUR-ENDPOINT-HERE', credentials=credentials)

 

  • Review error messages using Fiddler or browser developer tools for further clues.

 

Don’t let questions slow you down—experience true productivity with the AI Necklace. With Omi, you can have the power of AI wherever you go—summarize ideas, get reminders, and prep for your next project effortlessly.

Order Now

Join the #1 open-source AI wearable community

Build faster and better with 3900+ community members on Omi Discord

Participate in hackathons to expand the Omi platform and win prizes

Participate in hackathons to expand the Omi platform and win prizes

Get cash bounties, free Omi devices and priority access by taking part in community activities

Join our Discord → 

OMI NECKLACE + OMI APP
First & only open-source AI wearable platform

a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded a person looks into the phone with an app for AI Necklace, looking at notes Friend AI Wearable recorded
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
online meeting with AI Wearable, showcasing how it works and helps online meeting with AI Wearable, showcasing how it works and helps
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded
App for Friend AI Necklace, showing notes and topics AI Necklace recorded App for Friend AI Necklace, showing notes and topics AI Necklace recorded

OMI NECKLACE: DEV KIT
Order your Omi Dev Kit 2 now and create your use cases

Omi Dev Kit 2

Endless customization

OMI DEV KIT 2

$69.99

Make your life more fun with your AI wearable clone. It gives you thoughts, personalized feedback and becomes your second brain to discuss your thoughts and feelings. Available on iOS and Android.

Your Omi will seamlessly sync with your existing omi persona, giving you a full clone of yourself – with limitless potential for use cases:

  • Real-time conversation transcription and processing;
  • Develop your own use cases for fun and productivity;
  • Hundreds of community apps to make use of your Omi Persona and conversations.

Learn more

Omi Dev Kit 2: build at a new level

Key Specs

OMI DEV KIT

OMI DEV KIT 2

Microphone

Yes

Yes

Battery

4 days (250mAH)

2 days (250mAH)

On-board memory (works without phone)

No

Yes

Speaker

No

Yes

Programmable button

No

Yes

Estimated Delivery 

-

1 week

What people say

“Helping with MEMORY,

COMMUNICATION

with business/life partner,

capturing IDEAS, and solving for

a hearing CHALLENGE."

Nathan Sudds

“I wish I had this device

last summer

to RECORD

A CONVERSATION."

Chris Y.

“Fixed my ADHD and

helped me stay

organized."

David Nigh

OMI NECKLACE: DEV KIT
Take your brain to the next level

LATEST NEWS
Follow and be first in the know

Latest news
FOLLOW AND BE FIRST IN THE KNOW

thought to action

team@basedhardware.com

company

careers

events

invest

privacy

products

omi

omi dev kit

personas

resources

apps

bounties

affiliate

docs

github

help