Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App service Perf. Improvements Fix #7497

Merged
merged 1 commit into from
Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export class BuiltInLinuxWebAppDeploymentProvider extends AzureRmWebAppDeploymen
public async DeployWebAppStep() {
tl.debug('Performing Linux built-in package deployment');

await this.kuduServiceUtility.warmpUp();
this.zipDeploymentID = await this.kuduServiceUtility.zipDeploy(this.taskParams.Package.getPath(), false, this.taskParams.TakeAppOfflineFlag,
{ slotName: this.appService.getSlot() });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,15 @@ export class AzureAppServiceUtility {
}

console.log(tl.loc('UpdatingAppServiceApplicationSettings', JSON.stringify(properties)));
await this._appService.patchApplicationSettings(properties);
var isNewValueUpdated: boolean = await this._appService.patchApplicationSettings(properties);

if(!isNewValueUpdated) {
console.log(tl.loc('UpdatedAppServiceApplicationSettings'));
return;
}

var kuduService = await this.getKuduService();
var noOftimesToIterate: number = 6;
var noOftimesToIterate: number = 12;
tl.debug('retrieving values from Kudu service to check if new values are updated');
while(noOftimesToIterate > 0) {
var kuduServiceAppSettings = await kuduService.getAppSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ export class KuduServiceUtility {
}
}

public async warmpUp() {
try {
tl.debug('warming up Kudu Service');
await this._appServiceKuduService.getAppSettings();
tl.debug('warmed up Kudu Service');
}
catch(error) {
tl.debug('Failed to warm-up Kudu: ' + error.toString());
}
}

private async _printZipDeployLogs(log_url: string): Promise<void> {
if(!log_url) {
return;
Expand Down
13 changes: 11 additions & 2 deletions Tasks/Common/azure-arm-rest/azure-arm-app-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,23 @@ export class AzureAppService {
}
}

public async patchApplicationSettings(properties): Promise<void> {
public async patchApplicationSettings(properties): Promise<boolean> {
var applicationSettings = await this.getApplicationSettings();
var isNewValueUpdated: boolean = false;
for(var key in properties) {
if(applicationSettings.properties[key] != properties[key]) {
tl.debug(`old value : ${applicationSettings.properties[key]}. new value: ${properties[key]}`);
isNewValueUpdated = true;
}

applicationSettings.properties[key] = properties[key];
}

await this.updateApplicationSettings(applicationSettings);
if(isNewValueUpdated) {
await this.updateApplicationSettings(applicationSettings);
}

return isNewValueUpdated;
}

public async getConfiguration(): Promise<AzureAppServiceConfigurationDetails> {
Expand Down