0
votes

Does anyone know the best way (if any), to set message retention to never expire for EventGrid Subscriptions and queues? This is against blob store, triggered when files are added/updated/deleted. By default the retention is 7 days. I've been reading microsoft docs such as this https://docs.microsoft.com/en-us/azure/storage/queues/storage-python-how-to-use-queue-storage?tabs=python which states "default time-to-live is seven days", but then doesn't expand on how to programatically change this. I can see from the SDK how to do it on a per message basis, but this doesn't help me as I want to do it at a Event Subscription level, not every time a message is created. I've attached a screen grab of how you can set it at Event Subscription level in the Portal

Azure Portal Event Subscription Config

1
Sort of, thank you, seems to take the ease of auto message generation away though. So whenever a file is created/updated/deleted, and force you to go through a function. This is fine for myself but a harder sell to my clients wanting an easy out of the box solutionAnna Wykes

1 Answers

0
votes

When you create the subscription for the handler to be a storage queue, you can configure TTL.

Here is a reference to the custom delivery property: https://docs.microsoft.com/en-us/azure/event-grid/delivery-properties#configure-time-to-live-on-outgoing-events-to-azure-storage-queues

CLI reference (see --delivery-attribute-mapping): https://docs.microsoft.com/en-us/cli/azure/eventgrid/event-subscription?view=azure-cli-latest#az_eventgrid_event_subscription_create