Publish Azure Bot Framework Composer Bot to already existing Resource Group.
Published Feb 05 2021 12:36 PM 4,388 Views

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.  

 

Untitled picture.png

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.

 

image.png

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>"

3 Comments
Copper Contributor

What version of Bot Composer Framework are you using because it will not allow me to publish to an existing resource group from within the application.

For latest version please follow the documentation here Publish a bot to Azure - Bot Composer | Microsoft Docs 

 

Add a new publish profile...

Sai_Teja_Nagamothu_0-1614929209370.png

once you login, you will see the option to import the profile... 

Sai_Teja_Nagamothu_1-1614929253172.png

Sai_Teja_Nagamothu_2-1614929350488.png

replace the publishing profile, with your own profile.

 

Note: I assume that you already have the resources created in the resource group. So copy the necessary key/ values to publish profile and import it.

must read Publish a bot to Azure - Bot Composer | Microsoft Docs

Copper Contributor

Is there any similar steps for deploying the bot from bot composer to User Assigned MSI please?

Version history
Last update:
‎Mar 04 2021 11:34 PM
Updated by: