You have build your fist Copilot Studio Agent that is reading SharePoint and Dataverse. Your IT wants you to create ALM for the bot. You have had Game of Thrones with Azure app registrations, bot authentication and slayed the SPFx dragon so that user experience for the Agent is good in SharePoint site.
What you need to do, so that the IT manager gets his development and production version of the bot?
Yes – you don’t want to hear this, it says here in the export and import documentation that you need to configure the authentication again. Only once when setting up your ALM for the Copilot Agent.
Yes – you don’t want to do the SPFx part again, but it is related to the bot. If you wish to have two separate bots, you need to have two separate client side applications to SharePoint. I have offered instructions how to build the next SPFx solution earlier, look the end of the post how to create another client side solution for the production bot. This needs to be done only when setting up the ALM to get the bot from dev to prod.
Export the bot
I did not first figure out how to export the bot, since I could not add it to the solution on maker portal until I realized that I need to go to solution side in Copilot Studio portal.
Then I was able to create the solution and add my Agent a.k.a. bot into the solution. Then I normally exported the solution, downloaded as zip and imported to another environment.
Import the bot
Importing bot happens the same way as normal Power Platform solutions, but off course in the Copilot Studio portal and another environment where you exported the solution. But then starts the fun as in dentist – replay the bot manual authentication.
Was there anything you could reuse?
Yes – quite much!
Authentication for production
Start creating new app registration for the ENTRA ID APP REG as mentioned in earlier instructions.
I changed the existing app registration name, added in the end DEV so htat is is mybot-entraidappreg-dev that I recognize it immedeately. And I will rename the production bot as mybot-entraidappreg-prod
Then you need to go to the imported bot and select Service provider and use the production mybot-entraidappreg-prod app registration details, use the same scopes: profile openid Files.Read.All Sites.Read.All User.Read
Once this is done, it is recommended to test your bot before taking the SharePoint SSO client side solution working. You can do this from demo web site or in the agent edit view.
Click the Login, copy the code and see that you can log in to the bot. Ask questions according your data sources and validate manual authentication working.
SSO authentication for production
Let’s create a copy of the CUSTOM CANVAS APP REG and also add naming for dev and prod so that we don’t mix them up in app registrations etc.
And with this production app registration I got the astrix * tip working – I could save it with * in manifest side, so that I don’t need to setup each SharePoint site separately where I can add the bot.
SPFx package for production
Finally you need to create another SharePoint SPFx package for PROD. Remember to change the solution guid and feature guids as instructed in the end of instructions how to build the SPFx solution.
It might be a good idea to put DEV text into the earlier package and update it. Then you create next package with new guids and replace the DEV with PROD (or leave the PROD away since usually the normal name is PROD version).
Import the solution and you have your production version of the Copilot Studio bot a.k.a. Copilot Agent.
Next update will be easy
When you next time change something in your Copilot Agent, you just need to export managed package from dev and import it to production.