Skip to content

az aks prepared-image-specification - #9887

Merged
Julie Zhu (yanzhudd) merged 4 commits into
Azure:mainfrom
jim-minter:aks-pis
Jun 16, 2026
Merged

Julie Zhu (yanzhudd) merged 4 commits into
Azure:mainfrom
jim-minter:aks-pis

Conversation

@jim-minter

@jim-minter Jim Minter (jim-minter) commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

az aks prepared-image-specification

# if the subscription you're using doesn't have the feature flag, then register it:
az feature register --namespace Microsoft.ContainerService -n AKSPreparedImageSpecificationPreview
az provider register -n Microsoft.ContainerService --wait

# now wait a bit, I'm not entirely sure why this isn't immediate :-/

az extension add --upgrade --source https://jminter.blob.core.windows.net/pis/aks_preview-21.0.0b5.dev0+jimminter1-py2.py3-none-any.whl

az aks prepared-image-specification create -g "$RG" -n "$NAME" \
  --container-images alpine busybox \
  --customization-scripts '[{"name":"myscript","script":"/bin/true","scriptType":"Bash","executionPoint":"NodeImageBuildTime"}]' \
  --assign-identity /subcriptions/x/resourceGroups/y/providers/Microsoft.ManagedIdentity/userAssignedIdentities/z \
  --version "$VERSION" \
  --tags k=v \
  --no-wait

az aks prepared-image-specification list

az aks prepared-image-specification list -g "$RG"

az aks prepared-image-specification show -g "$RG" -n "$NAME"

az aks prepared-image-specification version list -g "$RG" --pis-name "$NAME"

az aks prepared-image-specification version show -g "$RG" --pis-name "$NAME" -n "$VERSION"

az aks prepared-image-specification update -g "$RG" -n "$NAME" --tags k=newv

az aks prepared-image-specification version delete -g "$RG" --pis-name "$NAME" -n "$VERSION" --yes --no-wait

az aks prepared-image-specification delete -g "$RG" -n "$NAME" --yes --no-wait

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aks prepared-image-specification

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 wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented May 19, 2026 •

Copy link
Copy Markdown
❌Azure CLI Extensions Breaking Change Test
❌aks-preview
rule cmd_name rule_message suggest_message
❌ 1010 - ParaPropUpdate aks nodepool add cmd aks nodepool add update parameter spot_max_price: updated property default from nan to nan please change property default from nan to nan for parameter spot_max_price of cmd aks nodepool add
⚠️ 1006 - ParaAdd aks create cmd aks create added parameter prepared_image_specification_id
⚠️ 1006 - ParaAdd aks nodepool add cmd aks nodepool add added parameter prepared_image_specification_id
⚠️ 1006 - ParaAdd aks nodepool update cmd aks nodepool update added parameter prepared_image_specification_id
⚠️ 1011 - SubgroupAdd aks prepared-image-specification sub group aks prepared-image-specification added

@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Jim Minter (@jim-minter),
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 setup.py as well.

@yonzhan

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions

Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions

Copy link
Copy Markdown
Contributor

Hi Jim Minter (@jim-minter)

Release Suggestions

Module: aks-preview

  • Please log updates into to src/aks-preview/HISTORY.rst
  • Update VERSION to 21.0.0b2 in src/aks-preview/setup.py

Notes

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Hi Jim Minter (@jim-minter)

Release Suggestions

Module: aks-preview

  • Please log updates into to src/aks-preview/HISTORY.rst
  • Update VERSION to 21.0.0b2 in src/aks-preview/setup.py

Notes

@timmy-wright

Copy link
Copy Markdown
Contributor

Why does the user need to run this command:

az provider register -n Microsoft.ContainerService --wait

That shouldn't be necessary for PIS.

@jim-minter
Jim Minter (jim-minter) force-pushed the aks-pis branch 3 times, most recently from 2a2b32f to 111cfcd Compare June 9, 2026 19:10
@jim-minter
Jim Minter (jim-minter) marked this pull request as ready for review June 9, 2026 19:11
Copilot AI review requested due to automatic review settings June 9, 2026 19:11

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.

Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.

@jim-minter

Copy link
Copy Markdown
Contributor Author

Why does the user need to run this command:
az provider register -n Microsoft.ContainerService --wait
That shouldn't be necessary for PIS.

Tim Wright (@timmy-wright) This is only necessary until the feature flag is lifted, for use in subscriptions which do not yet have the feature flag set.

@jim-minter

Copy link
Copy Markdown
Contributor Author

Yong Zhang (@yonzhan) Julie Zhu (@yanzhudd) Tim Wright (@timmy-wright) FumingZhang this should be ready for review now, ptal?

@sinmentis

Copy link
Copy Markdown

When a PIS references a managed identity, the CLI grants the cluster identity the Managed Identity Operator role on it. But this only happens for create and nodepool add:

  • aks_create → calls ensure_pis_managed_identity_permission_for_cluster
  • aks_agentpool_add → calls ensure_pis_managed_identity_permission_for_agentpool
  • aks_agentpool_update → no call

So az aks nodepool update --pis-id sets the profile and returns success but never grants the role. Node provisioning then fails later, with nothing shown at CLI time.

aks_agentpool_update should call ensure_pis_managed_identity_permission_for_agentpool too, to match add and create.

@jim-minter

Copy link
Copy Markdown
Contributor Author

When a PIS references a managed identity, the CLI grants the cluster identity the Managed Identity Operator role on it. But this only happens for create and nodepool add:

  • aks_create → calls ensure_pis_managed_identity_permission_for_cluster
  • aks_agentpool_add → calls ensure_pis_managed_identity_permission_for_agentpool
  • aks_agentpool_update → no call

So az aks nodepool update --pis-id sets the profile and returns success but never grants the role. Node provisioning then fails later, with nothing shown at CLI time.

aks_agentpool_update should call ensure_pis_managed_identity_permission_for_agentpool too, to match add and create.

Thanks Shun Lyu (@sinmentis) ! Should be fixed now!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. This aligns with the api-specs for prepared image specification which is currently at 2026-02-02-preview. I've confirmed the postScriptAction field is in place which was my main concern.

@yanzhudd

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@jim-minter

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 9887 in repo Azure/azure-cli-extensions

@yanzhudd

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@jim-minter

Copy link
Copy Markdown
Contributor Author

@yanzhudd
Julie Zhu (yanzhudd) merged commit 855cc0d into Azure:main Jun 16, 2026
24 checks passed
@evannaderi evannaderi mentioned this pull request Jul 1, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants