Dataverse Prerequisitesのロゴ

Dataverse Prerequisites

コミュニティ
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".

概要

公開者scottdurow
リポジトリpower-platform-full-stack-skills
スキル名dataverse-prerequisites
スター
39
フォーク
10
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    scottdurowがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルDataverse PrerequisitesをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/scottdurow/power-platform-full-stack-skills/tree/main/skills/dataverse-prerequisites
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでDataverse Prerequisitesを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にDataverse Prerequisitesを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Dataverse Prerequisitesは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

よくある質問

AIスキル「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".

TypingMindでDataverse Prerequisitesを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Dataverse Prerequisitesはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにDataverse Prerequisitesをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/scottdurow/power-platform-full-stack-skills/tree/main/skills/dataverse-prerequisitesを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Dataverse Prerequisitesを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Dataverse Prerequisitesは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもDataverse Prerequisitesを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Dataverse Prerequisites」は無料ですか?

scottdurowがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