Skip to content

Add Device Provisioning Service get tool - #3898

Merged
Connie Yau (conniey) merged 5 commits into
microsoft:mainfrom
khalilCodeX:feature/device-provisioning-service-get
Oct 16, 2026
Merged

Connie Yau (conniey) merged 5 commits into
microsoft:mainfrom
khalilCodeX:feature/device-provisioning-service-get

Conversation

@khalilCodeX

@khalilCodeX khalil Sayed (khalilCodeX) commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds first-class Azure Device Provisioning Service support with a read-only command for retrieving a DPS instance:

  • Raw tool: deviceprovisioning_service_get
  • Consolidated tool: get_azure_device_provisioning_service
  • CLI: azmcp deviceprovisioning service get --service <name> --resource-group <group> --subscription <subscription>

The implementation follows existing Azure MCP tool patterns, uses the shared authenticated ARM client, supports native AOT serialization, and returns an allow-listed response model. DPS authorization policies, keys, and linked IoT Hub connection strings are deliberately excluded.

Validation

  • Azure MCP Server build passes with 0 warnings and 0 errors
  • Device Provisioning unit tests pass (14 tests)
  • Consolidated tool metadata test passes
  • Command discovery verified with --learn
  • Formatting and changed-file spelling checks pass
  • DPS test-resource Bicep compiles
  • Native AOT publication succeeds
  • Recorded live-test session generated, inspected, and verified in playback mode
  • Recording published to Azure/azure-sdk-assets as Azure.Mcp.Tools.DeviceProvisioning.Tests_c0c784a6b9
  • ToolDescriptionEvaluator passes the required score (>= 0.4) and top-three ranking for every DPS prompt

ToolDescriptionEvaluator results

Prompt Score Rank
Get DPS service details in a resource group 0.742141 1
Show DPS instance configuration in a subscription 0.437738 3
Retrieve ID scope, allocation policy, endpoints, and linked IoT Hubs 0.643658 1

Documentation

  • Adds command documentation and example prompts
  • Adds the service to the Azure MCP README
  • Adds consolidated tool metadata, changelog entry, solution registrations, spelling configuration, and CODEOWNERS coverage

Reference

Invoking Livetests

Copilot submitted PRs are not trustworthy by default. Users with write access to the repo need to validate the contents of this PR before leaving a comment with the text /azp run mcp - pullrequest - live. This will trigger the necessary livetest workflows to complete required validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ae3e90da-ad11-496c-ac8d-5e77c48af218
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution khalil Sayed (@khalilCodeX)! We will review the pull request and get back to you soon.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Khalil Sayed added 2 commits October 8, 2026 23:42
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ae3e90da-ad11-496c-ac8d-5e77c48af218
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ae3e90da-ad11-496c-ac8d-5e77c48af218
@khalilCodeX

khalil Sayed (khalilCodeX) commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

The four failing build legs have the same root cause: DeviceProvisioningCommandTests.ShouldGetDeviceProvisioningService runs in playback mode, but the recording was not available in Azure/azure-sdk-assets. All DPS unit tests pass on the failing platforms.

The live recording has been generated, sanitized, audited, and verified locally in playback mode. Because khalilCodeX has read-only access to Azure/azure-sdk-assets, the test-proxy push returned 403. The exact generated commit and tag are available here:

A maintainer with write access to Azure/azure-sdk-assets can promote the generated tag without recreating the recording:

git fetch https://github.com/khalilCodeX/azure-sdk-assets.git refs/tags/Azure.Mcp.Tools.DeviceProvisioning.Tests_c0c784a6b9:refs/tags/Azure.Mcp.Tools.DeviceProvisioning.Tests_c0c784a6b9
git push https://github.com/Azure/azure-sdk-assets.git refs/tags/Azure.Mcp.Tools.DeviceProvisioning.Tests_c0c784a6b9

The dangling tag was removed from assets.json in commit 09133a270. Once a maintainer promotes the tag upstream, I will restore it in assets.json; the playback pipeline can then restore the recording and pass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The recording remains unpublished and the required ToolDescriptionEvaluator result is missing.

