Blog Post

IIS Support Blog
2 MIN READ

Publish Azure Bot Framework Composer Bot to already existing Resource Group.

Sai_Teja_Nagamothu's avatar
Sai_Teja_Nagamothu
Brass Contributor
Feb 05, 2021

IMPORTANT: This article might not be applicable to you, must read Publish a bot to Azure - Bot Composer | Microsoft Docs and check for more info in comments. 

Follow the same steps mentioned here Publish a bot to Azure - Bot Composer | Microsoft Docs  However to publish Azure Bot Framework Composer Bot to already existing Resource Group, follow below steps. 

 

You can find the provisioning steps in the readme.md file which is automatically created when you create a new Bot in Bot Composer.  

 

As of now, by default, provisioning script creates a new Resource Group appending environment value to it and does not deploy the services to an existing Resource Group.

 

Find value

 

 

 

 

const resourceGroupName = ${name}-${environment};

 

 

 

 

and change it to 

 

 

 

 

const resourceGroupName = ${name};

 

 

 

 

in the file provisionComposer.js and save, with this change, it will not append the given Environment value to Resource Group name. 

 

Now:

In provisionComposer.js file, replace createResourceGroup function


From this..

 

 

 

 

const createResourceGroup = async (client, location, resourceGroupName) => { 
  logger({ 
    status: BotProjectDeployLoggerType.PROVISION_INFO, 
    message: "> Creating resource group ...",
   }); 
   const param = { 
     location: location, }; 
   return await client.resourceGroups.createOrUpdate(resourceGroupName, param); 
};

 

 

 

 

To this... and Save!

 

 

 

 

const createResourceGroup = async (client, location, resourceGroupName) => {
  logger({
    status: BotProjectDeployLoggerType.PROVISION_INFO,
    message: `> getting resource group ${resourceGroupName}...`,
  });
  return await client.resourceGroups.get(resourceGroupName);    
};

 

 

 

Here we are using client.resourceGroups.get(resourceGroupName) - this function returns the existing resource group values. check more about this function here 

 

Note: At the end of provisioning the resources, you will get the JSON - publishing profile values... please replace the keyword "environment": "dev" to "hostname": "<your web app name>"

Updated Mar 05, 2021
Version 7.0

3 Comments