As businesses navigate the end of BizTalk and seek potent data transformation solutions, Azure Logic Apps has surged to the forefront, offering an agile, serverless platform that simplifies workflow automation. My enthusiasm for Azure Logic Apps is fueled by its ease of use and its pivotal role in modernizing business processes. The integration of Azure OpenAI into Logic Apps is heralding a new era of AI-enhanced automation. This post explores the transformative potential of Azure Logic Apps, enhanced by AI, for businesses eager to leverage the latest in cloud and AI technologies.
Understanding Azure Logic Apps
Azure Logic Apps is a cloud-based service that helps you automate and orchestrate tasks, workflows, and business processes. It provides a visual designer to build workflows that integrate apps, data, services, and systems by automating tasks and business processes as “workflows.” Logic Apps is part of the Azure App Service suite, offering scalability, availability, and security, making it an ideal solution for integrating cloud resources and external services.
Key Features of Azure Logic Apps
- Visual Designer: Offers a drag-and-drop interface for building workflows, making it accessible to users with varying technical expertise.
- Connectors: Comes with a vast library of pre-built connectors, facilitating integration with various services and applications, such as Office 365, Salesforce, Dropbox, and now, Azure OpenAI and Azure AI Search. Which makes connecting and transforming data easy to multiple systems and SaaS providers.
- Scalability: Being serverless, it scales automatically to meet demand, ensuring high performance without the need to manage infrastructure.
- Condition-based Logic: Supports conditional statements, loops, and branches to create complex business logic.
Integrating Azure OpenAI with Logic Apps
The recent public preview of Azure OpenAI and Azure AI Search connectors marks a significant advancement in the capabilities of Logic Apps. These connectors bridge the gap between Logic Apps workflows and AI, enabling enterprises to harness the power of generative AI models like GPT-4 and AI-driven search functionalities within their automated workflows.
Azure OpenAI Connector
This connector allows Logic Apps to interact directly with Azure OpenAI services, enabling functionalities such as:
- Generating text completions or responses to queries based on your data.
- Extracting embeddings for data analysis and processing.

Azure AI Search Connector
With the AI Search connector, Logic Apps can:
- Index documents and data, making them searchable.
- Perform vector searches across indexed data, utilizing AI to understand the context and content of documents.

