Repository navigation
Create the dps-e2e DPS with local authentication disabled - #1279
Merged
Merged
Conversation
The provisioning e2e tests manage enrollments with Microsoft Entra ID (the pipeline's service connection) instead of the DPS provisioningserviceowner key. EntraProvisioningServiceClient wraps provisioningserviceclient with an azure-identity credential and the DPS service API version that accepts Entra tokens.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Local HTTP checks establish request shape but cannot verify Entra authorization, RBAC propagation, or device registration against Azure DPS with local authentication disabled, requiring live end-to-end validation.
No open issues 🎉
What changed in this PR
Moves DPS end-to-end tests to Microsoft Entra ID service authentication, allowing the pipeline to disable DPS local authentication while preserving device authentication.
Changes:
- Disables DPS local authentication and replaces the service connection string with a hostname.
- Adds an Entra-authenticated service client using API version
2026-11-01and a 10-second request timeout. - Migrates all four enrollment test modules without removing tests.
| File | Description |
|---|---|
vsts/dps-e2e.yaml |
Disables DPS local authentication and passes the service hostname. |
tests/e2e/provisioning_e2e/tests/test_sync_symmetric_enrollments.py |
Uses Entra authentication for synchronous symmetric-key enrollment management. |
tests/e2e/provisioning_e2e/tests/test_sync_certificate_enrollments.py |
Uses Entra authentication for synchronous certificate enrollment management. |
tests/e2e/provisioning_e2e/tests/test_async_symmetric_enrollments.py |
Uses the Entra client and removes duplicate initialization. |
tests/e2e/provisioning_e2e/tests/test_async_certificate_enrollments.py |
Uses Entra authentication for asynchronous certificate enrollment management. |
tests/e2e/provisioning_e2e/service_helper.py |
Adds the Entra-authenticated DPS service client. |
Review effort: Balanced
Avishek (avishekpant)
approved these changes
Dec 5, 2026
Ewerton Scaboro da Silva (ewertons)
deleted the
dps-e2e-dps-local-auth
branch
December 5, 2026 01:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dps-e2e pipeline now creates its per-run DPS with local authentication disabled, as it already does for the IoT Hub. No DPS shared access key is read anymore.
vsts/dps-e2e.yaml:New-AzIotTestEnvironment -DisableDpsLocalAuth. This also grants the service connection Device Provisioning Service Data Contributor on the DPS. The DPS connection string is replaced by the DPS service host name (PROVISIONING_SERVICE_HOSTNAME).tests/e2e/provisioning_e2e/service_helper.py: addsEntraProvisioningServiceClient, which isprovisioningserviceclientauthenticated with the pipeline's azure-identity credential (scopehttps://azure-devices-provisioning.net/.default) and pinned to DPS service API2026-11-01, which accepts Entra tokens. It has a 10 s request timeout.Devices still authenticate with symmetric keys and X.509 certificates; disabling local auth on the DPS does not affect device registration.
Verified locally:
Authorization: Bearer, useapi-version=2026-11-01, and request the DPS token scope.PROVISIONING_SERVICE_HOSTNAMEfails collection.ruff checkpasses.