Created
February 17, 2015 18:10
-
-
Save ivanignatiev/d8fca4ff8b3f729f7337 to your computer and use it in GitHub Desktop.
HTTP request to Azure Event Hub with Curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# REST API documentation https://msdn.microsoft.com/en-us/library/azure/dn790664.aspx | |
curl -H 'Authorization: SharedAccessSignature sr={Service Bus Namespace}.servicebus.windows.net&sig={Url Encoded Shared Access Key}&se={Time Stamp with Shared Access Key expration}&skn={Shared Access Policy name}' -H 'Content-Type:application/atom+xml;type=entry;charset=utf-8' --data '{Event Data}' https://{Service Bus Namespace}.servicebus.windows.net/{Event Hub Name}/messages |
@holms it is cool to see that SAS generation is achievable in bash, thanks ! :)
This article also describes it pretty well I think:
https://learn.microsoft.com/en-us/rest/api/eventhub/generate-sas-token
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just in case someone needs to generate signature for auth headers:
Launch this bash script with such params:
It will produce a line which you need to add after this:
curl -H 'Authorization: