当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript js.default.testAzureWebAppAvailability方法代码示例

本文整理汇总了TypeScript中azurerest-common/azurerestutility.js.default.testAzureWebAppAvailability方法的典型用法代码示例。如果您正苦于以下问题:TypeScript js.default.testAzureWebAppAvailability方法的具体用法?TypeScript js.default.testAzureWebAppAvailability怎么用?TypeScript js.default.testAzureWebAppAvailability使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在azurerest-common/azurerestutility.js.default的用法示例。


在下文中一共展示了js.default.testAzureWebAppAvailability方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: run


//.........这里部分代码省略.........
                else {
                    throw Error(tl.loc("VirtualApplicationDoesNotExist", virtualApplication));
                }
            }
            var isFolderBasedDeployment = deployUtility.isInputPkgIsFolder(webDeployPkg);
            var applyFileTransformFlag = JSONFiles.length != 0 || xmlTransformation || xmlVariableSubstitution;

            if (applyFileTransformFlag || generateWebConfig) {
                var folderPath = await deployUtility.generateTemporaryFolderForDeployment(isFolderBasedDeployment, webDeployPkg);

                if (generateWebConfig) {
                    tl.debug('parsing web.config parameters');
                    var webConfigParameters = ParameterParser.parse(webConfigParametersStr);
                    generateWebConfigUtil.addWebConfigFile(folderPath, webConfigParameters, virtualApplicationPhysicalPath);
                }
                if (applyFileTransformFlag) {
                    var isMSBuildPackage = !isFolderBasedDeployment  && (await deployUtility.isMSDeployPackage(webDeployPkg));
                    fileTransformationsUtility.fileTransformations(isFolderBasedDeployment, JSONFiles, xmlTransformation, xmlVariableSubstitution, folderPath, isMSBuildPackage);
                }

                var output = await deployUtility.archiveFolderForDeployment(isFolderBasedDeployment, folderPath);
                tempPackagePath = output.tempPackagePath;
                webDeployPkg = output.webDeployPkg;
            }

            if(virtualApplication) {
                publishingProfile.destinationAppUrl += "/" + virtualApplication;
            }

            if(webAppUri) {
                tl.setVariable(webAppUri, publishingProfile.destinationAppUrl);
            }

        if(publishingProfile && publishingProfile.destinationAppUrl) {
            try{
                await azureRESTUtility.testAzureWebAppAvailability(publishingProfile.destinationAppUrl, 3000);
            } catch (error) {
                tl.debug("Failed to check availability of azure web app, error : " + error.message);
            }
        }

        if(deployUtility.canUseWebDeploy(useWebDeploy)) {
            if(!tl.osType().match(/^Win/)){
                throw Error(tl.loc("PublishusingwebdeployoptionsaresupportedonlywhenusingWindowsagent"));
            }

                var appSettings = await azureRESTUtility.getWebAppAppSettings(endPoint, webAppName, resourceGroupName, deployToSlotFlag, slotName);
                if(renameFilesFlag) {
                    if(appSettings.properties.MSDEPLOY_RENAME_LOCKED_FILES == undefined || appSettings.properties.MSDEPLOY_RENAME_LOCKED_FILES == '0'){
                        appSettings.properties.MSDEPLOY_RENAME_LOCKED_FILES = '1';
                        await azureRESTUtility.updateWebAppAppSettings(endPoint, webAppName, resourceGroupName, deployToSlotFlag, slotName, appSettings);
                    }
                }
                else {
                    if(appSettings.properties.MSDEPLOY_RENAME_LOCKED_FILES != undefined && appSettings.properties.MSDEPLOY_RENAME_LOCKED_FILES != '0'){
                        delete appSettings.properties.MSDEPLOY_RENAME_LOCKED_FILES;
                        await azureRESTUtility.updateWebAppAppSettings(endPoint, webAppName, resourceGroupName, deployToSlotFlag, slotName, appSettings);
                    }
                }
                console.log("##vso[task.setvariable variable=websiteUserName;issecret=true;]" + publishingProfile.userName);
                console.log("##vso[task.setvariable variable=websitePassword;issecret=true;]" + publishingProfile.userPWD);
                await msDeploy.DeployUsingMSDeploy(webDeployPkg, webAppName, publishingProfile, removeAdditionalFilesFlag,
                                excludeFilesFromAppDataFlag, takeAppOfflineFlag, virtualApplication, setParametersFile,
                                additionalArguments, isFolderBasedDeployment, useWebDeploy);
        } else {
            tl.debug("Initiated deployment via kudu service for webapp package : " + webDeployPkg);
            if(azureWebAppDetails == null) {
                azureWebAppDetails = await azureRESTUtility.getAzureRMWebAppConfigDetails(endPoint, webAppName, resourceGroupName, deployToSlotFlag, slotName);
            }
            await DeployUsingKuduDeploy(webDeployPkg, azureWebAppDetails, publishingProfile, virtualApplication, isFolderBasedDeployment, takeAppOfflineFlag);

        }
        if(scriptType) {
            var kuduWorkingDirectory = virtualApplication ? virtualApplicationPhysicalPath : 'site/wwwroot';
            await kuduUtility.runPostDeploymentScript(publishingProfile, kuduWorkingDirectory, scriptType, inlineScript, scriptPath, takeAppOfflineFlag);
        }
    }
    await updateWebAppConfigDetails(endPoint, webAppName, resourceGroupName, deployToSlotFlag, slotName);
    }
    catch (error) {
        isDeploymentSuccess = false;
        tl.setResult(tl.TaskResult.Failed, error);
    }
    if(publishingProfile != null) {
        var customMessage = {
            type: "Deployment",
            slotName: (deployToSlotFlag ? slotName : "Production")
        };

        try {
            console.log(await azureRESTUtility.updateDeploymentStatus(publishingProfile, isDeploymentSuccess, customMessage));
        }
        catch(error) {
            tl.warning(error);
        }
    }
    if(tempPackagePath) {
        tl.rmRF(tempPackagePath);
    }
}
开发者ID:colindembovsky,项目名称:vsts-tasks,代码行数:101,代码来源:azurermwebappdeployment.ts

示例2: require

var nock = require('nock');
var azureRestUtiltiy = require('azurerest-common/azurerestutility.js');

nock('http://testwebapp.azurewebsites.net')
    .get("/")
    .reply(299, {"statusCode":"299", "statusMessage": "Fail"});

azureRestUtiltiy.testAzureWebAppAvailability('http://testwebapp.azurewebsites.net',100);
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:8,代码来源:WebAppAvailabilityFailureTest.ts


注:本文中的azurerest-common/azurerestutility.js.default.testAzureWebAppAvailability方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。