Skip to main content
rule official · GitHub

pcf-limitations — GitHub Copilot rule: what it does, how to install

Instructs GitHub Copilot on Power Apps Component Framework restrictions. It prevents unsupported API calls and insecure storage patterns in PCF projects.

Install into GitHub Copilot · Manually: put the files in place All methods and platforms ↓
.github/instructions/pcf-limitations.instructions.md
Open on GitHub

What pcf-limitations does

This instruction targets code component files matching **/*.{ts,tsx,js,json,xml,pcfproj,csproj}. It prevents Copilot from writing code that calls Dataverse-dependent APIs, such as WebAPI, inside Canvas Apps. Those endpoints do not work in canvas applications.

The rule demands that external libraries are either bundled directly into the primary component package or replaced by platform React controls. It also forbids using window.localStorage and window.sessionStorage. Storing state in browser storage is insecure and lacks guaranteed persistence.

Custom authentication cannot be built directly into code components for Canvas Apps. Connectors must handle auth and data actions instead. Relying on custom auth routines will break the component during deployment.

What it helps with

  • block unsupported Dataverse WebAPI calls in Canvas Apps
  • prevent insecure data persistence in browser web storage
  • enforce bundling of third-party libraries into primary component code
  • route authentication through connectors instead of custom auth schemes

Example prompts for the agent

  • Create a PCF control for Canvas Apps that retrieves list data
  • Show me how to bundle an external npm package in pcfproj
  • Store component state without using browser web storage

How to install pcf-limitations

Manually: put the files in place

.github/instructions/pcf-limitations.instructions.md

The applyTo field sets which files it applies to

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about pcf-limitations

How to install pcf-limitations in GitHub Copilot?

Add the rule file to your repository at .github/instructions/pcf-limitations.instructions.md.

What does pcf-limitations do?

It teaches GitHub Copilot the restrictions of Power Apps Component Framework, blocking unsupported APIs in Canvas Apps and banning browser storage objects.

Why does the rule restrict window.localStorage?

The framework prohibits window.localStorage and window.sessionStorage because browser client storage is insecure and cannot guarantee reliable data availability.

Source text

pcf-limitations.instructions.md · MIT
---
description: 'Limitations and restrictions of Power Apps Component Framework'
applyTo: '**/*.{ts,tsx,js,json,xml,pcfproj,csproj}'
---

# Limitations

With Power Apps component framework, you can create your own code components to improve the user experience in Power Apps and Power Pages. Even though you can create your own components, there are some limitations that restrict developers implementing some features in the code components. Below are some of the limitations:

## 1. Dataverse Dependent APIs Not Available for Canvas Apps

Microsoft Dataverse dependent APIs, including WebAPI, are not available for Power Apps canvas applications yet. For individual API availability, see [Power Apps component framework API reference](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/).

## 2. Bundle External Libraries or Use Platform Libraries

Code components should either use [React controls & platform libraries](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/react-controls-platform-libraries) or bundle all the code including external library content into the primary code bundle. 

To see an example of how the Power Apps command line interface can help with bundling your external library content into a component-specific bundle, see [Angular flip component](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/sample-controls/angular-flip-control) example.

## 3. Do Not Use HTML Web Storage Objects

Code components should not use the HTML web storage objects, like `window.localStorage` and `window.sessionStorage`, to store data. Data stored locally on the user's browser or mobile client is not secure and not guaranteed to be available reliably.

## 4. Custom Auth Not Supported in Canvas Apps

Custom auth in code components is not supported in Power Apps canvas applications. Use connectors to get data and take actions instead.

## Related Topics

- [Power Apps component framework API reference](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/)
- [Power Apps component framework overview](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/overview)

© github · MIT · github/awesome-copilot

Topics and platforms

All IDE rules for Frontend and UI →

From the same set861

The whole set →
pcf-react-platform-libraries This rule guides GitHub Copilot through building React-based PCF controls with Power Apps platform libraries. Use it when setting up virtual controls for canvas or model-driven apps. ★ 40,418repo stars pcf-overview Guides GitHub Copilot on Power Apps Component Framework architecture. Helps generate code components for canvas and model-driven applications. ★ 40,418repo stars pcf-model-driven-apps Teaches GitHub Copilot how to build and update code components for model-driven apps. Applies to ts, tsx, js, json, xml, pcfproj and csproj files. ★ 40,418repo stars pcf-manifest-schema A rule that feeds Copilot the structure of ControlManifest.Input.xml: which elements and attributes exist and what they do. Useful when editing a PCF component manifest. ★ 40,418repo stars pcf-fluent-modern-theming This rule shows how to style PCF components with an app’s modern theme. Use it with Fluent UI controls or custom elements that read theme tokens. ★ 40,418repo stars pcf-events A rule that tells Copilot how to declare and handle custom events in Power Apps Component Framework components. ★ 40,418repo stars pcf-dependent-libraries Guides GitHub Copilot in configuring shared prebuilt libraries for Power Apps Component Framework (PCF) components to avoid bundling duplicates. ★ 40,418repo stars pcf-community-resources Find PCF component examples, learning videos, developer blogs, and builder tools in one guide. Use it when you need a starting point or help with PCF development. ★ 40,418repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor