|

|  How to Integrate Microsoft Azure Cognitive Services with New Relic

How to Integrate Microsoft Azure Cognitive Services with New Relic

January 24, 2025

Learn how to seamlessly integrate Microsoft Azure Cognitive Services with New Relic to enhance monitoring and optimize performance in your applications.

How to Connect Microsoft Azure Cognitive Services to New Relic: a Simple Guide

 

Set Up Your Azure Cognitive Services

 

  • Create an Azure account if you haven't already at Azure Portal.
  •  

  • Navigate to the Azure Marketplace and provision the desired Cognitive Service (such as Text Analytics, Computer Vision, or Translator).
  •  

  • Once created, obtain the API key and the service endpoint. Go to the "Keys and Endpoint" section in the Azure Portal for your resource.

 

Set Up New Relic

 

  • Create or log into your New Relic account at New Relic.
  •  

  • Download the New Relic agent for your environment (Node.js, Python, Java, etc.) from the New Relic Docs.
  •  

  • Integrate the New Relic agent into your application by following the setup instructions for your specific language or framework.

 

Integrate Azure Cognitive Services with Your Code

 

  • Add Axios (or a similar library) to your project for making HTTP requests to the Azure Cognitive Services API endpoints. Install via a package manager like npm for Node.js:

 

npm install axios

 

  • Make an HTTP request from your application to the Azure Cognitive Service using the endpoint and API key:

 

const axios = require('axios');
const endpoint = 'YOUR_AZURE_ENDPOINT';
const apiKey = 'YOUR_AZURE_API_KEY';

async function analyzeText(text) {
  try {
    const response = await axios.post(`${endpoint}/text/analytics/v3.0/sentiment`, { 
      documents: [{ id: '1', language: 'en', text: text }] 
    }, 
    {
      headers: { 'Ocp-Apim-Subscription-Key': apiKey }
    });
    return response.data;
  } catch (error) {
    console.error(error);
  }
}

 

Send Telemetry Data to New Relic

 

  • After receiving a response from the Azure API, capture any relevant metrics or data (e.g., response time, sentiment scores) to send to New Relic.
  •  

  • Use the New Relic agent in your application to send custom events or logs containing Azure response data:

 

const newrelic = require('newrelic');

function sendMetricsToNewRelic(sentimentData) {
  newrelic.recordCustomEvent('SentimentAnalysis', {
    score: sentimentData.documents[0].sentiment,
    requestTime: sentimentData.modelVersion
  });
}

 

Verify Integration

 

  • Run your application and trigger interactions that make use of Azure Cognitive Services.
  •  

  • Verify the requests are successful by checking the logs or console output in your application.
  •  

  • Log into New Relic and confirm that the custom events or metrics are appearing in your dashboard, indicating successful data transmission.

 

Omi Necklace

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

Build and test with your own Omi.

How to Use Microsoft Azure Cognitive Services with New Relic: Usecases

 

Enhancing Customer Service with Azure Cognitive Services and New Relic

 

  • Contextual Overview: Businesses are increasingly looking to streamline their customer service operations while ensuring high-efficiency and enhanced customer satisfaction. Integrating Azure Cognitive Services with New Relic allows businesses to leverage powerful AI-driven insights while maintaining top-notch application performance and availability.
  •  

  • Sentiment Analysis and Monitoring: Azure Cognitive Services, particularly the Text Analytics API, can be employed to perform sentiment analysis on customer interactions, providing valuable insights about customer satisfaction and support quality.
  •  

  • Application Performance Monitoring: New Relic complements this by providing real-time monitoring of the application handling the customer interactions, ensuring that any issues affecting the performance or availability of the sentiment analysis system are quickly identified and resolved.

 

Implementing the Combined Solution

 

  • Data Processing: Use Azure Cognitive Services to process customer service chat logs, emails, and feedback forms. Analyze this data to extract sentiment scores, key phrases, and language understanding insights.
  •  

  • Visualizing Insights: Export these insights into custom dashboards using tools like Power BI for better visualization and strategic decision-making. This aids in identifying trends in customer satisfaction and common issues.
  •  

  • Monitoring and Optimization: Simultaneously, deploy New Relic to monitor the infrastructure, focusing on metrics such as response times, error rates, and throughput of sentiment analysis services.
  •  

  • Automation Triggers: Set up alert rules in New Relic to automatically notify IT teams of anomalies or critical performance issues, enabling quick resolution to maintain optimal service levels.

 

