Skip to content

Generate a shared access token to send a message via REST to the Microsoft Azure IoT hub.

Notifications You must be signed in to change notification settings

Breitmann/AzureSasTokenCreator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AzureSasTokenCreator

Generate a shared access token to send a message via REST to the Microsoft Azure IoT hub.

It is very easy to use a REST request to send a message to your Microsoft Azure IoT hub: POST https://myiothub.azure-devices.net/devices/mydevice/messages/events?api-version=2016-02-03

However, the SharedAccessSignature (SAS) token must be provided as header field "Authorization".

To generate the SAS token using Java 8 the class AzureSasTokenCreator can be used. It is based on the Microsoft Azure IoT SDK for Java (https://github.com/Azure/azure-iot-sdk-java), but without the overhead.

Important: You can find the device primary key in the Azure portal. Go to youriothub --> Devices --> yourdevice --> Primary key

About

Generate a shared access token to send a message via REST to the Microsoft Azure IoT hub.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages