fix(azuredeployer.gbapp): Fix webchat keys.

This commit is contained in:
Rodrigo Rodriguez 2023-11-02 13:20:51 -03:00
parent bfcaf84188
commit bc9b31fba7

View file

@ -586,22 +586,32 @@ export class AzureDeployerService implements IGBInstallationDeployer {
return; return;
} }
resolve(instance);
const sleep = ms => {
return new Promise(resolve => {
setTimeout(resolve, ms);
});
};
await sleep(30000);
// MSFT has changed without warnings. // MSFT has changed without warnings.
// try {
// //tslint:disable-next-line:max-line-length try {
// query = `subscriptions/${subscriptionId}/resourceGroups/${group}/providers/Microsoft.BotService/botServices/${botId}/channels/WebChatChannel/listChannelWithKeys?api-version=${this.apiVersion}`;
// url = urlJoin(baseUrl, query); //tslint:disable-next-line:max-line-length.
// req = AzureDeployerService.createRequestObject(url, accessToken, 'POST', JSON.stringify(parameters));
// const resChannel = await httpClient.sendRequest(req); query = `subscriptions/${subscriptionId}/resourceGroups/${group}/providers/Microsoft.BotService/botServices/${botId}/channels/WebChatChannel/listChannelWithKeys?api-version=${this.apiVersion}`;
// const key = JSON.parse(resChannel.bodyAsText).properties.properties.sites[0].key; url = urlJoin(baseUrl, query);
// instance.webchatKey = key; req = AzureDeployerService.createRequestObject(url, accessToken, 'POST', JSON.stringify(parameters));
// instance.whatsappBotKey = key; const resChannel = await httpClient.sendRequest(req);
// resolve(instance); const key = JSON.parse(resChannel.bodyAsText).properties.properties.sites[0].key;
// } catch (error) { instance.webchatKey = key;
// reject(error); instance.whatsappBotKey = key;
// } resolve(instance);
} catch (error) {
reject(error);
}
}); });
} }