Logo Dataverse Prerequisites

Dataverse Prerequisites

Cộng đồng
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".

Tổng quan

Nhà phát hànhscottdurow
Kho mãpower-platform-full-stack-skills
Tên kỹ năngdataverse-prerequisites
Sao
39
Bản fork
10
Tệp đi kèm
Chỉ có hướng dẫn
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được scottdurow công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Dataverse Prerequisites trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/scottdurow/power-platform-full-stack-skills/tree/main/skills/dataverse-prerequisites
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân 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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Dataverse Prerequisites trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Dataverse Prerequisites ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Dataverse Prerequisites không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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.

Câu hỏi thường gặp

Kỹ năng AI Dataverse Prerequisites làm được gì?

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".

Vì sao nên dùng Dataverse Prerequisites trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Dataverse Prerequisites là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Dataverse Prerequisites trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/scottdurow/power-platform-full-stack-skills/tree/main/skills/dataverse-prerequisites. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Dataverse Prerequisites?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Dataverse Prerequisites với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Dataverse Prerequisites với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Dataverse Prerequisites có miễn phí không?

Kỹ năng này được scottdurow phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