12.2 ALM for Copilot Studio Agents, Connectors & Solution Packaging

Key Takeaways

  • Microsoft Copilot Studio agents, topics, entities, and actions are stored in Dataverse tables and packaged using Microsoft Power Platform Solutions; enterprise ALM mandates that solutions remain unmanaged strictly in Development and are exported and deployed as managed solutions into Test, UAT, and Production.
  • A comprehensive Copilot Studio solution package includes the core bot definition ('bot' and 'botcomponent' records), conversational topics, custom entities, Power Automate agent flows, Connection References, Environment Variables, and Custom Connectors.
  • Deploying updates via Solution Upgrades (as opposed to standard Solution Updates) is mandatory when removing obsolete topics or components, as an Upgrade automatically purges deleted components from the target managed environment upon applying the upgrade.
  • Unmanaged customizations introduced directly into downstream environments (Test or Production) create an unmanaged layer on top of the managed solution stack, effectively 'masking' future managed releases and causing critical deployment failures.
  • Connection References and Environment Variables decouple runtime agent conversational logic from environment-specific endpoints (such as Azure OpenAI endpoints, AI Search index names, and API URLs), enabling seamless deployment parameterization via deploymentSettings.json.
Last updated: September 2026

ALM for Copilot Studio Agents, Connectors & Solution Packaging

Quick Answer: Microsoft Copilot Studio agents are packaged and transported across enterprise environments using Microsoft Power Platform Solutions. Development occurs exclusively in unmanaged solutions, which are committed to Git as unpacked declarative XML/YAML and built into immutable managed solutions for deployment to Test, UAT, and Production. To prevent environmental coupling, architects must abstract all external endpoints and credentials into Environment Variables and Connection References, bound automatically at deploy-time via deploymentSettings.json.

Deploying conversational and agentic AI at enterprise scale requires rigorous ALM controls. In Microsoft Copilot Studio, agents are not standalone code files; they are composite, data-driven entities whose dialog trees, trigger phrases, generative knowledge sources, and action bindings reside within Microsoft Dataverse. Transporting these assets safely across environments demands a deep understanding of Power Platform Solution architecture, component dependency trees, and solution layering mechanics.


1. Power Platform Solution Architecture for Copilot Studio

In Microsoft Copilot Studio, every agent asset is modeled as a record in Dataverse. Understanding the underlying schema is vital for diagnosing packaging errors, resolving missing dependencies, and structuring source control repositories.

+-----------------------------------------------------------------------------+
|                   COPILOT STUDIO SOLUTION PACKAGE (MANAGED)                 |
+-----------------------------------------------------------------------------+
|                                                                             |
|  +---------------------------+       +-----------------------------------+  |
|  |   Core Agent Definition   |       |       Conversational Assets       |  |
|  |   - Schema: 'bot'         | <---> |   - Schema: 'botcomponent'        |  |
|  |   - Agent metadata        |       |   - Topics (Trigger/Dialog YAML)  |  |
|  |   - Default language      |       |   - Entities (Closed / Regex)     |  |
|  +---------------------------+       |   - Modern Agent Actions          |  |
|                                      +-----------------------------------+  |
|                 |                                      |                    |
|                 v                                      v                    |
|  +---------------------------+       +-----------------------------------+  |
|  |    Extensibility Assets   |       |       Configuration & Secrets     |  |
|  |   - Agent Cloud Flows     | <---> |   - Environment Variables         |  |
|  |   - Custom Connectors     |       |   - Connection References         |  |
|  |   - AI Builder Prompts    |       |   - Azure Key Vault References    |  |
|  +---------------------------+       +-----------------------------------+  |
+-----------------------------------------------------------------------------+

