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
Former Employee
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 04, 2021
Version 7.0

3 Comments

  • bbagaria's avatar
    bbagaria
    Tin Contributor

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

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

     

    Add a new publish profile...

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

    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

  • TommyBraccia's avatar
    TommyBraccia
    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.