A bot that has been created in one environment may need to be used in other tenants as well to enforce reusability or because we are moving it from the Dev to the Prod environment.
Power Platform provides the capability to export and import bots using Solutions so that bots can work across multiple tenants with almost zero rework.
Note: The bot maker will require the minimum System Customizer security roles to use this feature.
We will be making use of Solutions which acts as a container for one or more bots. In effect, we won’t export the bot, but the entire solution is exported. Let’s create a solution by heading over to the Gear icon and select General.
Click on Go to Power Apps Solution which will take us to Power Apps. Click on New Solution and provide the details using which the solution will be created.
Once the solution is created, click on the “Add existing” drop-down and select Chatbot so that we can browse and add the bot that we are trying to export.
Select the bot and click on Add.
To export the Bot, we will go to the Solutions tab and select our Solution where the bot has been added and click on Export.
Based on the destination to which the bot is being exported select either manager or unmanaged option. Unmanaged solutions are used in development environments while you make changes to your application. Managed solutions are used to deploy to any environment that isn’t a development environment for that solution like UAT or Prod.
Now let’s head over to the new tenant where we want to import the solution. Visit make.powerapps.com and select the Import option from the Solutions tab
It will open a left pane from where you can browse and select the previously exported zip file. Click on Import.
We can see the bot in the imported solution in the new tenant
Now let’s head over to Power Virtual agents in the new tenant. Click on the Bot icon in the top right corner and it will list out the available bots here we can see the recently imported bot.
Doing a quick test of the bot, we can see that it works as expected even without making any further changes.
Thus, we saw how to export a bot using solutions and get it to work in another tenant by importing the bit along with the solution