當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript js.default.updateAzureRMWebAppConfigDetails方法代碼示例

本文整理匯總了TypeScript中azurerest-common/azurerestutility.js.default.updateAzureRMWebAppConfigDetails方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript js.default.updateAzureRMWebAppConfigDetails方法的具體用法?TypeScript js.default.updateAzureRMWebAppConfigDetails怎麽用?TypeScript js.default.updateAzureRMWebAppConfigDetails使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在azurerest-common/azurerestutility.js.default的用法示例。


在下文中一共展示了js.default.updateAzureRMWebAppConfigDetails方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: deployWebAppImage

export async function deployWebAppImage(endPoint, resourceGroupName, webAppName) {
    var startupCommand = tl.getInput('StartupCommand', false);
    var appSettings = tl.getInput('AppSettings', false);
    var imageSourceAndTag;

    // Construct the image
    var dockerNamespace = tl.getInput('DockerNamespace', true);
    var dockerRepository = tl.getInput('DockerRepository', true);
    var dockerImageTag = tl.getInput('DockerImageTag', false);

    /*
        Special Case : If release definition is not linked to build artifacts
        then $(Build.BuildId) variable don't expand in release. So clearing state
        of dockerImageTag if $(Build.BuildId) not expanded in value of dockerImageTag.
    */
    if(dockerImageTag && (dockerImageTag.trim() == "$(Build.BuildId)")) {
        dockerImageTag = null;
    }

    if(dockerImageTag) {
        imageSourceAndTag = dockerNamespace + "/" + dockerRepository + ":" + dockerImageTag;
    } else {
        imageSourceAndTag = dockerNamespace + "/" + dockerRepository;
    }

    if(imageSourceAndTag)
    {
        tl.debug("Deploying the image " + imageSourceAndTag + " to the webapp " + webAppName);

        appSettings = appSettings ? appSettings.trim() : "";
        appSettings = "-DOCKER_CUSTOM_IMAGE_NAME " + imageSourceAndTag + " " + appSettings;

        // Update webapp application setting
        var webAppSettings = await azureRESTUtility.getWebAppAppSettings(endPoint, webAppName, resourceGroupName, false, null);
        mergeAppSettings(appSettings, webAppSettings);
        await azureRESTUtility.updateWebAppAppSettings(endPoint, webAppName, resourceGroupName, false, null, webAppSettings);

        // Update startup command
        if(startupCommand)
        {
            tl.debug("Updating the startup command: " + startupCommand);
            var updatedConfigDetails = JSON.stringify(
            {
                "properties": {
                    "appCommandLine": startupCommand
                }
            });

            await azureRESTUtility.updateAzureRMWebAppConfigDetails(endPoint, webAppName, resourceGroupName, false, null, updatedConfigDetails);
        }
    }
}
開發者ID:DarqueWarrior,項目名稱:vsts-tasks,代碼行數:52,代碼來源:azurermwebappcontainerdeployment.ts

示例2: updateScmType

async function updateScmType(SPN, webAppName: string, resourceGroupName: string, deployToSlotFlag: boolean, slotName: string) {
    try {
        var configDetails = await azureRESTUtility.getAzureRMWebAppConfigDetails(SPN, webAppName, resourceGroupName, deployToSlotFlag, slotName);
        var scmType: string = configDetails.properties.scmType;
        if(scmType.toLowerCase() === "none") {
            var updatedConfigDetails = JSON.stringify(
                {
                    "properties": {
                        "scmType": "VSTSRM"
                    }
                });
            await azureRESTUtility.updateAzureRMWebAppConfigDetails(SPN, webAppName, resourceGroupName, deployToSlotFlag, slotName, updatedConfigDetails);
            console.log(tl.loc("SuccessfullyUpdatedAzureRMWebAppConfigDetails"));
        }
    }
    catch(error) {
        tl.warning(tl.loc("FailedToUpdateAzureRMWebAppConfigDetails", error));
    }
}
開發者ID:DarqueWarrior,項目名稱:vsts-tasks,代碼行數:19,代碼來源:azurermwebappdeployment.ts


注:本文中的azurerest-common/azurerestutility.js.default.updateAzureRMWebAppConfigDetails方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。