How to Implement OpenAI in Azure Logic Apps: A Comprehensive Guide
Hello! 👋😁 Today, I conducted a few experiments on using the Azure OpenAI service within Azure Logic Apps and achieved the expected results. I wanted to share my experience with you! 😊
Let’s explore the approach:
Things You’ll Need:
1. Create a Standard Logic app
https://rit-17.medium.com/lets-create-together-logic-app-c3e35f02a8a5
2. Create a Azure Open AI chatbot
https://rit-17.medium.com/lets-create-together-logic-app-c3e35f02a8a5
After creating both the Azure Logic App and the Chatbot model in Azure OpenAI Studio, I designed my workflow so that whenever a client asks a question, the chatbot generates an appropriate response. However, you have the flexibility to design your workflow in many different ways and utilize the AI chatbot according to your specific requirements.

In the trigger ‘When an HTTP request is received’, I am passing the ‘Question’ parameter as an input in the body schema.

In the Http Action the url format should be:
get {your-resource-name}
and {Model-Name}
from you Azure OpenAI Playground. API version of your chat Model.
In the Header give “Content-Type” and “Your Azure OpenAI API Key” and in the body pass the content.
{
"messages": [
{
"role": "user",
"content": "@{triggerBody()?['Question']}" #here question is a parameter that is passed in the body of http trigger.
}
],
"max_tokens": 1000
}

In the ‘Response’ action the function expression will retrieve the content generated by the chatbot from the ‘HTTP’ action and deliver it in the ‘Response’ action.
Function expression : body(‘HTTP’)[‘choices’][0][‘message’][‘content’]

Now its time to run and test the workflow:
So I have given here Input:

Below I got the expected Output:

Using Azure OpenAI service in a Logic App workflow you can generate many real time project scenarios to automate tasks like responding to customer inquiries, providing quick answers to frequently asked questions, or summarizing large documents. Here are some scenarios you might consider:
1. Customer Support Chatbot
- Scenario: A Logic App workflow is triggered when a customer sends a message through a support channel (like a web chat or email).
Steps:
- The Logic App receives the message.
- It sends the message to the Azure OpenAI service to generate a chat completion.
- The response from Azure OpenAI is sent back to the customer.
- Use Case: Automate responses to common questions such as order status, account information, or troubleshooting steps.
2. Email Summary Generator
- Scenario: A workflow that is triggered by a new email in a shared mailbox.
Steps:
- Logic App triggers on the arrival of a new email.
- Extract the email content and send it to Azure OpenAI for summarization.
- The summarized text is then forwarded to a designated recipient or a team channel.
- Use Case: Efficiently summarize lengthy emails or threads to save time for the team.
3. Weekly Report Generation
- Scenario: Automatically generate weekly reports for a project team based on data from various sources.
Steps:
- Logic App is scheduled to run every Friday evening.
- It aggregates data from various sources like Azure SQL Database, Azure Blob Storage, etc.
- The data is sent to Azure OpenAI to generate a concise report.
- The report is then sent to team members via email or posted on Microsoft Teams.
- Use Case: Automate report generation to keep team members updated with minimal manual effort.
4. Feedback Analysis Automation
- Scenario: A company wants to analyze customer feedback from surveys and reviews.
Steps:
- Logic App triggers on the submission of new survey responses or customer reviews.
- The responses are sent to Azure OpenAI for sentiment analysis and categorization.
- The categorized feedback is stored in Azure Table Storage or SQL Database for future analysis.
- Use Case: Automatically categorize and analyze feedback to identify trends or issues.
5. Automated Meeting Minutes Creation
- Scenario: After a virtual meeting, generate a summary of the key points discussed.
Steps:
- Logic App triggers on the upload of a meeting transcript (audio-to-text conversion).
- The transcript is sent to Azure OpenAI for summarization and extraction of action items.
- The summary and action items are emailed to all meeting participants.
- Use Case: Save time in creating meeting minutes and ensure accuracy in capturing key points.
6. Real-Time Translation
- Scenario: Translate customer messages in real-time for a multilingual support team.
Steps:
- Logic App triggers on receiving a new customer message.
- Detects the language and sends the message to Azure OpenAI for translation into the preferred language.
- Sends the translated message to the support team or customer.
- Use Case: Provide real-time translation to support customers in multiple languages.
7. Incident Response Assistant
- Scenario: Automate responses to incidents reported in a monitoring system.
Steps:
- Logic App triggers when an incident is reported by a monitoring tool (like Azure Monitor).
- It gathers relevant information and sends it to Azure OpenAI to suggest possible causes and resolutions.
- The suggested responses are sent to the on-call engineer or posted on an incident management platform.
- Use Case: Reduce the response time and improve the accuracy of the first response to incidents.
Thanks for stopping by! Your visit means a lot. Please Follow me😊 Stay tuned for more content. Exciting stuff coming your way soon! 🚀 #StayTuned.
Post Comment
You must be logged in to post a comment.