When I create a subscription as follows the TTL is defaulted to 10675199 days
var client = new ManagementClient(connStr);
if (!await client.SubscriptionExistsAsync(topicName, subscriptionName))
{
// TODO: this has an unlimited TTL, which needs to be reduced to 1 day.
client.CreateSubscriptionAsync(topicName, subscriptionName);
}
How can this be set from code?
You should use the overloading method of
CreateSubscriptionAsync
which takesSubscriptionDescription
as parameter.Like below:
See here for more details.