Share via

Service bus Complete action failing in logic app on VS Code

Sumit Gaur 415 Reputation points
2023-08-29T11:20:28.5033333+00:00

I am using the logic app built-in connector for service to receive a message from a queue in peek lock mode and then after processing the message using the complete action to complete the message to have it removed from the queue, but on the complete action it failed with the following error

"The service provider action failed with error code 'VNetPrivatePortsNotConfigured' and error message 'Using this service provider action in stateful workflows requires VNet integration and the site configuration vnetPrivatePortsCount to be set to a value greater than or equal to 2."

on reading some article i can have it work on the portal but it is not working on vs code and even though adding the vnetPrivatePortsCount to the local.settings.json file, it still throws the same error, looking at the document it looks to be site config property but i am not sure where it will configured locally to have the action working. can you please advise or is this scenario is still not supported in vs code?

Azure Service Bus
Azure Service Bus

An Azure service that provides cloud messaging as a service and hybrid integration.

Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Sudhir Kumar Sah 0 Reputation points
    2026-03-31T22:58:03.7766667+00:00

    Below seetings in local.settings.json worked for me.

    "WEBSITE_PRIVATE_IP": "127.0.0.1",
    "WEBSITE_PRIVATE_PORTS": "2",
    

    User's image

    0 comments No comments

  2. Mike Urnun 9,792 Reputation points Moderator
    2023-09-12T05:13:30.6233333+00:00

    Hello @Sumit Gaur Thanks for reaching out, and sorry for the late reply. The peek/lock triggers with a subsequent call to Complete action require your Standard Logic Apps to be in stateful mode. The following doc has the steps: Enable stateful mode for stateless built-in connectors in Azure Logic Apps


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.