Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Custom CoPilot Agent AI accessible from the CRM

(3) ShareShare
ReportReport
Posted on by 14
Hi,
I created a custom CoPilot Agent AI in CoPilot Studio and published it. It's goal is to assist and help end users of the Dynamics 365 CRM in every day work. I know there is a way to embed the AI Agent to Teams, but how to do it, so that the end users of the system have a direct access to it from the CRM? Is there a simple way to embed the chatbot's widget or iframe?
I don't want to use the CoPilot for Customer Service, I want to use the custom AI Agent that I have created.
 
Thanks,
Jimmy Owen
  • Vahid Ghafarpour Profile Picture
    7,715 Super User 2025 Season 1 on at
    Custom CoPilot Agent AI accessible from the CRM
    If any of the responses helped resolve your issue, please take a moment to mark the best answer. This helps others in the community quickly find solutions to similar problems.

    To do this, simply click the "Does this answer your question?" button on the most helpful response and like the helpful posts. If your issue is still unresolved, feel free to provide more details so the community can assist further!

    Thanks for being an active part of the Dynamics 365 Community! 😊
  • Suggested answer
    Daivat Vartak (v-9davar) Profile Picture
    4,767 Super User 2025 Season 1 on at
    Custom CoPilot Agent AI accessible from the CRM
    Hello Jimmy,
     

    You're looking to embed your custom Copilot Studio agent directly into Dynamics 365 CRM for easy access by end-users, bypassing the standard Copilot for Customer Service and Teams integration. While there isn't a direct "widget" or simple iframe embedding method offered out-of-the-box, you can achieve this through a combination of techniques, primarily using Power Pages or custom web resources.

    Here's a breakdown of how you can approach this:

    1. Power Pages Integration (Recommended):

    • Concept:

      • Power Pages allows you to create external-facing websites that integrate with Dynamics 365 data.
      • You can use Power Pages to host your Copilot Studio bot and then embed it into Dynamics 365. 

    • Implementation:

      1. Create a Power Pages Site:

        • If you don't have one already, create a Power Pages site connected to your Dynamics 365 environment. 

      2. Add an Iframe or Web Component:

        • In Power Pages, create a new web page or use an existing one.
        • Use an iframe or a custom web component to embed your Copilot Studio bot.
        • To get the Iframe code, you will need to go to the publish area of your CoPilot Studio bot. There you will find the Iframe code. 

      3. Embed the Bot:

        • Use the Copilot Studio bot's embed code (typically an iframe) to insert the bot into your Power Pages page. 

      4. Embed Power Pages into Dynamics 365:

        • Create a web resource (HTML) in Dynamics 365.
        • In the HTML web resource, use an iframe to embed the Power Pages page where your bot resides.
        • Add the web resource to a Dynamics 365 form or dashboard. 

      5. Security Considerations:

        • Make sure that the security settings of the Power Page, and the CoPilot studio bot are properly configured. 
         

    • Advantages:

      • Relatively straightforward.
      • Leverages existing Power Platform components.
      • Provides a clean and integrated user experience. 

    • Disadvantages:

      • Requires setting up and managing a Power Pages site.
      • Adds an extra layer of complexity.  

    •  

    2. Custom Web Resource (JavaScript and Iframe):

    • Concept:

      • Create a custom web resource (HTML and JavaScript) that loads the Copilot Studio bot's iframe directly into Dynamics 365. 

    • Implementation:

      1. Get Embed Code:

        • Retrieve the embed code (iframe) from your published Copilot Studio bot. 

      2. Create Web Resource:

        • Create an HTML web resource in Dynamics 365.
        • In the HTML, use JavaScript to dynamically create an iframe and insert the bot's embed code. 

      3. Add Web Resource to Form/Dashboard:

        • Add the web resource to a Dynamics 365 form or dashboard where you want the bot to appear. 

      4. Security considerations:

        • Make sure that the security settings of the CoPilot studio bot are properly configured. 
         

    • Advantages:

      • More direct integration.
      • Less overhead than Power Pages. 

    • Disadvantages:

      • Requires JavaScript development.
      • May be less flexible in terms of styling and customization. 

    •  

    3. Custom PCF Control (Advanced):

    • Concept:

      • Develop a custom Power Apps component framework (PCF) control to embed the Copilot Studio bot.
      • This provides the most control over the bot's appearance and behavior. 

    • Implementation:

      1. PCF Development:

        • Develop a PCF control that uses JavaScript and the Copilot Studio bot's embed code to render the bot. 

      2. Deployment:

        • Deploy the PCF control to your Dynamics 365 environment. 

      3. Add to Form/Dashboard:

        • Add the PCF control to a Dynamics 365 form or dashboard. 
         

    • Advantages:

      • Maximum control and flexibility.
      • Seamless integration. 

    • Disadvantages:

      • Requires significant development effort.
      • Steeper learning curve. 

      •  

    Recommendations:

    • Power Pages (Option 1) is generally the most practical and recommended approach for most users. It provides a good balance of flexibility and ease of implementation.
    • Custom Web Resource (Option 2) is suitable for simpler integrations where you don't need the full features of Power Pages.
    • Custom PCF Control (Option 3) is only recommended for advanced users who require highly customized bot integration.

    •  

    Remember to thoroughly test your integration and consider security implications.

     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Regards,
    Daivat Vartak
  • Suggested answer
    Holly Huffman Profile Picture
    4,381 on at
    Custom CoPilot Agent AI accessible from the CRM
    Hi there! Good morning, evening, or afternoon - depending on where you are :) Hope you are well today! 
    To embed your custom CoPilot Agent AI into Dynamics 365 CRM for direct access by end users, you can follow these steps:
     
    1. Enable Dynamics 365 Channel in CoPilot Studio
    • Go to your CoPilot Studio portal.
    • Navigate to the "Channels" section in the left menu.
    • Select "Dynamics 365" and complete the configuration wizard.
    • This will allow your custom AI Agent to integrate with Dynamics 365 CRM.
    2. Embed the Chat Widget
    • In Dynamics 365 CRM, go to Settings > Administration.
    • Select Omnichannel Administration.
    • Configure the chat widget settings and link it to your custom CoPilot Agent AI.
    • Set up routing rules and agent assignments as needed.
    3. Use an Iframe
    • If you prefer embedding the chatbot as an iframe, retrieve the web chat embed code from CoPilot Studio (under Channels > Web).
    • Add an iframe or HTML control to the Dynamics 365 CRM interface.
    • Insert the embed code into the HTML property and configure the height, width, and any trigger actions or context variables.
    4. Test and Validate
    • Thoroughly test the integration to ensure the chatbot is accessible and functioning as intended.
    • Verify authentication flows if your bot requires user identity.
     
    These methods should allow your custom CoPilot Agent AI to be accessible directly from Dynamics 365 CRM.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,361 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,522 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans