From 6f4106803d3c50592c4c50d1156c0170d35f8e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Mon, 8 Apr 2024 18:19:51 +0900 Subject: [PATCH] chore: expose global webcrypto --- management/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/management/index.ts b/management/index.ts index fb5efbf5..b8dd8016 100644 --- a/management/index.ts +++ b/management/index.ts @@ -10,12 +10,18 @@ import { getSiteStatusUrl } from './site' import { performHealthCheckAfterUpdate } from './healthCheck' import { WEBSITE_RUN_FROM_PACKAGE, USER_ASSIGNED_ENTITY_CLIENT_ID } from './settings' import { config } from './config' +import crypto from 'crypto' const managementFn: AzureFunction = async (context: Context, timer: Timer) => { if (timer.isPastDue) { 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, + }) + const env = gatherEnvs(context.log) if (!env) {