public static async execute()

in src/publishers/zipDeploy.ts [13:45]


    public static async execute(
        state: StateConstant,
        context: IActionContext,
        enableOryxBuild: EnableOryxBuildConstant,
        scmDobuildDuringDeployment: ScmBuildConstant
    ): Promise<string> {
        const filePath: string = context.publishContentPath;
        let deploymentId: string;
        let isDeploymentSucceeded: boolean = false;
        this.validateApplicationSettings(state, context);
        const originalAppSettings: IAppSettings = context.appSettings;

        try {
            await this.patchTemporaryAppSettings(context, enableOryxBuild, scmDobuildDuringDeployment);
            if (context.authenticationType === AuthenticationType.Rbac && context.os === RuntimeStackConstant.Windows) {
                await context.kuduService.validateZipDeploy(filePath); 
            }
            deploymentId = await context.kuduServiceUtil.deployUsingZipDeploy(filePath, {
                'slotName': context.appService ? context.appService.getSlot() : 'production'
            });
            isDeploymentSucceeded = true;
        } catch (expt) {
            throw new AzureResourceError(state, "zipDeploy", `Failed to use ${filePath} as ZipDeploy content`, expt);
        } finally {
            if (isDeploymentSucceeded) {
                await context.kuduServiceUtil.postZipDeployOperation(deploymentId, deploymentId);
            }
        }

        await this.restoreScmTemporarySettings(context, originalAppSettings);
        await this.deleteScmTemporarySettings(context, originalAppSettings);
        return deploymentId;
    }