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

This post has been republished via RSS; it originally appeared at: IIS Support Blog articles.

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 simple change, it will not append the given Environment value to Resource Group name. 

 

Why this will work?

In provisionComposer.js file, the code 

 

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); };

 

uses function client.resourceGroups.createOrUpdate - this function just checks if the RG exists or not, it's present, it'll use the same RG, if not, it'll create a new RG and also if you provide a new location it'll update the location to existing RG.  

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.