From 7f641bd5df3fa5c88f34164193ff1bd6b1d7e956 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Tue, 18 May 2021 20:50:57 -0300 Subject: [PATCH] fix(azuredeployer.gbapp): New pricing table. --- .../services/AzureDeployerService.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/azuredeployer.gbapp/services/AzureDeployerService.ts b/packages/azuredeployer.gbapp/services/AzureDeployerService.ts index 30c98e0a..62d9c6fd 100644 --- a/packages/azuredeployer.gbapp/services/AzureDeployerService.ts +++ b/packages/azuredeployer.gbapp/services/AzureDeployerService.ts @@ -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 { 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); }