$npx -y skills add microsoft/power-platform-skills --skill add-azuredevopsAdds Azure DevOps connector to a Power Apps code app. Use when querying work items, creating bugs, managing pipelines, or making ADO API calls.
| 1 | **📋 Shared Instructions: [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md)** - Cross-cutting concerns. |
| 2 | |
| 3 | # Add Azure DevOps |
| 4 | |
| 5 | ## Workflow |
| 6 | |
| 7 | 1. Check Memory Bank → 2. Add Connector → 3. Apply HttpRequest Fix → 4. Configure → 5. Build → 6. Update Memory Bank |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ### Step 1: Check Memory Bank |
| 12 | |
| 13 | Check for `memory-bank.md` per [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md). |
| 14 | |
| 15 | ### Step 2: Add Connector |
| 16 | |
| 17 | **First, find the connection ID** (see [connector-reference.md](${PLUGIN_ROOT}/shared/connector-reference.md)): |
| 18 | |
| 19 | Run the `/list-connections` skill. Find the Azure DevOps connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from `power.config.json` or a prior step): `https://make.powerapps.com/environments/<environment-id>/connections` → **+ New connection** → search for the connector → Create. |
| 20 | |
| 21 | ```bash |
| 22 | npx power-apps add-data-source -a azuredevops -c <connection-id> |
| 23 | ``` |
| 24 | |
| 25 | ### Step 3: Apply HttpRequest Fix (Required) |
| 26 | |
| 27 | The generated code has a known issue: the `HttpRequest` method uses `parameters` as the parameter name, but the API expects `body`. Rename `parameters` to `body` in these 3 files: |
| 28 | |
| 29 | Use the `Edit` tool to rename `parameters` to `body` in each file: |
| 30 | |
| 31 | **1. `src/generated/services/AzureDevOpsService.ts`:** |
| 32 | Find the `HttpRequest` method. Rename the parameter and its usage: |
| 33 | |
| 34 | ```typescript |
| 35 | // BEFORE (generated): |
| 36 | async HttpRequest(parameters: any) { |
| 37 | const params = { parameters: parameters, ... }; |
| 38 | |
| 39 | // AFTER (fixed): |
| 40 | async HttpRequest(body: any) { |
| 41 | const params = { body: body, ... }; |
| 42 | ``` |
| 43 | |
| 44 | **2. `.power/appschemas/dataSourceInfo.ts`:** |
| 45 | Find the `visualstudioteamservices` → `HttpRequest` → `parameters` section. Rename the property key: |
| 46 | |
| 47 | ```typescript |
| 48 | // BEFORE (generated): |
| 49 | HttpRequest: { |
| 50 | parameters: { |
| 51 | parameters: { ... } |
| 52 | |
| 53 | // AFTER (fixed): |
| 54 | HttpRequest: { |
| 55 | parameters: { |
| 56 | body: { ... } |
| 57 | ``` |
| 58 | |
| 59 | **3. `.power/schemas/visualstudioteamservices/visualstudioteamservices.Schema.json`:** |
| 60 | Find the `/{connectionId}/httprequest` → `post` → `parameters` array. Change the `name` field: |
| 61 | |
| 62 | ```json |
| 63 | // BEFORE (generated): |
| 64 | { "name": "parameters", "in": "body", ... } |
| 65 | |
| 66 | // AFTER (fixed): |
| 67 | { "name": "body", "in": "body", ... } |
| 68 | ``` |
| 69 | |
| 70 | ### Step 4: Configure |
| 71 | |
| 72 | Ask the user what Azure DevOps operations they need (query work items, create items, trigger pipelines, etc.). |
| 73 | |
| 74 | **HttpRequest** -- make arbitrary ADO REST API calls: |
| 75 | |
| 76 | ```typescript |
| 77 | await AzureDevOpsService.HttpRequest({ |
| 78 | Uri: "https://dev.azure.com/{org}/{project}/_apis/wit/wiql?api-version=7.2", |
| 79 | Method: "POST", |
| 80 | Body: JSON.stringify({ |
| 81 | query: |
| 82 | "SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.TeamProject] = @project" |
| 83 | }) |
| 84 | }); |
| 85 | ``` |
| 86 | |
| 87 | Docs: [Azure DevOps REST API](https://learn.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-7.2) |
| 88 | |
| 89 | Use `Grep` to find specific methods in `src/generated/services/AzureDevOpsService.ts` (generated files can be very large -- see [connector-reference.md](${PLUGIN_ROOT}/shared/connector-reference.md#inspecting-large-generated-files)). |
| 90 | |
| 91 | ### Step 5: Build |
| 92 | |
| 93 | ```bash |
| 94 | npm run build |
| 95 | ``` |
| 96 | |
| 97 | Fix TypeScript errors before proceeding. Do NOT deploy yet. |
| 98 | |
| 99 | ### Step 6: Update Memory Bank |
| 100 | |
| 101 | Update `memory-bank.md` with: connector added, HttpRequest fix applied, build status. |