Reputation: 379
Is it possible to set an expiration time for Azure Function Storage queue output binding?
This is what I have in function.js:
{ "type": "queue", "name": "MyMessageQueue", "queueName": "mymsgqueue", "connection": "AzureWebJobsStorage", "direction": "out" }
However can I specify when the message I add should expire?
Upvotes: 0
Views: 1252
Reputation: 2059
Yes, you can. In your function's Run
method, change the MyMessageQueue
output parameter type to CloudQueue. Then create a CloudQueueMessage in your code and use the AddMessage method to add the message to the queue. The timeToLive
parameter would allow you to control the expiration time.
Refer to the Azure Functions Queue Storage bindings documentation page for more details and examples.
Upvotes: 2