in src/appservice-rest/Arm/azure-app-service.ts [223:261]
public async syncFunctionTriggersViaHostruntime(): Promise<any> {
try {
let i = 0;
let retryCount = 5;
let retryIntervalInSeconds = 2;
let timeToWait: number = retryIntervalInSeconds;
var httpRequest: WebRequest = {
method: 'POST',
uri: this._client.getRequestUri(`//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/${this._slotUrl}/hostruntime/admin/host/synctriggers`,
{
'{resourceGroupName}': this._resourceGroup,
'{name}': this._name,
}, null, '2015-08-01')
}
while(true) {
var response = await this._client.beginRequest(httpRequest);
if(response.statusCode == 200) {
return response.body;
}
else if(response.statusCode == 400) {
if (++i < retryCount) {
await this._sleep(timeToWait);
timeToWait = timeToWait * retryIntervalInSeconds + retryIntervalInSeconds;
continue;
}
else {
throw ToError(response);
}
}
else {
throw ToError(response);
}
}
}
catch(error) {
throw Error("Failed to sync triggers via host runtime for function app " + this._getFormattedName() + ".\n" + getFormattedError(error));
}
}