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>",
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.