Share via

Log compaction + HTTPS in Azure Event Hub

Verschinin Valentin 20 Reputation points
2023-09-07T09:19:32.56+00:00

We would like to inquire about using Azure Event Hub's new feature, log compaction, in combination with HTTPS. See

It is not entirely clear from the documentation how these two elements can be combined, if they can be combined at all, as the role of the key remains unclear.

To rephrase it slightly, could you please provide instructions on how to set a message key using the REST API?

Thank you very much. Best, Valentin

Azure Event Hubs

Answer accepted by question author

Bhargava-MSFT 31,361 Reputation points Microsoft Employee Moderator
2023-09-11T18:51:30.41+00:00

Hello Verschinin Valentin,

Sorry for the confusion. You are correct.

You need to specify the message key using the REST API to include the PartitionKey in the HTTP header, not in the body.

Also, the API-version is correct as 2014-01

POST https://your-namespace.servicebus.windows.net/your-event-hub/messages?timeout=60&api-version=2014-01 HTTP/1.1  
Authorization: SharedAccessSignature sr=your-namespace.servicebus.windows.net&sig=your-sas-key&se=1403736877&skn=RootManageSharedAccessKey  
Content-Type: application/atom+xml;type=entry;charset=utf-8  
Host: your-namespace.servicebus.windows.net  
BrokerProperties: {"PartitionKey":"key1"}

{  
   "Body" : "event payload message"
}


Please let me know if you are still having issues with this.

Was this answer helpful?

2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.