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 Manage task review comments #6143

Merged
merged 14 commits into from
Jan 5, 2018

Conversation

vincent1173
Copy link
Contributor

No description provided.

await appService.monitorAppState("stopped");
await appService.pingApplication(pingApplicationCount);
await azureAppServiceUtils.monitorApplicationState("stopped");
await azureAppServiceUtils.pingApplication();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wont the ping fail here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We dont fail here for non 200 codes as our primary concern is to hit the app once and avoid cold-start (delay in first request to the app).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why do we need it in stop?

Copy link
Contributor Author

@vincent1173 vincent1173 Jan 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an additional step. Even when stop action is invoked, it does take some time to take effect and result in cold start. First request made during the post action may result in 200 return code leading to wrong impression of the state. So, we explicitly ping here. (Also, it helps to warm-up the slot,if used before deploy task)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After stop the site is stopped - so there shouldn't be any response. And warm-up doesn't make sense in stopped web-site.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed warm-up logic

break;
}
case "Restart Azure App Service": {
var appService: AzureAppService = new AzureAppService(azureEndpoint, resourceGroupName, webAppName, slotName);
await appService.restart();
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we wait for the state or ping in restart

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restart has less significance compared to start/stop. We should be good here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warm-up should be required after restart

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding warm-up logic after restart,

@@ -213,6 +215,7 @@ export interface AzureEndpoint {
portalEndpoint?: string;
AzureKeyVaultDnsSuffix?: string;
AzureKeyVaultServiceEndpointResourceId?: string;
applicationTokenCredentials: ApplicationTokenCredentials;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a method here instead given this is derived value? like getArmTokenCredentials

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Planned to have attributes here instead of methods.
Also, it tends to honour as an attribute for AzureEndpoint.

console.log(tl.loc('WarmingUpSlots'));
await appServiceSourceSlot.pingApplication(1);
await appServiceTargetSlot.pingApplication(1);
await appServiceSourceSlotUtils.pingApplication();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider doing ping in parallel and then awaiting both for better perf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. will do the same.

@vincent1173 vincent1173 merged commit 3001125 into master Jan 5, 2018
@vincent1173 vincent1173 added the Area: AzureAppService Label to monitor Azure App Service issues label Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: AzureAppService Label to monitor Azure App Service issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants