Our system has IoT devices that send device-to-cloud (DeviceTelemetry) messages to our IoT Hub instance. Each message has a custom format and can be identified by the event type field in the IoT Hub message properties. Then, based on the event type, the message is consumed by Azure Functions.
We use the IoT Hub Event Grid system topic.
Flow: D2C messages routed to IoT Hub Event Grid system topic -> Advanced filter evaluation routes message to proper Azure Function.
The solution is efficient, but based on our observations and estimations, it will lead to unacceptable costs. As we understand, we pay for every operation in Event Grid, which is publishing message to Event Grid, custom advanced filter evaluation, and message delivery. Knowing that each Event Grid subscription will use custom filter evaluation and the assumption that we will have 20 subscriptions, we have 22 operations for each D2C message.
Question 1. Are our Event Grid calculations correct? Using Event Grid that way makes it terribly expensive.
Question 2. Can the Event Grid flow be adjusted to make it cheaper? I mean, e.g., avoid custom filter evaluation for each subscription.
Question 3. Can the Event Grid message subject even be changed? This will allow us to use standard filtering - not advanced one.
devices/{deviceId}. AFAIK, The subject cannot be changed.I used the below MSDOC for