Skip to content

Migrate Cosmos tests to federated AAD - #5287

Draft
Tomas Varon (tvaron3) wants to merge 10 commits into
Azure:mainfrom
tvaron3:tvaron3-cosmos-federated-aad-tests
Draft

Tomas Varon (tvaron3) wants to merge 10 commits into
Azure:mainfrom
tvaron3:tvaron3-cosmos-federated-aad-tests

Conversation

@tvaron3

Copy link
Copy Markdown
Member

Migrate the existing Cosmos AAD live suite, BinaryEncodingRoundtripFuzz leg, and Partition Merge Preview leg to fully federated Entra ID authentication.

  • Use AAD Cosmos data-plane RBAC for item, query, and change-feed operations with disableLocalAuth enabled, proving there is no account-key fallback.
  • Add a private typed ARM test-support crate built on Azure Core HTTP/auth conventions for database, container, throughput, and partition-merge lifecycle.
  • Add propagation-aware metadata and data-path readiness handling for ARM-created resources, including hierarchical partition keys and fault-injection clients.
  • Provision partition merge on a dedicated preview-enabled ARM account because the fixed-account pipeline forces UseFederatedAuth=false.
  • Move binary fuzz and partition merge to a dedicated federated matrix while preserving the existing key-backed Gateway V2 legs.
  • Update Bicep role assignment/output behavior, pipeline setup, and directly related test documentation.

Validation includes formatting, all-target/all-feature checks and clippy for the affected Cosmos crates, targeted SDK/driver/helper tests, AAD-mode in-memory coverage, matrix JSON validation, PowerShell parsing, Bicep compilation, markdown linting, spelling checks, and independent staged-diff review.

Bicep compilation retains the expected warnings for the registered 2026-03-15 API version lacking local type metadata and the conditional listKeys output still required by preserved Gateway/key legs.

Move the AAD, binary round-trip fuzz, and partition merge live legs to federated credentials with local authentication disabled. Use a shared typed ARM test client for resource lifecycle and preserve key-backed Gateway V2 coverage separately.\n\nAdd propagation-aware setup and cleanup so data-plane RBAC tests do not fall back to account keys while ARM operations remain resilient to asynchronous resource availability.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

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

@github-actions github-actions Bot added the Cosmos The azure_cosmos crate label Sep 10, 2026
Gate non-Gateway environment resolution out of Gateway V2 builds so warnings-as-errors compilation succeeds. Retry transient ARM lock conflicts from direct responses and long-running operations during throughput transitions. Probe AAD item, query, and change-feed authorization independently to cover RBAC propagation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use a partition-scoped non-aggregate query to verify executeQuery RBAC without requiring unsupported cross-partition aggregate planning.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve the preferred-region client conflict by preserving federated authentication while applying the upstream vNext binary-encoding override.

Adopt the published Cosmos management SDK for supported lifecycle operations, retaining typed raw ARM fallbacks for newer container properties and the partition-merge API version.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avoid reintroducing the repository-banned ring crate through the legacy management SDK's Rustls feature while retaining its generated Cosmos ARM operations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Allow the published azure_mgmt_cosmosdb crate name in repository spelling checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the legacy generated Cosmos management dependency with the shared typed test-only ARM client built on the repository's current Azure Core stack.

Keep typed database, container, throughput, and partition-merge lifecycle operations while removing the Azure Core 0.21 dependency graph and credential adapter.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Integrate the latest Cosmos API changes and align the test ARM throughput model with the right-sized SDK integer types. Keep preview patch imports feature-gated so the full workspace remains warning-free.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use azure_mgmt_cosmosdb for database, container, throughput, and partition-merge lifecycle operations while retaining a typed raw fallback only for container fields the generated model cannot preserve.

Preserve idempotent and lock-retry behavior across legacy pipeline errors, align throughput values with current SDK types, and block legacy request logging paths that could expose ARM bearer tokens.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Integrate the latest upstream Cosmos SDK and driver changes while preserving the federated live-test configuration. Resolve the live DISTINCT test helper signature against the ARM-backed test framework.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Cosmos The azure_cosmos crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant