fix(azuredeployer.gbapp): New pricing table.

This commit is contained in:
Rodrigo Rodriguez 2021-05-18 20:50:57 -03:00
parent 584ed55f5c
commit 7f641bd5df

View file

@ -238,11 +238,11 @@ export class AzureDeployerService implements IGBInstallationDeployer {
}
public async botExists(botId) {
const baseUrl = `https://management.azure.com/`;
const username = GBConfigService.get('CLOUD_USERNAME');
const password = GBConfigService.get('CLOUD_PASSWORD');
const accessToken = await GBAdminService.getADALTokenFromUsername(username, password);
const httpClient = new ServiceClient();
@ -800,8 +800,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
private async createCognitiveServices(group, name, location, kind): Promise<CognitiveServicesAccount> {
const params = {
sku: {
name: this.freeTier || kind === 'LUIS.Authoring' || kind === 'TextAnalytics' ? 'F0' :
kind === 'Bing.SpellCheck.v7' ? 'S1' : 'S0'
name: ""
},
createMode: 'Default',
location: location,
@ -809,6 +808,16 @@ export class AzureDeployerService implements IGBInstallationDeployer {
properties: {}
};
if (kind === 'LUIS.Authoring') {
params.sku.name = this.freeTier ? 'F0' : 'S0';
} else if (kind === 'TextAnalytics') {
params.sku.name = this.freeTier ? 'F0' : 'S0';
} else if (kind === 'Bing.SpellCheck.v7') {
params.sku.name = this.freeTier ? 'S0' : 'S1';
} else if (kind === 'CognitiveServices') {
params.sku.name = 'S0';
}
return await this.cognitiveClient.accounts.create(group, name, params);
}