How to Use Azure Logic Apps with Azure OpenAI
Required AI Services
Access to an Azure OpenAI Service
If you already have an existing OpenAI Service and model you can skip these steps.
- Go to the Azure portal
- Click
Create a resource - In the search box type:
OpenAI. - In the search results list, click
CreateonAzure OpenAI. - Follow the prompts to create the service in your chosen subscription and resource group.
- Once your OpenAI service is created you will need to create a deployments for generating embeddings and chat completions.
- Go to your OpenAI service, under the
Resource Managementmenu pane, clickModel deployments - Click
Manage Deployments - On the
Deploymentspage clickCreate new deployment - Select an available embedding
modele.g.text-embedding-ada-002,model version, anddeployment name. Keep track of thedeployment name, it will be used in later steps. - Ensure your model is successfully deployed by viewing it on the
Deploymentspage - On the
Deploymentspage clickCreate new deployment - Select an available chat
modele.g.gpt-35-turbo,model version, anddeployment name. Keep track of thedeployment name, it will be used in later steps. - Ensure your model is successfully deployed by viewing it on theย
Deploymentsย page
- Go to your OpenAI service, under the
Access to an Azure AI Search Service
If you already have an existing AI Search Service you can skip to step 5.
- Go to the Azure portal.
- Click
Create a resource. - In the search box type:
Azure AI Search. - In the search results list, click
CreateonAzure AI Search. - Follow the prompts to create the service in your chosen subscription and resource group.
- Once your AI Search service is created you will need to create an index to store your document content and embeddings.
- Go to your search service on the
Overviewpage, at the top clickAdd index (JSON) - Go up one level to the root folder
ai-sampleand open theDeploymentfolder. Copy the entire contents of the fileaisearch_index.jsonand paste them into the index window. You can change the name of the index in thenamefield if you choose. This name will be used in later steps. - Ensure your index is created by viewing in on theย
Indexesย page
- Go to your search service on the
Follow these steps to create the Azure Standard Logic Apps project and deploy it to Azure:
- Open Visual Studio Code.
- Go to the Azure Logic Apps extension.
- Click
Create New Projectthen navigate to and select theSampleAIWorkflowsfolder. - Follow the setup prompts:
- Choose Stateful Workflow
- Press Enter to use the default
Statefulname. This can be deleted later - Select
Yesif asked to overwrite any existing files
- Update yourย
parameters.jsonย file:- Open the
parameters.jsonfile - Go to your Azure OpenAI service in the portal
- Under theย
Resource Managementย menu clickยKeys and Endpoint- Copy the
KEY 1value and place its value into thevaluefield of theopenai_api_keyproperty - Copy the
Endpointvalue and place its values into thevaluefield of theopenai_endpointproperty
- Copy the
- Under theย
Resource Managementย menu clickยModel deployments- Click
Manage Deployments - Copy the
Deployment nameof the embeddings model you want to use and place its value into thevaluefield of theopenai_embeddings_deployment_idproperty - Copy the
Deployment nameof the chat model you want to use and place its value into thevaluefield of theopenai_chat_deployment_idproperty
- Click
- Under theย
- Go to your Azure AI Search service in the portal
- On the
Overviewpage copy theUrlvalue. Place its value in thevaluefield of theaisearch_endpointproperty - Under the
Settingsmenu clickKeys. Copy either thePrimaryorSecondaryadmin key and place its value into thevaluefield of theaisearch_admin_keyproperty
- On the
- Go to your Tokenize Function App
- On the
Overviewpage. Copy theURLvalue and place its value into thevaluefield of thetokenize_function_urlproperty. Then append/api/tokenize_triggerto the end of the url.
- On the
- Open the
- Deploy your Logic App:
- Go to the Azure Logic Apps extension
- Click
Deploy to Azure - Select a Subscription and Resource Group to deploy your Logic App
- Go to the Azure portal to verify your app is up and running.
- Verify your Logic Apps contains two workflows. They will be named:ย
chat-workflowย andยingest-workflow.
Run your workflows
Now that the Azure Function and Azure Logic App workflows are live in Azure. You are ready to ingest your data and chat with it.
Ingest Workflow
- Go to your Logic App in the Azure portal.
- Go to your
ingestworkflow. - On the
Overviewtab click the drop downRunthen selectRun with payload. - Fill in the JSON
Bodysection with yourfileUrlanddocumentName. For example:{ "fileUrl": "https://mydata.enterprise.net/file1.pdf", "documentName": "file1" }NOTE: The expected file type is pdf. - Click
Run, this will trigger theingestworkflow. This will pull in your data from the above file and store it in your Azure AI Search Service. - View theย
Run Historyย to ensure a successful run.
Chat Workflow
- Go to your Logic App in the Azure portal.
- Go to your
chatworkflow. - On the
Overviewtab click the drop downRunthen selectRun with payload. - Fill in the JSON
Bodysection with yourprompt. For example:{ "prompt": "Ask a question about your data?" } - Click
Run, This will trigger thechatworkflow. This will query your data stored in your Azure AI Search Service and respond with an answer. - View the
Run Historyto see the Response from your query.
Benefits of Using Azure Logic Apps with OpenAI
- Enhanced Efficiency: Automates repetitive tasks, freeing up valuable time for strategic work.
- Innovation: Enables businesses to leverage AI capabilities, fostering innovation and providing insights that were previously unattainable.
- Scalability and Flexibility: Easily scales with your business needs, and workflows can be modified as requirements change.
- Cost-Effective: You pay only for what you use, making it a cost-effective solution for businesses of all sizes.
Conclusion
The integration of Azure OpenAI and Azure AI Search with Azure Logic Apps represents a leap forward in the automation of business processes, allowing enterprises to seamlessly incorporate AI capabilities into their workflows. This not only enhances operational efficiency but also paves the way for innovative solutions to complex business challenges. By leveraging these advanced tools, businesses can stay ahead in the competitive landscape, making informed decisions, and driving growth through intelligent automation.
As Azure continues to expand its offerings, the potential for Logic Apps to revolutionize business processes grows exponentially. Embracing these technologies today can position your business as a leader in the digital transformation journey tomorrow.
Check the full logic app ai-sample at GitHub.
