I've read about how you can use a cron expression from local.settings.json (and presumably from settings on the portal) by using a %% notation in the TimerTrigger parameter.
I'm not having much luck. I added the following to my local.settings.json:
"Payments": {
"StripePaymentThirdRetry": {
"Cron": "0 */2 * * * *"
}
}
And then added this to my TimerTrigger parameter:
public async Task RunThird([TimerTrigger("%Payments:StripePaymentThirdRetry:Cron%")] TimerInfo myTimer, MsLogging.ILogger log)
The error I get is:
[2022-07-19T05:59:55.917Z] Microsoft.Azure.WebJobs.Host: Error indexing method 'StripePaymentThirdRetry'. Microsoft.Azure.WebJobs.Host: '%Payments:StripePaymentThirdRetry:Cron%' does not resolve to a value. [2022-07-19T05:59:55.948Z] Error indexing method 'StripePaymentThirdRetry' [2022-07-19T05:59:55.949Z] Microsoft.Azure.WebJobs.Host: Error indexing method 'StripePaymentThirdRetry'. Microsoft.Azure.WebJobs.Host: '%Payments:StripePaymentThirdRetry:Cron%' does not resolve to a value. [2022-07-19T05:59:55.949Z] Function 'StripePaymentThirdRetry' failed indexing and will be disabled. [2022-07-19T05:59:55.982Z] The 'StripePaymentThirdRetry' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'StripePaymentThirdRetry'. Microsoft.Azure.WebJobs.Host: '%Payments:StripePaymentThirdRetry:Cron%' does not resolve to a value. [2022-07-19T05:59:55.982Z] The 'StripePaymentThirdRetry' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'StripePaymentThirdRetry'. Microsoft.Azure.WebJobs.Host: '%Payments:StripePaymentThirdRetry:Cron%' does not resolve to a value.
Any idea what I'm doing wrong. I've seen some suggestion that a function.json file is required, but the doco says that is only for non-compiled languages.
