Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/nodejs-typescript-policies/infra/azure.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ resource functionApp 'Microsoft.Web/sites@2021-02-01' = {
}
{
name: 'WEBSITE_NODE_DEFAULT_VERSION'
value: '~18' // Set NodeJS version to 18.x
value: '~20' // Set NodeJS version to 20 as 18 is not supported any longer
}
{
name: 'APPINSIGHTS_INSTRUMENTATIONKEY'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ export async function retractConnection(timer: Timer, context: InvocationContext
}

const currentDate = new Date();
const cronExpression = `0 0 0 ${currentDate.getUTCMonth()} ${currentDate.getUTCDay()} *`;
// Azure Functions cron format: {second} {minute} {hour} {day} {month} {day-of-week}
const cronExpression = `0 0 0 ${currentDate.getUTCDate()} ${currentDate.getUTCMonth() + 1} *`;
app.timer('deployConnection', {
// Runs every year
// Runs every year on the same date
schedule: cronExpression,
runOnStartup: process.env.AZURE_FUNCTIONS_ENVIRONMENT === 'Development',
handler: deployConnection
Expand Down