πŸ”’ Guided

Pre-launch preview. Authorised access only.

Incorrect code

Guided by A Guide to Cloud
Explore AB-900 AI-901
Guided PL-400 Domain 4
Domain 4 β€” Module 4 of 4 100%
14 of 26 overall

PL-400 Study Guide

Domain 1: Create a Technical Design

  • Solution Architecture: What Goes Where Free
  • Security by Design: Auth, Roles & DLP Free
  • Designing UX Components: Canvas, PCF & Client Scripts Free
  • Designing Platform Extensions: Connectors, Plug-ins & APIs Free
  • Integration & Automation Blueprints Free

Domain 2: Build Power Platform Solutions

  • Environment Setup & Security Troubleshooting
  • Solutions & Layers: ALM Foundations
  • CI/CD Pipelines for Power Platform

Domain 3: Implement Power Apps Improvements

  • Advanced Power Fx & Canvas Components
  • Troubleshoot & Optimise Apps

Domain 4: Extend the User Experience

  • Client Scripting: Form Events & the Client API
  • Commands, Buttons & Custom Page Navigation
  • PCF Components: Build & Lifecycle
  • PCF Components: Package, Deploy & Advanced Features

Domain 5: Extend the Platform

  • The Plug-in Pipeline: How Dataverse Processes Events Free
  • Writing Plug-ins: Business Logic, Service & Registration
  • Custom APIs & Business Events
  • Custom Connectors: OpenAPI & Authentication
  • Custom Connectors: Azure, Policies & Code
  • Dataverse APIs: Web API & Organisation Service
  • Azure Functions for Power Platform
  • Cloud Flows: Dataverse Triggers & Expressions
  • Cloud Flows: Security, Errors & Child Flows

Domain 6: Develop Integrations

  • Publishing Dataverse Events
  • Service Endpoints: Webhooks, Service Bus & Event Hub
  • Data Sync: Change Tracking, Alternate Keys & Upsert

PL-400 Study Guide

Domain 1: Create a Technical Design

  • Solution Architecture: What Goes Where Free
  • Security by Design: Auth, Roles & DLP Free
  • Designing UX Components: Canvas, PCF & Client Scripts Free
  • Designing Platform Extensions: Connectors, Plug-ins & APIs Free
  • Integration & Automation Blueprints Free

Domain 2: Build Power Platform Solutions

  • Environment Setup & Security Troubleshooting
  • Solutions & Layers: ALM Foundations
  • CI/CD Pipelines for Power Platform

Domain 3: Implement Power Apps Improvements

  • Advanced Power Fx & Canvas Components
  • Troubleshoot & Optimise Apps

Domain 4: Extend the User Experience

  • Client Scripting: Form Events & the Client API
  • Commands, Buttons & Custom Page Navigation
  • PCF Components: Build & Lifecycle
  • PCF Components: Package, Deploy & Advanced Features

Domain 5: Extend the Platform

  • The Plug-in Pipeline: How Dataverse Processes Events Free
  • Writing Plug-ins: Business Logic, Service & Registration
  • Custom APIs & Business Events
  • Custom Connectors: OpenAPI & Authentication
  • Custom Connectors: Azure, Policies & Code
  • Dataverse APIs: Web API & Organisation Service
  • Azure Functions for Power Platform
  • Cloud Flows: Dataverse Triggers & Expressions
  • Cloud Flows: Security, Errors & Child Flows

Domain 6: Develop Integrations

  • Publishing Dataverse Events
  • Service Endpoints: Webhooks, Service Bus & Event Hub
  • Data Sync: Change Tracking, Alternate Keys & Upsert
Domain 4: Extend the User Experience Premium ⏱ ~12 min read

PCF Components: Package, Deploy & Advanced Features

Get your PCF component from code to production. Learn solution packaging, deployment with the pac CLI, and how to use Device, Utility, and Web API features in your component logic.

From code to production

β˜• Simple explanation

Think of packaging a PCF component like shipping a product.

You have built the product (TypeScript code). Now you need to package it (wrap it in a solution ZIP), ship it (deploy to Dataverse), and stock it on the shelf (make it available for form designers to use).

Once deployed, your component can also access device features β€” the camera for barcode scanning, GPS for location tracking, and the Dataverse Web API for reading and writing data directly from the component. These features make PCF components far more powerful than standard controls.

PCF component deployment follows a pipeline: build (compile TypeScript), package (wrap in a Dataverse solution), deploy (import to the target environment), and consume (add to forms or canvas apps via the designer).

The pac CLI provides commands for the entire workflow: pac pcf push for quick dev deployment, and pac solution add-reference + msbuild for solution packaging. Advanced features include the Device API (camera, GPS, barcode), Utility API (entity metadata, lookup dialogs), and WebAPI (Dataverse CRUD from within the component).

The deployment pipeline

Step 1: Build

npm run build    # Compiles TypeScript, bundles resources

Step 2: Quick push (development only)

pac pcf push --publisher-prefix nova    # Pushes directly to connected environment

This is fast for development but creates an unmanaged component. Not for production.

Step 3: Solution packaging (production)

# Create a solution project
pac solution init --publisher-name NovaSoft --publisher-prefix nova

# Add your PCF component as a reference
pac solution add-reference --path ../StarRatingComponent