Benefits and Outcomes

 

  • Enhanced Service Quality: By understanding the sentiment of customer interactions, support teams can improve response strategies, leading to higher customer satisfaction.
  •  

  • Reliable Operations: Continuous performance monitoring ensures that the sentiment analysis application runs smoothly, contributing to uninterrupted service delivery.
  •  

  • Proactive Issue Resolution: Real-time alerts and insights from New Relic facilitate proactive issue resolution, minimizing downtime and enhancing the overall experience for both staff and customers.
  •  

  • Strategic Planning: Rich insights from sentiment analysis provide valuable data for strategic planning, helping businesses to tailor services to meet customer demands more effectively.
# Sample Python code for sentiment analysis using Azure Text Analytics

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

# Input your Azure credentials and endpoint
key = "YOUR_COGNITIVE_SERVICES_KEY"
endpoint = "YOUR_COGNITIVE_SERVICES_ENDPOINT"

# Initialize TextAnalyticsClient
client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))

def sentiment_analysis_example(client):

    documents = ["I loved the customer service!", "The support agent was not helpful."]

    response = client.analyze_sentiment(documents=documents)
    for document in response:
        print(f"Document Sentiment: {document.sentiment}")

sentiment_analysis_example(client)

 

Personalized Healthcare Services with Azure Cognitive Services and New Relic

 

  • Contextual Overview: In the modern healthcare landscape, personalized patient experiences are important for enhancing healthcare delivery. By integrating Azure Cognitive Services with New Relic, healthcare providers can offer AI-driven, personalized care insights while ensuring reliable service performance and uptime.
  •  

  • Patient Data Analysis: Utilize Azure Cognitive Services to process and analyze patient data such as medical notes, lab reports, and feedback forms. Extract insights including sentiment, key medical terms, and patterns that may correlate with patient experiences and outcomes.
  •  

  • Real-Time System Monitoring: Leverage New Relic to provide continuous real-time monitoring of healthcare applications and infrastructure, ensuring that the underlying systems supporting patient data analysis are performing optimally.

 

Implementing the Integrated Solution

 

  • Data Integration: Collect diverse patient data from various sources into a centralized system. Use Azure Cognitive Services to analyze this data, deriving actionable insights related to patient preferences, conditions, and care pathways.
  •  

  • Insight Visualization: Integrate these insights into visual dashboards to help healthcare providers make informed decisions. Tools like Power BI can create compelling visualizations for healthcare staff and management.
  •  

  • Performance Assurance: Deploy New Relic to monitor the healthcare infrastructure, focusing on system metrics such as response times, data processing latency, and error rates to ensure smooth operation of data analytics services.
  •  

  • Alerting and Response: Establish automatic alerts in New Relic to notify the IT team of deviations from normal performance levels, allowing for timely interventions to address any issues, thereby ensuring system reliability.

 

Benefits and Outcomes

 

  • Improved Patient Experience: By gaining a deeper understanding of patient sentiments and preferences, healthcare providers can tailor services to better meet patient needs, leading to improved satisfaction and outcomes.
  •  

  • System Reliability: Continuous monitoring by New Relic ensures that the healthcare analytics systems are operating without disruptions, facilitating consistent delivery of personalized healthcare services.
  •  

  • Proactive Issue Handling: Real-time monitoring and alerts enable swift resolution of performance issues, minimizing the impact on healthcare services and ensuring uninterrupted access to critical systems.
  •  

  • Data-Driven Care Strategies: Analysis of patient data leads to richer insights that inform care strategies, helping healthcare providers to design effective, personalized treatment plans that improve patient outcomes.
# Sample Python code for healthcare data sentiment analysis using Azure Text Analytics

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

# Input your Azure credentials and endpoint
key = "YOUR_COGNITIVE_SERVICES_KEY"
endpoint = "YOUR_COGNITIVE_SERVICES_ENDPOINT"

# Initialize TextAnalyticsClient
client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))

def healthcare_sentiment_analysis(client):

    documents = ["The doctor was very attentive and kind.", "I waited too long for my appointment."]

    response = client.analyze_sentiment(documents=documents)
    for document in response:
        print(f"Document Sentiment: {document.sentiment}")

healthcare_sentiment_analysis(client)

Omi App

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

Github →

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