Building an Agentic Service Bus Plugin With Logic App agent loop.

Building an Agentic Service Bus Plugin With Logic App agent loop.

In this article, we'll explore how to supercharge your Service Bus plugins by combining them with a Logic App and an agent loop.

Take a look at this video before reading on to understand what we are building.

Watch 2X

Creating a Service Bus

Let's create a service bus in basic SKU as shown below. We've created a queue inside the service bus.

Article content

Register a service bus plugin

Now, register a service bus endpoint as shown in the below steps.

Article content

Add your connection string here.

Article content

Now register the step as shown below.

Article content


Creating a consumption logic app

Create a consumption logic app, we can also choose a workflow logic app but for this demo we'll stay with a consumption logic app

Article content

The key bits to select are the type of the workflow

  • Conversational Agents : Choose this if you want an agent loop app with chat interface.
  • Autonomous Agents : Choose this if you want an orchestrating agent loop. We choose this for our scenario

Article content

Create the orchestration in the logic app

The most beautiful part begins now 😀😀.

  • Create a service bus trigger with your service bus queue connection.
  • Convert the received payload from Base64 to JSON.

base64ToString(triggerBody()?['ContentData'])        


Article content

Configure the agent loop

See the configuration below, we already know the JSON structure dispatched to the service bus's endpoint by our plugin.

We give the agent clear instructions about how to read the values we are interested in.

Article content
This makes the orchestration extremely easier, because, regardless of the complexity of the JSON, now you've the capability to read the desired values and generate further text on it in one single instructions, that's the real power of AI


Add the tool(s)

This is the next beauty. Notice how we extract information from agent's output in new parameters that we can further use in the orchestration.

  • Add a tool.
  • Add parameters to tools and give clear instructions on how to read values from the agent's output.
  • Create parameters with clear insturctions.

Article content

How many tools could be added?

Add as many as you want, the agent will automatically invoke the right tool based on how well you describe them, besides, every tool can have one or more parameters extracted from the agent's output.

Article content

Extract the desired values.

Now that you've defined your parameters you can use them just like any other logic app action step.

Article content

Finally, we update Dataverse using a WebApi call.

Article content







Awesome Shashank! I implemented something similar using copilot studio triggers for an “invisible agent” to assess some some geographical data and then reach out to the web to find the lat and long of the place (port in this case) and then update the row using MCP. Good stuff here!

To view or add a comment, sign in

More articles by Shashank Bhide

Others also viewed

Explore content categories