From c3556337034e0596d9f7735665066cdba8e81caa Mon Sep 17 00:00:00 2001 From: Natalie Garcia <82851479+natalgar@users.noreply.github.com> Date: Thu, 2 Sep 2021 12:17:48 -0700 Subject: [PATCH] Issue 8427: give the qna maker service plan a unique name (#8581) Co-authored-by: natalgar --- .../azureResourceManager/azureResourceManager.ts | 12 +++++------- extensions/azurePublish/src/node/provision.ts | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/extensions/azurePublish/src/node/azureResourceManager/azureResourceManager.ts b/extensions/azurePublish/src/node/azureResourceManager/azureResourceManager.ts index 0bf78ab629..b446c47c38 100644 --- a/extensions/azurePublish/src/node/azureResourceManager/azureResourceManager.ts +++ b/extensions/azurePublish/src/node/azureResourceManager/azureResourceManager.ts @@ -260,14 +260,13 @@ export class AzureResourceMananger { }); // initialize the name - const qnaMakerSearchName = `${config.name}-search`.toLowerCase().replace('_', ''); - const qnaMakerWebAppName = `${config.name}-qnahost`.toLowerCase().replace('_', ''); const qnaMakerServiceName = `${config.name}-qna`; + const qnaMakerSearchName = `${qnaMakerServiceName}-search`.toLowerCase().replace('_', ''); + const qnaMakerWebAppName = `${qnaMakerServiceName}-qnahost`.toLowerCase().replace('_', ''); + const qnaMakerServicePlanName = `${qnaMakerServiceName}-serviceplan`; // only support westus in qna - if (config.location !== 'westus') { - config.location = 'westus'; - } + config.location = 'westus'; // deploy search service const searchManagementClient = new SearchManagementClient(this.creds, this.subscriptionId, this.options); @@ -296,10 +295,9 @@ export class AzureResourceMananger { // deploy websites // Create new Service Plan or update the exisiting service plan created before const webSiteManagementClient = new WebSiteManagementClient(this.creds, this.subscriptionId, this.options); - const servicePlanName = config.resourceGroupName; const servicePlanResult = await webSiteManagementClient.appServicePlans.createOrUpdate( config.resourceGroupName, - servicePlanName, + qnaMakerServicePlanName, { location: config.location, sku: { diff --git a/extensions/azurePublish/src/node/provision.ts b/extensions/azurePublish/src/node/provision.ts index d2b4c729dd..09b3e12259 100644 --- a/extensions/azurePublish/src/node/provision.ts +++ b/extensions/azurePublish/src/node/provision.ts @@ -422,7 +422,7 @@ export class BotProjectProvision { provisionResults.qna = await this.azureResourceManagementClient.deployQnAReource({ resourceGroupName: resourceGroupName, location: config.location ?? provisionResults.resourceGroup.location, - name: `${config.hostname}-qna`, + name: config.hostname, }); break;