Skip to content

Create the dps-e2e DPS with local authentication disabled - #1279

Merged
Ewerton Scaboro da Silva (ewertons) merged 1 commit into
mainfrom
dps-e2e-dps-local-auth
Dec 5, 2026
Merged

Ewerton Scaboro da Silva (ewertons) merged 1 commit into
mainfrom
dps-e2e-dps-local-auth

Conversation

@ewertons

Copy link
Copy Markdown
Contributor

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: adds EntraProvisioningServiceClient, which is provisioningserviceclient authenticated with the pipeline's azure-identity credential (scope https://azure-devices-provisioning.net/.default) and pinned to DPS service API 2026-11-01, which accepts Entra tokens. It has a 10 s request timeout.
  • The four enrollment test modules use it. No test is removed or made conditional.

Devices still authenticate with symmetric keys and X.509 certificates; disabling local auth on the DPS does not affect device registration.

Verified locally:

  • Against a local HTTP endpoint: requests carry Authorization: Bearer, use api-version=2026-11-01, and request the DPS token scope.
  • All 24 tests collect, and a missing PROVISIONING_SERVICE_HOSTNAME fails collection.
  • ruff check passes.

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.

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.

🔵 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-01 and 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

@ewertons
Ewerton Scaboro da Silva (ewertons) merged commit c43a0df into main Dec 5, 2026
43 checks passed
@ewertons
Ewerton Scaboro da Silva (ewertons) deleted the dps-e2e-dps-local-auth branch December 5, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants