Dataverse Prerequisites logo

Dataverse Prerequisites

Community
scottdurow
dataverse-prerequisites

Shared prerequisite steps for any skill that interacts with the Dataverse OData Web API. Covers PAC CLI authentication, Azure CLI token acquisition, WhoAmI validation, environment URL extraction, and token refresh patterns. Triggers on "pac auth", "dataverse auth", "dataverse prerequisites", "connect to dataverse", "environment setup", "pac env who", "dataverse token", "azure cli token dataverse".

Overview

Publisherscottdurow
Repositorypower-platform-full-stack-skills
Skill namedataverse-prerequisites
Stars
39
Forks
10
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by scottdurow on GitHub. Read the source before you install it.

Installation

Install the Dataverse Prerequisites AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/scottdurow/power-platform-full-stack-skills/tree/main/skills/dataverse-prerequisites
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/scottdurow/power-platform-full-stack-skills.git /tmp/power-platform-full-stack-skills
mkdir -p .claude/skills
cp -r /tmp/power-platform-full-stack-skills/skills/dataverse-prerequisites .claude/skills/dataverse-prerequisites
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Dataverse Prerequisites in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Dataverse Prerequisites on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Dataverse Prerequisites is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Dataverse Prerequisites

Shared prerequisite steps for all skills that interact with the Dataverse OData Web API (v9.2). Complete these steps before creating tables, inserting records, or making any Dataverse API call.

Used by: dataverse-solution-web-api, power-apps-code-apps, power-pages, and any future skill that needs Dataverse API access.


CRITICAL RULES

  1. Always verify auth before making API calls. A failed token wastes time debugging 401 errors.
  2. Use device code auth for PAC CLI. Run pac auth create --deviceCode to avoid browser profile conflicts.
  3. Azure CLI tokens expire after ~60 minutes. Refresh before each major step or every 20 records.
  4. Never hardcode tokens or environment URLs. Always extract dynamically from pac env who and az account get-access-token.
  5. Confirm the target environment before any destructive operation. Show the environment URL to the user and get explicit confirmation before creating tables, columns, or importing solutions. See the Environment Confirmation step below.
  6. Read the safety guardrails before any destructive or bulk operation. See ../dataverse-solution-web-api/resources/safety-guardrails.md for the full irreversible operations table, confirmation protocol, bulk operation safety, and prompt injection protection.

Step 0 — Ensure Required Tools Are Installed

Check each tool independently. If any are missing, install them before proceeding.

ToolCheck CommandInstall (winget)Fallback Install
PAC CLIpac (prints version banner; pac --version is NOT valid)winget install Microsoft.PowerAppsCLIdotnet tool install --global Microsoft.PowerApps.CLI.Tool
.NET SDKdotnet --versionwinget install Microsoft.DotNet.SDK.9https://dotnet.microsoft.com/download
Azure CLIaz --versionwinget install Microsoft.AzureCLIhttps://aka.ms/installazurecliwindows
Gitgit --versionwinget install Git.Githttps://git-scm.com/downloads

After any winget install, the tool may not be in PATH until the terminal is restarted.

PAC CLI PATH Discovery (Windows)

If pac is not found after install, check these locations:

powershell
# winget install location (most common)
Test-Path "$env:LOCALAPPDATA\Microsoft\PowerAppsCLI\pac.exe"

# dotnet tool install location
Test-Path "$env:USERPROFILE\.dotnet\tools\pac.exe"

Add the found directory to PATH or use the full path in scripts.


Step 1 — Check PAC CLI Authentication

Run pac env who to verify the user is authenticated and get the current environment URL:

powershell
pac env who

Extract the Environment URL (e.g., https://org12345.crm.dynamics.com). Store as $envUrl.

If pac env who fails: The user needs to authenticate first:

powershell
pac auth create --deviceCode

Then select the target environment:

powershell
pac env select --environment <environment-id-or-url>

Multi-Environment Safety

Developers often work across multiple environments (dev, test, staging, prod). Never assume the active PAC auth profile is correct for the current task.

  • Run pac auth list to show all profiles
  • Use pac auth select --name <profile-name> to switch
  • Name profiles to reflect the environment (e.g., dev, staging, prod)

Step 1b — Confirm Target Environment (MANDATORY)

Before the first operation that touches a specific environment (creating tables, importing solutions, inserting data), you MUST:

  1. Show the user the environment URL you intend to use
  2. Ask them to confirm: "I'm about to make changes to <URL>. Is this the correct target environment?"
  3. Run pac org who to verify the active connection matches

Do not proceed until the user explicitly confirms. This is the single most important safety check — skipping it risks making irreversible changes to the wrong environment.

Once confirmed for a session, you do not need to re-confirm for every subsequent operation against the same environment.


Step 2 — Get Azure CLI Token

Get an access token for the Dataverse environment:

powershell
$token = az account get-access-token --resource "$envUrl" --query accessToken -o tsv

If az fails: Tell the user to run az login first.

Build the standard headers for all subsequent API calls:

powershell
$headers = @{
  Authorization  = "Bearer $token"
  "Content-Type" = "application/json"
  Accept         = "application/json"
  "OData-MaxVersion" = "4.0"
  "OData-Version" = "4.0"
}

Step 3 — Verify API Access

Make a lightweight test request to confirm the token works:

powershell
Invoke-RestMethod -Uri "$envUrl/api/data/v9.2/WhoAmI" -Headers $headers

If this returns a valid response with UserId, OrganizationId, and BusinessUnitId, proceed.

If it returns:

  • 401 Unauthorized — Token expired or invalid. Re-run Step 2.
  • 403 Forbidden — User lacks permissions. Check the user's security roles in the environment.

Token Refresh Pattern

Azure CLI tokens expire after ~60 minutes. Refresh before each major operation step or every 20 records:

powershell
$token = az account get-access-token --resource "$envUrl" --query accessToken -o tsv
$headers["Authorization"] = "Bearer $token"

Extract Publisher Prefix

Before creating any schema, discover the publisher prefix for the target solution:

powershell
$solution = Invoke-RestMethod -Uri "$envUrl/api/data/v9.2/solutions?`$filter=uniquename eq '<solution-name>'&`$select=_publisherid_value" -Headers $headers
$publisherId = $solution.value[0]._publisherid_value
$publisher = Invoke-RestMethod -Uri "$envUrl/api/data/v9.2/publishers($publisherId)?`$select=customizationprefix" -Headers $headers
$prefix = $publisher.customizationprefix  # e.g., "cr123"

This prefix is required for all table and column SchemaName values.

Frequently asked questions

What does the Dataverse Prerequisites AI skill do?

Shared prerequisite steps for any skill that interacts with the Dataverse OData Web API. Covers PAC CLI authentication, Azure CLI token acquisition, WhoAmI validation, environment URL extraction, and token refresh patterns. Triggers on "pac auth", "dataverse auth", "dataverse prerequisites", "connect to dataverse", "environment setup", "pac env who", "dataverse token", "azure cli token dataverse".

Why use Dataverse Prerequisites on TypingMind?

Because you install it once and use it with any model. Dataverse Prerequisites is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Dataverse Prerequisites in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/scottdurow/power-platform-full-stack-skills/tree/main/skills/dataverse-prerequisites. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Dataverse Prerequisites?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Dataverse Prerequisites?

As many as you like. As long as a model supports skills, you can use Dataverse Prerequisites with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Dataverse Prerequisites AI skill free?

It is published on GitHub by scottdurow. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