Search code examples
c#restazureazureservicebusazure-notificationhub

Create Notification Hub - REST only (no SDK)


For an automated testing service for our iOS apps we need an programmatic way to create Notification Hubs in our Mac build system. I can't use the SDK because it won't run under Mono for unknown reasons relating to timer DLL conflicts so I just want to use "stock" REST APIs if I can.

I see the similar question: Creating Azure Push Notification Hub Programaticaly but uses the SDK so is not relevant for me.

This API guide: http://msdn.microsoft.com/en-us/library/azure/dn223269.aspx says you can do it using REST and SAS tokens. I can't get this to work. However the SDK places the CreateHub operation on the namespace manager - but IT states "Operations on the Service Bus namespace root require certificate authentication" which also doesn't seem to work for me. I followed this ( http://msdn.microsoft.com/en-us/library/azure/dn170477.aspx ). With the Resource URI being http://mynamespace.servicebus.windows.net and the key being "RootManageSharedAccessKey" and our key as well.

All my attempts are generating 401 errors - "InvalidSignature: The token has an invalid signature"

I could really use a hand holding walkthrough of the process I should use with REST only to create a Notification Hub. What resource URI I should use, what should be in the token, what the namespace maps towith the REST API - etc.


Solution

  • I've recently introduced a lot of features including NH creation in open source Java SDK. Try it out or just look how is corresponding REST call implemented.