Core Solution Components for Copilot Studio

  • Bot Record (bot): The root container entity representing the agent. It stores the agent display name, icon, schema version, default language, and runtime settings.
  • Bot Components (botcomponent): Granular sub-components that define the agent's intelligence. Each record has a componenttype attribute:
    • Topic (Type 9): Conversational dialog paths, trigger phrases, condition nodes, and response templates defined in declarative YAML.
    • Bot Variable (Type 11): Global and session variables shared across topics.
    • Dialog (Type 0): System dialogs including Greeting, Fallback, End of Conversation, and Escalate.
    • Knowledge Source (Type 15): Grounding configurations pointing to SharePoint, Dataverse, or Azure AI Search.
    • Bot Subtype / Trigger (Type 12): Event listeners that trigger agent actions based on external signals.
  • Agent Cloud Flows (Power Automate): Specialized automated flows invoked synchronously or asynchronously by agent topics to query backend enterprise databases or execute transactions.
  • Connection References (connectionreference): Abstractions that map flow and agent actions to physical connectors (e.g., SharePoint, Dataverse, SAP, Office 365 Outlook) without embedding user credentials.
  • Environment Variables (environmentvariabledefinition): Decoupled configuration values (e.g., Azure OpenAI model deployment names, API base URLs, tenant IDs) stored separately from the code.
  • Custom Connectors (connectors): OpenAPI (Swagger) specifications defining custom REST API integrations utilized by the agent.

Managed vs. Unmanaged Solutions: The Cardinal Rules

AttributeUnmanaged SolutionsManaged Solutions
Target EnvironmentDevelopment Sandboxes ONLYIntegration, Test, UAT, and Production
MutabilityFully editable. Components can be added, modified, or deleted directly by makers.Immutable / Read-Only. Direct editing of topics or flows is locked to prevent unauthorized drift.
De-installation ImpactDeleting the solution container deletes only the container; all custom components remain behind in the default solution.Deleting the managed solution removes the container and all associated components and data cleanly.
Export CapabilityCan be exported as either Unmanaged (for backup/branching) or Managed (for deployment).Cannot be exported. Once imported as managed, it remains managed permanently.
Source of TruthTemporary working canvas. The authoritative source of truth is the Git repository.Production executable release artifact generated by the automated CI/CD pipeline.

[!CAUTION] Critical Architecture Rule: Never import an unmanaged solution into a Test or Production environment. Once unmanaged components enter an environment, they contaminate the Default Solution layer, creating permanent configuration drift that prevents clean upgrades and breaks automated ALM.


2. Solution Layering, Upgrades & Dependency Management

Power Platform calculates the active behavior of an agent by evaluating its Solution Layer Stack from bottom to top. Understanding this evaluation hierarchy is essential for diagnosing why updates fail to appear in production.

+-------------------------------------------------------------------------+
|                        THE SOLUTION LAYER STACK                         |
+-------------------------------------------------------------------------+
| [ Top Layer ]   | Active / Unmanaged Customizations Layer               |
|                 | (Formed by manual edits in Prod - BLOCKS UPDATES!)    |
|-----------------+-------------------------------------------------------|
| [ Middle Layer ]| Managed Solution Patch / Upgrade (v1.1.0)             |
|                 | (Latest CI/CD automated release)                      |
|-----------------+-------------------------------------------------------|
| [ Base Layer ]  | Managed Base Solution (v1.0.0)                        |
|                 | (Initial release package)                             |
|-----------------+-------------------------------------------------------|
| [ Bottom Layer ]| System Solution (Dataverse Core Metadata)             |
+-------------------------------------------------------------------------+
  Rule of Precedence: The HIGHEST layer wins at runtime.

The Unmanaged Customization "Ghosting" Anti-Pattern

If an administrator or maker opens Copilot Studio directly in the Production environment and modifies a single node in a Topic (e.g., updating a support telephone number), Dataverse automatically writes an Unmanaged Customization Layer at the very top of the stack for that specific component.

When the engineering team subsequently deploys a new managed release (e.g., v1.2.0) via the automated pipeline, the pipeline reports success, but users in production continue seeing the old telephone number. Because the unmanaged layer sits above all managed layers, it permanently masks any managed updates beneath it.

Remediation: Architects must enforce environment permissions to prevent direct editing in production. If an unmanaged layer is inadvertently created, an administrator must navigate to the component's Solution Layers view in the maker portal or execute a CLI command to explicitly Remove Unmanaged Customizations.

