Friday Fact: Existing Logic Apps with Service Bus trigger using peek lock cannot be changed from topic to queue or vice versa

Azure Service Bus stands out in cloud-based messaging services as a reliable and scalable solution that facilitates asynchronous communication between applications and services. Among its features, Peek Locks play a vital role in ensuring message reliability and processing integrity. However, you must be aware of limitations when attempting to deploy Logic Apps (at least Consumption) that Service Bus triggers with a peek lock.

But first, let’s explain briefly what peek lock means.

The Role of Peek Locks in Message Processing

Peek Locks is a mechanism within Azure Service Bus that provides message retrieval with acknowledgment semantics. When a message is fetched from a queue or topic subscription using Peek Lock mode, it remains invisible to other consumers until explicitly completed or abandoned. This ensures that messages are processed exactly once, even in the event of failures or transient errors.

Now that we know what peek lock means, let’s dive deep into the existing deployment limitation.

Understanding the Deployment Limitations in the development phase

Let’s assume that we had previously created and deployed to Azure a Logic App using the When a message is received in a topic subscription (peek-lock) trigger, and we realized that we have made a mistake and, in fact, we want to use a queue and not a topic.

In Visual Studio, we can easily delete that trigger and add the correct one: When a message is received in a queue (peek-lock). However, when we try to deploy those changes into Azure, the deployment fails with a similar error:

‘When_a_message_is_received_in_a_topic_subscription_(peek-lock)’ of current version of workflow ‘LA-DEMOSB’ has concurrency runtime configuration specified. Trigger concurrency runtime configuration cannot be removed once specified.

In this case, we’re trying to deploy a new version of the logic app from Visual Studio with queue peek lock, but unfortunately, there’s already a version of this logic app that uses a Topic Subscription with peek lock with the same name.

Solution: The solution to this problem is quite simple.

1º: Delete the current Logic App version from Azure Portal

2º: Deploy the Logic App again through Visual Studio.

Note that this problem only occurs with peek locks. It doesn’t happen if we use auto-complete.

To lazy to read? We’ve got you covered! Check out our video version of this content!

Hope you find this helpful! If you enjoyed the content or found it useful and wish to support our efforts to create more, you can contribute towards purchasing a Star Wars Lego for my son!

Author: Diogo Formosinho

Diogo Formosinho is a Enterprise Integration Consultant at DevScope

1 thought on “Friday Fact: Existing Logic Apps with Service Bus trigger using peek lock cannot be changed from topic to queue or vice versa”

Leave a Reply

Your email address will not be published. Required fields are marked *

turbo360

Back to Top