0
votes

In the past when I develop SharePoint Provider-Hosted apps which implement remote event receivers, i use the Azure Service Bus to debug the code, as mentioned in this https://blogs.msdn.microsoft.com/kaevans/2014/02/26/attaching-remote-event-receivers-to-lists-in-the-host-web/ , where inside Azure i create a new service bus >> i copy the primary connection string, as follow:- enter image description here

then inside the Visual Studio project >> Properties >> SharePoint >> i add the above service bus's primary connection string, as follow:- enter image description here

this was allowing me to debug my code. but last week when i tried to do so, I got these errors inside Visual studio after running the project:-

One or more services were unregistered from the Microsoft Azure Service Bus. Cannot register Services/AppEventReceiver.svc on Microsoft Azure Service Bus: Unable to connect to the remote server

as follow:- enter image description here

so i read that using azure service bus has been retired by Microsoft starting from september 2018. but at the same time i did not find any alternative for using Azure Service Bus for debugging the sharepoint provider hosted app. So can anyone advice on this please?

1

1 Answers

1
votes

You can use ngrok as a proxy to debug your application locally without using Service Bus.

The issue with passing localhost to Sharepoint is that Sharepoint cannot talk to it as you have pointed out. ngrok provides you with a public URL that Sharepoint can reach that is then is routed to your local machine via the ngrok service.This is the same thing that Service Bus was doing- offering a public URL routed to your local.

Instead of registering localhost:44332/Services/AppEventReceiver.svc with Sharepoint, you would register {id}.ngrok.io/Services/AppEventReceiver where id is the id generated when you start the local ngrok service.