Skip to content

{AKS} Specify principal type in Web App Routing live test - #10263

Merged
Julie Zhu (yanzhudd) merged 1 commit into
Azure:mainfrom
FumingZhang:aks/pim-role-assignment-principal-type-aks-preview
Sep 1, 2026
Merged

{AKS} Specify principal type in Web App Routing live test#10263
Julie Zhu (yanzhudd) merged 1 commit into
Azure:mainfrom
FumingZhang:aks/pim-role-assignment-principal-type-aks-preview

Conversation

@FumingZhang

@FumingZhang FumingZhang commented Aug 27, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes
️✔️ None

Related command

az role assignment create in test_aks_create_and_update_web_application_routing_dns_zone

Description

The Web App Routing live test creates a DNS Zone Contributor assignment for a managed identity by passing its object ID through --assignee. Azure CLI then attempts to query Microsoft Graph to infer the principal type. In app-only environments without Graph directory permissions, the GUID fallback leaves the type unset and omits principalType from the role-assignment request.

Use --assignee-object-id with --assignee-principal-type ServicePrincipal so the request is unambiguous and compliant with PIM Only Mode enforcement without requiring Graph inference.

This is a test-only compliance hardening change and does not alter customer-facing aks-preview behavior. It was split from #10262 so that the Data Protection product fix and this AKS live-test fix can be reviewed independently.

Validation

  • azdev style aks-preview --pep8 --pylint
  • python -m py_compile src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py
  • python scripts/ci/test_index.py -q — 9 passed, 2 skipped

The live scenario was not run because it provisions an AKS cluster and DNS resources. No extension version bump is needed for a test-only change.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

This PR changes only a live test, so it intentionally does not change the aks-preview version, history, or generated index.

Create the managed-identity role assignment by object ID with an explicit ServicePrincipal type so PIM Only Mode does not rely on Microsoft Graph inference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 27, 2026 05:47
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi FumingZhang,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

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.

Pull request overview

Updates the AKS Preview live test for Web App Routing so RBAC role assignment creation is explicit about the assignee’s identity type, avoiding Microsoft Graph principal-type inference in app-only environments.

Changes:

  • Switches the test’s az role assignment create invocation from --assignee to --assignee-object-id.
  • Adds --assignee-principal-type ServicePrincipal to ensure principalType is included in the request (PIM Only Mode compliant).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@yonzhan

Copy link
Copy Markdown
Collaborator

AKS

@yanzhudd
Julie Zhu (yanzhudd) merged commit 1a59487 into Azure:main Sep 1, 2026
44 checks passed
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.

4 participants