2 open findings
What changed in this PR

Adds a new read-only Azure Device Provisioning Service get tool, including ARM integration, safe response serialization, registration, documentation, and recorded tests.

Changes:

  • Adds the DPS get command, service, models, validation, and AOT serialization.
  • Registers raw and consolidated tools and updates documentation.
  • Adds unit, live, and deployment test infrastructure.
File Description
tools/​Azure.Mcp.Tools.DeviceProvisioning/​tests/​test-resources.bicep Deploys DPS test resources and RBAC.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​tests/​test-resources-post.ps1 Generates live-test settings.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​tests/​Azure.Mcp.Tools.DeviceProvisioning.Tests/​Service/​DeviceProvisioningServiceGetCommandTests.cs Tests command behavior and validation.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​tests/​Azure.Mcp.Tools.DeviceProvisioning.Tests/​Models/​DeviceProvisioningPropertiesTests.cs Verifies secret fields are excluded.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​tests/​Azure.Mcp.Tools.DeviceProvisioning.Tests/​DeviceProvisioningCommandTests.cs Adds recorded live coverage.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​tests/​Azure.Mcp.Tools.DeviceProvisioning.Tests/​Azure.Mcp.Tools.DeviceProvisioning.Tests.csproj Configures the test project.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​tests/​Azure.Mcp.Tools.DeviceProvisioning.Tests/​assets.json References recorded-test assets.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Services/​IDeviceProvisioningService.cs Defines the service contract.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Services/​DeviceProvisioningService.cs Retrieves and maps DPS resources.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Options/​Service/​DeviceProvisioningServiceGetOptions.cs Defines command options.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Models/​LinkedIoTHubProperties.cs Models safe linked-hub properties.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Models/​LinkedIoTHubDescription.cs Defines linked-hub output.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Models/​DeviceProvisioningServiceDescription.cs Defines the command response model.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Models/​DeviceProvisioningProperties.cs Allow-lists DPS properties.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​DeviceProvisioningSetup.cs Registers the area, service, and command.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Commands/​Service/​DeviceProvisioningServiceGetCommand.cs Implements the get command.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Commands/​DeviceProvisioningJsonContext.cs Adds AOT serialization metadata.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​src/​Azure.Mcp.Tools.DeviceProvisioning.csproj Defines the toolset project.
tools/​Azure.Mcp.Tools.DeviceProvisioning/​cspell.yaml Adds toolset spelling terms.
servers/​Azure.Mcp.Server/​src/​Resources/​consolidated-tools.json Registers the consolidated tool.
servers/​Azure.Mcp.Server/​src/​Program.cs Registers the toolset with the server.
servers/​Azure.Mcp.Server/​README.md Documents DPS support and examples.
servers/​Azure.Mcp.Server/​docs/​e2eTestPrompts.md Adds evaluation prompts.
servers/​Azure.Mcp.Server/​docs/​azmcp-commands.md Documents the CLI command.
servers/​Azure.Mcp.Server/​changelog-entries/​khalil-device-provisioning-service-get.yaml Adds the feature changelog entry.
servers/​Azure.Mcp.Server/​Azure.Mcp.Server.slnx Adds toolset projects to the server solution.
Microsoft.Mcp.slnx Adds toolset projects to the root solution.
.vscode/​cspell.json Adds the tool namespace spelling.
.github/​CODEOWNERS Assigns toolset ownership.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Khalil Sayed added 2 commits October 9, 2026 20:51
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ae3e90da-ad11-496c-ac8d-5e77c48af218
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ae3e90da-ad11-496c-ac8d-5e77c48af218
@conniey

Copy link
Copy Markdown
Member

/azp run mcp - pullrequest - live

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@conniey
Connie Yau (conniey) merged commit f5e0657 into microsoft:main Oct 16, 2026
39 checks passed
@khalilCodeX
khalil Sayed (khalilCodeX) deleted the feature/device-provisioning-service-get branch October 16, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants