agentleFS
soulemikesoulemike/microsoft-skills/skills/powerplatform/SKILL.md

powerplatform

Skill2 starsChanged 3 months agoMITView on GitHub

Use this skill for Power Platform Business Applications Platform admin API automation with ARM-scoped authentication and paginated environment enumeration.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill for Power Platform admin environment discovery through the Business Applications Platform (BAP) API.

    line 22
  2. Distinctive:

    Use an ARM-scoped token, not a Dataverse token.

    line 61
  3. Distinctive:

    Prefer managed identity or federated credentials over client secrets.

    line 62
  4. Distinctive:

    Use a named profile and retrieve only the admin environments list

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Power Platform / BAP Skill

Agent Summary

Use this skill for Power Platform admin environment discovery through the Business Applications Platform (BAP) API. Even though this is a Power Platform domain, the API expects an ARM-scoped token rather than a Dataverse token.

When to Use

  • List Power Platform admin environments.
  • Expand environment properties such as capacity or addons.
  • Reuse Azure auth patterns against the BAP endpoint.

Required Parameters

Connect-PowerPlatformApi.ps1

ParameterTypeRequiredNotes
AuthenticationTypestringConditionalManagedIdentity, Federated, Certificate, or ClientCredentials.
EnvironmentstringNoDefaults to AzureCloud.
TenantIdstringConditionalRequired for Federated, Certificate, and ClientCredentials.
ClientIdstringConditionalRequired for Federated, Certificate, and ClientCredentials; optional for user-assigned managed identity.
FederatedTokenstringConditionalRequired for Federated.
CertificatePathstringConditionalRequired for Certificate.
ClientSecretSecureStringConditionalRequired for ClientCredentials.

Get-PowerPlatformEnvironment.ps1

ParameterTypeRequiredNotes
ContextobjectYesOutput from Connect-PowerPlatformApi.ps1.
ApiVersionstringNoDefaults to 2020-10-01.
ExpandstringNoOptional property expansion string.

Example Agent Prompts

  • "List all Power Platform admin environments."
  • "Show Power Platform environments with capacity and addon details."
  • "Call the BAP admin environments endpoint in Azure US Government."

Example Agent Workflow

$ctx = ./skills/powerplatform/Connect-PowerPlatformApi.ps1 -AuthenticationType ManagedIdentity -Environment AzureCloud

$envs = ./skills/powerplatform/Get-PowerPlatformEnvironment.ps1 -Context $ctx

Security Caveats

  • Use an ARM-scoped token, not a Dataverse token.
  • Prefer managed identity or federated credentials over client secrets.
  • Restrict access to Power Platform admin environment listing to the smallest admin scope that satisfies the task.

Overview

This skill connects to the Power Platform Business Applications Platform (BAP) API and uses an ARM-scoped bearer token to enumerate admin environments.

Authentication

  • ARM-scoped token (BAP is an Azure Resource Provider)
  • Same auth hierarchy as ARM: ManagedIdentity > Federated > Certificate > ClientSecret

Endpoints

EnvironmentBAP API Endpoint
AzureCloudhttps://api.bap.microsoft.com
AzureUSGovernmenthttps://api.bap.microsoft.us
AzureChinaCloudhttps://api.bap.microsoft.cn

Skills

FilePurpose
Connect-PowerPlatformApi.ps1Resolves the BAP base URI for the selected Azure cloud, acquires an ARM-scoped access token using the shared auth helpers, and returns a connection context for downstream calls.
Get-PowerPlatformEnvironment.ps1Calls the BAP admin environments endpoint, follows nextLink or @odata.nextLink until all pages are retrieved, and returns the collected environment records.

Patterns & Caveats

  • BAP API uses ARM tokens, not Dataverse tokens
  • Admin environments endpoint: /providers/Microsoft.BusinessAppPlatform/scopes/admin/environments
  • Pagination via nextLink and @odata.nextLink
  • api-version: 2020-10-01

Examples

  1. List environments using managed identity
$ctx = ./skills/powerplatform/Connect-PowerPlatformApi.ps1 -AuthenticationType ManagedIdentity -Environment AzureCloud
$envs = ./skills/powerplatform/Get-PowerPlatformEnvironment.ps1 -Context $ctx
$envs | Select-Object -First 5
  1. List environments with expanded properties in US Gov
$ctx = ./skills/powerplatform/Connect-PowerPlatformApi.ps1 -AuthenticationType Federated -Environment AzureUSGovernment -TenantId $env:TENANT_ID -ClientId $env:CLIENT_ID -FederatedToken $env:AZURE_FEDERATED_TOKEN
$envs = ./skills/powerplatform/Get-PowerPlatformEnvironment.ps1 -Context $ctx -Expand 'properties.capacity,properties.addons'
$envs | Format-Table -AutoSize
  1. Use a named profile and retrieve only the admin environments list
$ctx = ./skills/powerplatform/Connect-PowerPlatformApi.ps1 -Profile prod -Environment AzureCloud
$envs = ./skills/powerplatform/Get-PowerPlatformEnvironment.ps1 -Context $ctx -ApiVersion '2020-10-01'
$envs | Where-Object { $_.name } | Select-Object name, state -First 10

Prerequisites

  • Required modules: Az.Accounts, Az.Resources, optional MSAL.PS (used for certificate token acquisition)
  • Required roles: permissions to call the BAP admin environments endpoint (/providers/Microsoft.BusinessAppPlatform/scopes/admin/environments)

Related Docs

  • Auth Patterns
  • Token Chaining
  • Environment Endpoints

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.