为 Power Pages 编写、配置并部署安全的服务器端逻辑与接口。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "add-server-logic" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/add-server-logic/SKILL.md 2. 保存为 ~/.claude/skills/add-server-logic/SKILL.md 3. 装好后重载技能,告诉我可以用了
请为我的 Power Pages 站点创建一个服务器端 Logic 文件,提供 POST /api/contact-submit 接口。它要校验姓名、邮箱和留言内容,过滤明显恶意输入,把数据写入 Dataverse 的 Contact Requests 表,并返回统一的 JSON 成功或失败响应。请同时说明需要的站点设置和部署步骤。
可直接部署的服务器端 JavaScript、所需配置项说明,以及接口行为与返回格式说明。
我现在在浏览器里调用外部价格计算服务并暴露了密钥,请帮我把这段逻辑迁移到 Power Pages Server Logic。要求:由服务端安全调用外部 API,前端只传产品 ID 和数量;服务端返回最终价格、折扣和错误信息。请重构代码并列出前后端改动点。
迁移后的服务端实现方案、前端调用方式调整建议,以及更安全的架构说明。
请检查我现有的 Power Pages Server Logic 文件,找出为什么在提交表单后会偶发 500 错误。请分析输入校验、异步调用、异常处理和日志记录是否有问题,并给出修复后的完整代码。如果需要,也请补充推荐的站点设置。
问题定位结果、修复后的完整代码,以及提升稳定性的配置与排错建议。
Plugin check: Run
node "${CLAUDE_PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
Create and manage one or more Power Pages Server Logic files — server-side JavaScript that runs securely on the Power Pages runtime, hidden from the browser and protected by web roles and table permissions. Server Logic enables secure external API integrations, Dataverse operations, and custom business logic without exposing sensitive code or credentials to the client.
fetch, XMLHttpRequest, setTimeout, or any DOM API. No npm packages are available.get, post, put, patch, del. The name is a reserved word in JavaScript and cannot be used.deleteJSON.stringify() when returning objects or arrays.Prerequisites:
- An existing Power Pages code site created
- The site must be deployed at least once (
.powerpages-sitefolder must exist) — server logic files live inside.powerpages-site/server-logic/, so deployment is required before any server logic can be created
Initial request: $ARGUMENTS
.js and .serverlogic.yml files in .powerpages-site/server-logic/<name>/Goal: Locate the Power Pages project root and confirm prerequisites
Actions:
Look for powerpages.config.json in the current directory or immediate subdirectories
If not found: Tell the user to create a site first with /create-site.
Read powerpages.config.json to get the site name and configuration:
Read package.json to determine the frontend framework (React, Vue, Angular, or Astro). This is needed for Phase 8 (client-side integration guidance). See ${CLAUDE_PLUGIN_ROOT}/references/framework-conventions.md for the full framework detection mapping.
…
为 Power Apps 代码应用接入 Azure DevOps 连接器,便于查询工单、提报缺陷与管理流水线。
帮助你将 Power Pages Web API 集成到前端,并完成权限配置与部署上线。