private static async publishToFunctionapp()

in src/publishers/websiteRunFromPackageDeploy.ts [97:121]


    private static async publishToFunctionapp(state: StateConstant,
        appService: AzureAppService, blobSasUrl: string) {
        try {
            await appService.patchApplicationSettings({ 'WEBSITE_RUN_FROM_PACKAGE': blobSasUrl });
        } catch (expt) {
            throw new AzureResourceError(state, "Patch Application Settings", "Failed to set WEBSITE_RUN_FROM_PACKAGE with storage blob link." +
                ` Please check if the ${blobSasUrl} does exist.`);
        }

        try {
            // wait 30 second before calling sync trigger
            const retryInterval: number = 30000;

            Logger.Info("##[debug]Starting 30 seconds wait time.");
            await Sleeper.timeout(retryInterval);
            Logger.Info("##[debug]Finished wait time.");

            await appService.syncFunctionTriggersViaHostruntime();
            Logger.Info("Sync Trigger call was successful.");
        } catch (expt) {
            throw new AzureResourceError(state, "Sync Trigger Functionapp", "Failed to perform sync trigger on function app." +
                " Function app may have malformed content. Please manually restart your function app and" +
                " inspect the package from WEBSITE_RUN_FROM_PACKAGE.");
        }
    }