本文整理汇总了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);
}
}
}
示例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));
}
}