0
votes

I have a very basic question on generating SAS Token. As per Azure SDK, http://azure.github.io/azure-storage-android/, we can use generateSharedAccessSignature to generate SAS Token. So, why do we need to use code shown in following pages -- https://docs.microsoft.com/en-us/rest/api/eventhub/generate-sas-token.

2
From what I see its just additional examples. If the Android SDK has what you need, then you are all set. What problem are you encountering? - Mike Oryszak
1st link is for Azure Storage and the examples in the 2nd link are for Event Hubs. Completely different services. You would use former if you need to connect to Storage and the latter if you need to connect to Event Hubs. - Gaurav Mantri
@MikeOryszak, no problems. I am trying to understand best practice. Thats it. Thanks for your answer :) - Samir Baid
@GauravMantri, Yes i agree. However, i thought the principles would be same and hence wanted to understand if i am doing something wrong. Thanks for your answer :) - Samir Baid

2 Answers

1
votes

It's because Microsoft offers their own libraries and SDKs to help you with the integration. That's what the first link is about. Second link shows how you do it yourself with the language of your choice without any specific Azure library dependencies.

You don't need the second link if your language of choice has Azure library that does it for you. E.g. I just implemented the same task with node.js npm module that also contains method generateSharedAccessSignature and didn't need the second link.

0
votes

Microsoft attempts to provide detailed tutorials and examples for the different integration options. The first link you provided (http://azure.github.io/azure-storage-android/) is specific to android development. If that is what you are doing, then that is a great example.

The examples shown on https://docs.microsoft.com/en-us/rest/api/eventhub/generate-sas-token are focused on the specific tasks. Within there, they include the common languages; 6 implementation languages in the referenced article.