Solution Import Operations: Update vs. Upgrade vs. Patch

When deploying a new version of an agent solution, architects must select the correct deployment operation:

Scenario: Developer deletes Topic 'Legacy_Returns_Topic' in Development.

Deploying via SOLUTION UPDATE:
- Target environment updates modified topics.
- 'Legacy_Returns_Topic' REMAINS in Production as an orphaned active topic!

Deploying via SOLUTION UPGRADE:
- Deploys holding solution 'SolutionName_Upgrade'.
- Replaces all modified topics.
- Automatically DELETES 'Legacy_Returns_Topic' from Production.
- Result: Perfect parity with Development.
  • Solution Update: Imports the new package and applies changes to existing components. However, it does not delete any components that were removed in the development environment. If an architect deletes five obsolete topics in Dev, those topics will remain active in Production after a Solution Update, confusing users and degrading intent recognition.
  • Solution Upgrade (Mandatory for Major/Minor Releases): Deploys the package as a temporary holding solution (Solution_Upgrade), validates dependencies, and then applies the upgrade. During the "Apply Solution Upgrade" phase, Dataverse purges all components that existed in the prior version but are absent in the new package. This ensures that deleted topics, retired flows, and obsolete variables are cleanly removed from production.
  • Solution Patch: A lightweight, delta-only solution containing strictly the modified or added components, bound directly to a parent base solution. Patches are ideal for hotfixing critical conversational bugs in production without re-exporting the entire multi-megabyte solution corpus. Patches are subsequently consolidated into a new base solution via the Clone Solution (rollup) operation.

Resolving Missing Dependency Errors (SolutionImportFailed)

During solution import into downstream environments, the most common deployment error is MissingDependencyException. This occurs when a component inside the solution references an asset that does not exist in the target environment or inside the solution package.

Error Details:
Solution "CustomerServiceAgent" import failed: Missing dependencies.
- Dependent Component: Topic "Process_Refund" (botcomponent)
- Required Dependency: Cloud Flow "Execute_SAP_Refund" (workflow)
- Required Dependency: Connection Reference "sap_erp_conn_ref" (connectionreference)

Architectural Prevention Checklist:

  1. Always Include Sub-Components: When adding an Agent to a solution, ensure that all dependent Topics, Entities, and Agent Actions are explicitly added.
  2. Avoid Default Environment Connections: Ensure that every Power Automate flow invoked by an agent utilizes Connection References rather than direct, embedded maker credentials.
  3. Run Solution Checker in CI: Enforce automated execution of the Power Platform Solution Checker in the pull request pipeline. The checker inspects declarative XML and warns of missing dependencies prior to package generation.

3. Decoupling Agent Configurations via Environment Variables & Connection References

Hardcoding API endpoints, Azure OpenAI resource names, or search indexes inside agent topics or flow definitions is an architectural anti-pattern that breaks multi-environment pipelines. All environment-specific parameters must be decoupled.

[ Copilot Studio Agent / Agent Flow ]
                 |
                 | Reads at Runtime
                 v
    +---------------------------+       +---------------------------+
    |   Connection References   |       |   Environment Variables   |
    +---------------------------+       +---------------------------+
                 |                                    |
                 | Dynamically Bound at Deploy-Time   |
                 v                                    v
    +---------------------------+       +---------------------------+
    |  deploymentSettings.json  |       |  deploymentSettings.json  |
    |  Dev: Mock Connector      |       |  Dev: 'aoai-dev-eastus'   |
    |  UAT: Staging Service Prin|       |  UAT: 'aoai-uat-eastus'   |
    |  Prod: Managed Identity   |       |  Prod: 'aoai-prod-eastus' |
    +---------------------------+       +---------------------------+

Connection References: Decoupled Connectivity

