Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (2024)

Semantic Kernel is a framework that integrates natural language processing (NLP) and AI into applications, making it easier to use advanced AI models. It is particularly powerful when combined with plugins, which extend its capabilities by connecting to a variety of external services.

Integrating Logic Apps as a plugin into Semantic Kernel enhances its functionality by providing access to over 1000 connectors, something that my colleague. Matthew has written about in the past. This integration allows for seamless connections with cloud services, on-premises systems, and hybrid environments. By using these plugins, customers can automate complex workflows, trigger actions, and interact with multiple systems. They can also effortlessly integrate their applications with diverse external systems, enabling them to leverage advanced features without the need for extensive custom development, thus saving time and resources.

So, let’s take a look at how to set up this integration. I have included sample hereon GitHub to clone so you can follow through.

Here are the steps:

  1. Setting up a Logic App
  2. Deploying an OpenAI model
  3. Configuring Easy Auth
  • Set up app registration
  • Add EasyAuth to Logic App (Standard)
  • Provide authentication details in the Semantic Kernel’s Program.cs file
  • Adding Logic App as plugin in Semantic Kernel
  • Testing the plugin
    1. Setting up a Logic App

    I have a Logic App (Standard) with two workflows:

    • One that retrieves active tickets for a particular location passed in as JSON payload
    • Another that provides weather updates also for a location

    Both workflows use HTTP request-based triggers. Add a comment in the trigger describing the prompt that will trigger the workflow. For example, for the workflow that retrieves active tickets, you might use “retrieves active tickets” from Dataverse.

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (1)

    Make sure to have HTTP request trigger and response action so that the Semantic Kernel planner knows which workflow to call and return the appropriate response.

    1. Configuring OpenAI

    Create an OpenAI resource and , as you'll need it along with the model details for the environment variables of the Semantic Kernel app. Here is where you can find the API key and endpoint in the OpenAI resource

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (2)

    Next, navigate to Azure OpenAI Studio from the “Overview” page of your newly created resource. Then, create a model deployment in the AI Studio.

    Keep in mind:

    • Function calling is not supported by many OpenAI models. I made the mistake of using gpt-35-turbo, but with 0301 version, which did not work with Semantic Kernel. Check that support function calling and create deployment. I used GPT-4o as my base model.
    • Set a high token limit to prevent errors when your conversation exceeds the maximum token limit. I set it to 20k tokens per minute.

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (3)

    1. Configuring Easy Auth

    Easy Auth for Logic Apps is a feature that provides built-in authentication and authorization, making it simple to secure your workflows. It supports various authentication providers like Azure Active Directory, Google, and Facebook, allowing users to log in with their existing credentials. Easy Auth handles token validation and authorization checks, ensuring that only authorized users can access your Logic Apps. This streamlined setup enhances security by protecting workflows and sensitive data without the need for custom code.

    I have divided it in 3 sections to help with visualizing how to configure EasyAuth.

    • Create app registration:

    In Azure Portal, search for “App registration”. If you do not already have one, please create a new app registration. Here is my App registration which has ClientID and other details that we will add in our Logic App in the next step.

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (4)

    Next, let’s add Scope which we will use in our Semantic Kernel application. Navigate to Manage->Expose an API to create a new Scope for your app registration. Fill out the necessary details, it would look something like this:

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (5)

    • Add EasyAuth to Logic App:
      Our team recently released a UI to help with configuring EasyAuth on your app. Follow these steps to fill out details to successfully set it up:
    1. Open your Logic App (Standard) in Azure Portal
    2. Navigate to Settings -> Authentication in your Logic App (Standard)
    3. Click on “Add identity provider”

      Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (6)

    4. Client ID can be added from your app registration’s Overview page as shown in image from last step
    5. Issuer URL: This is the URL of the identity provider that issued the token, it is in the format: https://sts.windows.net/{TenantID}

    Note that you can also find TenantID from the “Overview” page of your app registration, just like how you found clientID

    6. Allowed token audiences: Set this to the Application ID URI of your app. You can find that property in your App registration’s Manage->Expose an API blade in Portal TOC. It would be something like this:

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (7)

    7. Additional checks: Here is what you need to check for Client Application, Identity and Tenant requirements:

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (8)

    Click on “Add”. The identity provider would look something like this after adding:

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (9)

    • Provide authentication details in Semantic Kernel:
      In the Program.cs file, there are a few authentication details that need to be filled out. Follow the steps to get the right values:
      1. ClientId and TenantId: this is the same as the one you copy/pasted from the App registration in previous steps
      2. Authority: it will be in the format:
        string Authority = $"https://login.microsoftonline.com/{Tenant_ID}";
      3. Scopes: this array variable will be the scope that we created in our app registration. It can be found in your App registration, Manage->Expose an API

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (10)

    And that is all you need to complete configuring EasyAuth successfully.

    1. Adding Logic App as plugin in Semantic Kernel

    With all the variables defined, you can now add the plugin to the Program.cs file of your Semantic Kernel application. Additionally, I've attached a sample on GitHub that you can clone to easily set up the application locally and get started.

    Use the ImportPluginFromOpenAPIAsync() method, replacing the pluginName and uri parameters with the desired plugin name and name of your Logic App respectively, to add the plugin. It would look like this

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (11)

    To find the full code for Program.cs, please go to the sample GitHub sample attached or take a look at my colleague, Xuhong's blog on how she plugs in logic app using the OpenAPI method.

    5. Testing the plugin

    Open the VS Code terminal and run the build command to identify any issues. Then, use dotnet run to start the application. You will be prompted to sign in from your account, and once authentication is complete, you can start conversing with the assistant.

    Given the integration, you can ask questions like “What is the weather in Seattle” or “Retrieve all active tickets in Kirkland,” which should trigger the appropriate Logic App (Standard) workflow to get weather or get tickets. It will also pass in the location parameter as JSON payload to the workflow. Here is how my conversation looks like

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (12)

    Looking at logic app workflow that was triggered, one can see the run execution so it’s easy to visualize and troubleshoot what went wrong in your workflow plugin.

    Here is what the run history looks like of the workflow being called:

    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (13)

    Conclusion:

    Integrating Logic Apps as a plugin in SDKs like Semantic Kernel opens new possibilities for pro-developers to utilize plugins beyond traditional languages like Python, .NET, and Java. With the extensive connectivity provided by Logic Apps, developers can interact with any system, extending beyond just RAG to more advanced agent capabilities for task completion. Additionally, nested workflows can function as separate agents to handle different aspects of a task based on the prompts provided. We invite your feedback on how we can enhance our platform capabilities to better support agent-based applications.

    Appendix:

    • https://techcommunity.microsoft.com/t5/fasttrack-for-azure/integrating-logic-app-with-semantic-kerne...
    • https://devblogs.microsoft.com/semantic-kernel/connect-logic-apps-1400-connectors-to-semantic-kernel...
    Integrate Logic App workflows as plugins with Semantic Kernel: Step-by-step guide (2024)

    FAQs

    What are plugins in the Semantic Kernel? ›

    At a high-level, a plugin is a group of functions that can be exposed to AI apps and services. The functions within plugins can then be orchestrated by an AI application to accomplish user requests. Within Semantic Kernel, you can invoke these functions automatically with function calling.

    Can a logic app have multiple workflows? ›

    With a Standard logic app, you can create and run multiple workflows in the same single logic app resource and tenant. With this 1-to-many mapping, these workflows share resources, such as compute, processing, storage, and network, providing better performance due to their proximity.

    How to enable logic apps in Azure? ›

    In the Azure portal, open your Standard logic app resource. On the logic app menu, under Workflows, select Workflows. In the checkbox column, select the workflow to disable or enable. On the Workflows pane toolbar, select Disable or Enable.

    What does every logic app workflow begin with? ›

    Each workflow always starts with a single trigger operation, after which you must add one or more action operations. The first operation in any workflow that specifies the criteria to meet before running any subsequent operations in that workflow.

    What are the three types of plugins? ›

    However, Avid's DAW Pro Tools can only read AAX plugins. The three most common audio plugin types are VST, AU, and AAX. In other words, audio plugin formats are associated with different DAWs and operating systems.

    What is Semantic Kernel good for? ›

    Semantic Kernel is a lightweight, open-source development kit that lets you easily build AI agents and integrate the latest AI models into your C#, Python, or Java codebase. It serves as an efficient middleware that enables rapid delivery of enterprise-grade solutions.

    How do I deploy logic app workflow in Azure? ›

    In Azure Pipelines, create an empty pipeline. Choose the resources you need for the pipeline, such as your logic app template and template parameters files, which you generate manually or as part of the build process. For your agent job, find and add the ARM Template deployment task. Configure with a service principal.

    How do I connect my logic app to Azure function? ›

    In the Create Connection pane, follow these steps:
    1. Provide a Connection Name for the connection to your function app.
    2. From the function apps list, select your function app.
    3. From the functions list, select the function, and then select Add Action, for example:

    What is the standard workflow in logic apps? ›

    The workflow of a Logic App in the Standard pricing plan is referred to as standard workflow. The Logic App Standard resource type allows customers to create two different types of workflows within the same Logic App: Stateful workflow and Stateless workflow.

    Can a single logic app have only one workflow? ›

    A single logic app can have multiple stateful and stateless workflows. Workflows in a single logic app and tenant share the same processing (compute), storage, network, and so on. Data stays in the same region where you deploy your logic apps.

    How is the workflow curated in logic apps? ›

    The workflow assistant delivers curated information based on reputable knowledge sources, such as the Azure Logic Apps documentation on Microsoft Learn, connector schemas, and tech community blogs. The assistant can also build responses using the currently open workflow in the designer.

    What is the difference between a logic app and an Azure function? ›

    Azure Functions is a serverless compute service, whereas Azure Logic Apps is a serverless workflow integration platform. Both can create complex orchestrations. An orchestration is a collection of functions, or actions in Azure Logic Apps, that you can run to complete a complex task.

    What is a kernel plugin? ›

    The kernel plugin adds to the configuration options provided by the generic kbuild plugin to help build kernel snaps.

    What are plugins and examples? ›

    Plugins are also known as add-ons, extensions, or modules. They are integrated into the software to provide additional functionalities. For example, if you are using a web browser, you can install an ad-blocker plugin that will help you get rid of the unwanted ads you get while surfing the web.

    What are plugins in AI? ›

    An AI plugin typically refers to a software component or module that integrates artificial intelligence capabilities into an existing application or platform. It extends the functionality of the application by providing AI-driven features or services.

    What are plugins in vulnerability scanning? ›

    Plugins contain vulnerability information, a generic set of remediation actions, and the algorithm to test for the presence of the security issue.

    References

    Top Articles
    Skillshare vs. Udemy: Was ist das Beste im Jahr 2024? - EduReviewer
    How To Organize A SkillShare And Shift The Culture Of Your Community
    Stockmans Meat Company
    Craigslist Apartments For Rent Cheap
    Lkq Pull-A-Part
    Ssm Health Workday App
    Dover Nh Power Outage
    South Park Season 26 Kisscartoon
    Unveiling The Voice Behind Maui: The Actor Behind The Demigod
    Yogabella Babysitter
    Restaurants Near Defy Trampoline Park
    Mets Game Highlights
    Configuring Fail2ban with Traefik
    National Weather Denver Co
    Dallascowgirl Leaked Of
    Nancy Pazelt Obituary
    60 Days From May 31
    Craigslist Apartment Los Angeles
    Craigslist Westchester Cars For Sale By Owner
    What To Do With Mysterious Camera In Sakura Stand
    Downloadhub Downloadhub
    Naval Academy Baseball Roster
    102Km To Mph
    Greenville Daily Advocate Greenville Ohio
    Amex Platinum Cardholders: Get Up to 10¢ Off Each Gallon of Gas via Walmart Plus Gas Discount
    Funny Shooter Unblocked
    Rachel Campos-Duffy - Net Worth, Salary, Age, Height, Bio, Family, Career
    Lolalytics Aram
    Dicks Sporting Good Lincoln Ne
    Walgreens On 37Th And Woodlawn
    Statek i zarządzanie załogą w Assassin's Creed Odyssey - Assassin's Creed Odyssey - poradnik do gry | GRYOnline.pl
    619-354-3954
    Adriana Zambrano | Goosehead Insurance Agent in Metairie, Louisiana
    Wayne Carini How Tall
    Alloyed Trident Spear
    Southeast Ia Craigslist
    Alison Pest Control
    Stark Cjis Court Docket
    Urgent Care Near Flamingo Crossings Village
    Theatervoorstellingen in Roosendaal, het complete aanbod.
    Bulk Amateur 51 Girls Statewins Leak – BASL058
    Justina Morley Now
    Www.cvs/Otchs/Simply
    Pensacola Tattoo Studio 2 Reviews
    How To Get Mini Tusks In Blox Fruits
    Apphomie.com Download
    Directions To 401 East Chestnut Street Louisville Kentucky
    Sun Massage Tucson Reviews
    Easy Pickled Coleslaw (with Canning Video)
    How Big is a 4×6 Photo?(Inch, cm, mm, Ft, Pixels) - PhotographyAxis
    Rocky Aur Rani Kii Prem Kahaani - Movie Reviews
    Fitgirl Starfield
    Latest Posts
    Article information

    Author: Mr. See Jast

    Last Updated:

    Views: 6230

    Rating: 4.4 / 5 (75 voted)

    Reviews: 90% of readers found this page helpful

    Author information

    Name: Mr. See Jast

    Birthday: 1999-07-30

    Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

    Phone: +5023589614038

    Job: Chief Executive

    Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

    Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.