Skip to content

Commit

Permalink
fix: fix broken mgmt function when using Node20 runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
TheUnderScorer committed Jun 19, 2024
1 parent d368209 commit a22e351
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions management/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ const managementFn: AzureFunction = async (context: Context, timer: Timer) => {
context.log('Timer function is running late!')
}

// @azure/arm-appservice uses library under the hood which needs access to global crypto object
Object.assign(global, {
crypto: crypto.webcrypto,
})
if (typeof global.crypto === 'undefined') {
context.log('Crypto not available, using webcrypto')

// @azure/arm-appservice uses library under the hood which needs access to global crypto object
Object.assign(global, {
crypto: crypto.webcrypto,
})
}

const env = gatherEnvs(context.log)

Expand Down

0 comments on commit a22e351

Please sign in to comment.