Wednesday, October 8, 2014

Create Azure Service Bus for debugging SharePoint apps.

If you install Office Developer Tools for Visual Studio 2012, you can debug apps for SharePoint. By using the Microsoft Azure Service Bus, these tools communicate with the same Windows Communications Foundation (WCF) service that remote event handlers (remote event receivers and app event receivers) use. By taking this approach, you avoid network boundary issues between the cloud app and the local web app. This lets you debug remote event receivers in the cloud app. See Developing apps for SharePoint on a remote system.
In fact, what you need is an Azure ACS Service bus. A while ago we could copy the ACS connection directly in the Azure web interface. Now, when you create a new Service Bus via the Azure web interface, only the SAS connectionstring is available.
Solution: create service bus via Azure Powershell:

1. Open Azure Powershell

2. I got this exception:

AuthenticationFailed: A security token exception occured for the received JWT token.

...because I logged on with a Microsoft Account. You can only create a new service bus with an Active Directory account. This means if you have multiple accounts available and you get the connection dialog, you should go for the directory account. If you don't have an Active Directory account, you should go to Azure, there you can create one (and bind it to a subscription).

 After I logged on with the correct account, the creation went well.