|

|  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 Dev Kit 2.

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 →

Order Friend Dev Kit

Open-source AI wearable
Build using the power of recall

Order Now

Troubleshooting Microsoft Azure Cognitive Services and New Relic Integration

Why is my Azure Cognitive Services data not appearing in New Relic dashboards?

 

Check Azure Monitoring Setup

 

  • Verify that Azure Monitor is configured to send telemetry data to New Relic. Incorrect setup can prevent data flow.
  •  

  • Ensure that the correct Azure subscription and resource group are configured in your New Relic integration.

 

New Relic API and Credentials

 

  • Ensure that the New Relic API key and account ID are correct and match your account details. Incorrect credentials will block data access.
  •  

  • Double-check that your New Relic account has the necessary permissions to access Azure data streams.

 

Data Pipeline and Network Issues

 

  • Inspect network configurations and firewall settings that might block data transfer between Azure and New Relic.
  •  

  • Review your data pipeline for any misconfigurations that could disrupt data collection and delivery.

 

az monitor metrics list --resource <resource-id> --metric <metric-name>

 

Validate Data Transformation

 

  • Check if there are any transformation issues in the data; mismatched schemas can lead to data not displaying.
  •  

  • Regularly update your data mapping strategies in New Relic to align with any changes in Azure data schemas.

 

How do I authenticate Azure Cognitive Services with New Relic?

 

Integrate Azure Cognitive Services with New Relic

 

  • Ensure you have active subscriptions for both Azure Cognitive Services and New Relic.
  •  

  • Get the keys and endpoint from the Azure portal for the Cognitive Service you want to monitor, like Computer Vision or Text Analytics.
  •  

  • Set up a web app or API that uses Azure Cognitive Services, and ensure it's generating logs that can be sent to New Relic.

 

Use the New Relic Agent for Logging

 

  • Install the New Relic agent based on your application's language (e.g., Java, Node.js).
  •  

  • Configure the New Relic agent by adding `newrelic.config` in your project with your license key and app name.
  •  

  • Modify your app's logging setup to forward logs to New Relic. For Node.js, include the New Relic logging API in your main script:

 

require('newrelic');

 

  • Deploy your app with logging enabled, and ensure logs flow into your New Relic dashboard.

What are the best practices for monitoring Azure API performance in New Relic?

 

Setup New Relic for Azure API

 

  • Install the New Relic APM agent in your Azure app service. Use environment variables to set the configuration or modify `newrelic.config` for detailed settings.
  • Ensure the app is properly instrumented for data reporting. Use New Relic's Azure Integration for enhanced monitoring.

 

Define Key Metrics

 

  • Monitor response time, error rates, and throughput. Utilize New Relic dashboards to visualize these metrics.
  • Set custom attributes in your Azure API code to capture additional context using `newrelic_record_custom_event()` method.

 

import newrelic.agent

newrelic.agent.record_custom_event('CustomEvent', {'attribute': 'value'})

 

Utilize Alerts and Dashboards

 

  • Create alert policies for key metrics. Configure thresholds for violations like high latency or error rates via New Relic Alerts.
  • Develop custom dashboards using NRQL queries to gain insights into Azure API performance trends.

 

Regular Reviews

 

  • Conduct periodic reviews of API performance data, correlating it with deployment changes or traffic spikes for root cause analysis.
  • Leverage New Relic's distributed tracing to analyze end-to-end request performance across your APIs.

 

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