# Build the solution
dotnet build    # Creates a managed solution ZIP

# Import to target environment
pac solution import --path bin/Release/NovaSoftComponents.zip

Step 4: Consume

  • Model-driven app: Open form designer β†’ select a field β†’ choose your custom control from the control list
  • Canvas app: Insert β†’ Get more components β†’ Code β†’ select your component
Use pac pcf push for dev speed, solution packaging for everything else
Methodpac pcf pushSolution packaging
SpeedFast β€” direct pushSlower β€” build, package, import
CreatesUnmanaged component in dev envManaged solution for any environment
ALM friendlyNo β€” not solution-awareYes β€” travels in solutions, supports versioning
Use forDevelopment and testingUAT, production, AppSource

Advanced features: Device, Utility, and Web API

PCF components can access platform features beyond basic rendering:

Device API

// Capture an image from the camera
context.device.captureImage({ 
    allowEdit: false, 
    height: 300, 
    width: 300, 
    preferFrontCamera: false 
}).then(
    (fileObject) => {
        // fileObject.fileContent = base64 image data
        // fileObject.fileName, fileObject.fileSize, fileObject.mimeType
        this.displayImage(fileObject.fileContent);
    }
);

// Get current GPS location
context.device.getCurrentPosition().then(
    (position) => {
        // position.coords.latitude, position.coords.longitude
        this.updateMap(position.coords.latitude, position.coords.longitude);
    }
);
Device FeatureMethodUse Case
CameracaptureImage()Photo capture, document scanning
Barcode scannergetBarcodeValue()Inventory, product lookup
GPSgetCurrentPosition()Location tagging, delivery tracking
File pickerpickFile()File upload from device

Web API feature

PCF components can perform Dataverse CRUD operations directly:

// Read a record from Dataverse
context.webAPI.retrieveRecord("account", accountId, 
    "?$select=name,revenue"
).then(
    (result) => {
        this.updateDisplay(result.name, result.revenue);
    }
);

// Create a record
context.webAPI.createRecord("annotation", {
    subject: "Photo captured",
    "objectid_account@odata.bind": `/accounts(${accountId})`,
    documentbody: base64ImageData,
    mimetype: "image/png"
});

Utility API

// Open a lookup dialog
context.utils.lookupObjects({
    allowMultiSelect: false,
    entityTypes: ["account"],
    defaultEntityType: "account"
}).then(
    (result) => {
        // result[0].id, result[0].name, result[0].entityType
    }
);

// Get entity metadata
context.utils.getEntityMetadata("contact", ["firstname", "lastname"]).then(
    (metadata) => {
        // Access field display names, types, etc.
    }
);
πŸ’‘ Scenario: Marcus builds a photo-capture PCF component

Marcus builds a PCF component for field service technicians at a NovaSoft client. When a technician visits a job site:

  1. The component displays a β€œCapture Photo” button
  2. Tapping it calls context.device.captureImage() to open the device camera
  3. The photo is saved to a Dataverse Note (annotation) via context.webAPI.createRecord()
  4. GPS coordinates are captured via context.device.getCurrentPosition() and stored alongside the photo
  5. The component shows a thumbnail of the captured photo

This component uses three PCF APIs: Device (camera + GPS), WebAPI (save to Dataverse), and standard rendering (thumbnail display). It works in both model-driven and canvas apps.

Question

What is the difference between pac pcf push and solution packaging?

Click or press Enter to reveal answer

Answer

pac pcf push deploys directly to a dev environment (fast, unmanaged, not solution-aware). Solution packaging creates a managed solution ZIP that can be imported into any environment and supports ALM (versioning, dependencies, upgrades). Use push for dev, solution packaging for production.

Click to flip back

Question

How does a PCF component access the device camera?

Click or press Enter to reveal answer

Answer

Through the Device API: context.device.captureImage(options). Options include allowEdit, height, width, and preferFrontCamera. It returns a Promise with fileContent (base64), fileName, fileSize, and mimeType. This works on mobile devices and desktops with webcams.

Click to flip back

Question

Can a PCF component read and write Dataverse records directly?

Click or press Enter to reveal answer

Answer

Yes β€” through the Web API feature: context.webAPI.retrieveRecord(), createRecord(), updateRecord(), deleteRecord(), and retrieveMultipleRecords(). This lets the component access data beyond its bound property, like loading related records or saving to annotation tables.

Click to flip back

Knowledge Check

Marcus deploys a PCF component to the test environment using 'pac pcf push'. It works fine. He then tries to include it in a managed solution for production. The solution build fails with 'component not found'. What went wrong?

🎬 Video coming soon

Next up: The Plug-in Pipeline β€” how Dataverse processes events, execution stages, and the role of Pre/Post Images.

← Previous

PCF Components: Build & Lifecycle

Next β†’

The Plug-in Pipeline: How Dataverse Processes Events

Guided

I learn, I simplify, I share.

A Guide to Cloud YouTube Feedback

© 2026 Sutheesh. All rights reserved.

Guided is an independent study resource and is not affiliated with, endorsed by, or officially connected to Microsoft. Microsoft, Azure, and related trademarks are property of Microsoft Corporation. Always verify information against Microsoft Learn.