A Connection Reference is a solution-aware component that acts as a placeholder or pointer for an underlying physical connection. Instead of an agent flow binding directly to JaneDoe@enterprise.com's SharePoint Connection, it binds to cr_SharePoint_Grounding_ConnRef.

  • In Development: The connection reference binds to the developer's personal or shared development connection.
  • In Test and Production: During automated pipeline deployment, the connection reference is bound to an enterprise Service Principal (Entra ID Application Registration) or dedicated service account without requiring manual maker intervention.

Environment Variables: Parameterizing Agent Logic

Environment Variables store data keys and configuration parameters that vary across environments. Copilot Studio topics and agent flows read these values dynamically at runtime.

Variable Schema NameData TypePurposeDev ValueProd Value
aoai_endpoint_urlStringBase URL for Azure OpenAIhttps://aoai-dev.openai.azure.comhttps://aoai-prod.openai.azure.com
aoai_model_deploymentStringTarget LLM deployment namegpt-4o-mini-sandboxgpt-4o-ptu-enterprise
search_index_aliasStringAzure AI Search Index Aliaskb-dev-syntheticenterprise-knowledge-active
search_api_key_secretSecret (Key Vault)API Key for Search Service@Microsoft.KeyVault(...)@Microsoft.KeyVault(...)
max_agent_turnsNumberReasoning loop cutoff threshold35

Automating Deployment via deploymentSettings.json

When deploying managed solutions via the Power Platform CLI (pac) or Azure DevOps / GitHub Actions, configuration values and connection bindings are supplied via a single, environment-specific deployment configuration file:

{
  "EnvironmentVariables": [
    {
      "SchemaName": "aoai_endpoint_url",
      "Value": "https://aoai-prod-eastus.openai.azure.com/"
    },
    {
      "SchemaName": "aoai_model_deployment",
      "Value": "gpt-4o-enterprise-v1"
    },
    {
      "SchemaName": "search_index_alias",
      "Value": "enterprise-knowledge-active"
    }
  ],
  "ConnectionReferences": [
    {
      "LogicalName": "cr_Dataverse_Grounding",
      "ConnectionId": "7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d",
      "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_commondataserviceforapps"
    },
    {
      "LogicalName": "cr_SAP_ERP_Connector",
      "ConnectionId": "b1c2d3e4-5f6a-7b8c-9d0e-1f2a3b4c5d6e",
      "ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_customconnector"
    }
  ]
}

During the pipeline deployment stage, the CLI command automatically injects these values:

pac solution import \
  --path ./build/CustomerServiceAgent_managed.zip \
  --activate-plugins true \
  --settings-file ./config/prod-deploymentSettings.json

This approach guarantees that the managed solution artifact is built once (immutable) and promoted across Test, UAT, and Production without modifying a single line of internal agent logic.

Loading diagram...
Power Platform Solution Packaging, CI/CD Build & Deployment Architecture
Test Your Knowledge

An enterprise development team maintains a complex customer service agent in Copilot Studio. During a sprint refactoring effort in the Development sandbox, developers delete ten obsolete conversational topics that handled retired warranty programs. The updated solution is exported and imported into the Production environment using a standard Solution Update operation. Post-deployment testing reveals that customers can still trigger the ten obsolete warranty topics. What is the root cause of this issue, and how should it be resolved?

A
B
C
D
Test Your Knowledge

A solutions architect is designing an automated CI/CD pipeline for a Copilot Studio agent that invokes custom Azure OpenAI models and queries Azure AI Search. The agent must connect to sandbox endpoints in the Development environment, staging endpoints in UAT, and high-availability Provisioned Throughput (PTU) endpoints in Production. Corporate security rules prohibit hardcoding credentials or modifying the agent definition between environment promotions. Which architectural pattern should the architect implement?

A
B
C
D
Test Your Knowledge

Following an emergency production incident, a support administrator logged directly into the Production Copilot Studio maker portal and edited the system Fallback topic to provide an updated emergency phone number. Two weeks later, the development team deploys a scheduled managed solution release containing a redesigned Fallback topic with intelligent escalations. After a successful pipeline run, users report that the agent continues to display the emergency phone number instead of the new intelligent escalation flow. What caused this behavior?

A
B
C
D