Skip to content

Conversation

@mabelegba
Copy link

Added user-assigned managed identity to ACR cache rule create/update

Support for specifying user-assigned managed identities was added to both cache rule creation and update commands, enabling secure tenant authentication. This includes CLI argument, parameter validation, model updates, CLI help, and unit tests.

Changes

  • Added --assign-identity CLI argument to az acr cache create and az acr cache update in _params.py and documented in _help.py.
  • Implemented identity processing and validation logic in cache.py, including resource ID format checks.
  • Updated cache rule model usage to set the identity property when the argument is provided.
  • Expanded unit tests in test_cache.py to cover identity parameter handling, including valid/invalid cases and integration with create/update flows.
  • Updated HISTORY.rst and incremented extension version in setup.py.

Impact

  • Enables assignment of user-assigned managed identities to cache rules, supporting secure authentication scenarios across subscriptions/tenants.
  • CLI now validates identity resource IDs for correctness, failing early on invalid input.

No breaking interface changes; non-identity operations remain unaffected.
Additional tests improve reliability; no evident performance impact or new external dependencies.

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

Related command

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.

yuc-Li and others added 30 commits July 29, 2024 16:29
* Updated vendored SDK files

* code changes for updated SDK

* New test cases

* Test fixes

* styling

* Version and history edits

* CI failures and test fixes

* CI failures and test fixes

* Re-run the test to trigger CI pipeline

---------

Co-authored-by: Harshit Surana <[email protected]>
Co-authored-by: Siddhant Singh <[email protected]>
* add vmmserver props field

* updated release history for v1.1.1

* update version in setup.py
* changing containers to be hosted on mcr

* changing input args for genpolicy

* some containers use empty string env vars. this allows for that

* updating tests and readme for new kata interface

* updating images and getting rid of unused code

* moving import statement

* using MCR images

* updating test to have empty command
* generate code

* update version

* add gateway commands

* remove vmware update

* run tests

* add gateway tests

* add tests

* hide subscription

* add arc module

* add gateway tests

* add NSP get test

* add service name for gateway

* add 200 response in nsp reconcile

* remove NSP PATCH

* fix pylint errors

* update codebase

* Update src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_update.py

Co-authored-by: Yan Zhu <[email protected]>

* fix ci error

* fix ci

* fix ci

* remove arc

* fix comment

* fix comment

* fix comment

---------

Co-authored-by: Yan Zhu <[email protected]>
yml to build and deploy azure-cli and azure-cli-extensions repos
build acrcache extension
Removing unused yml pipeline

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

### Related command
<!--- Please provide the related command with az {command} if you can,
so that we can quickly route to the related person to review. --->


### 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](https://github.com/Azure/azure-cli/blob/release/doc/extensions/versioning_guidelines.md)

For new extensions:

- [ ] My extension description/summary conforms to the [Extension
Summary
Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/extensions/extension_summary_guidelines.md).


### 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`.
---

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

### Related command
<!--- Please provide the related command with az {command} if you can,
so that we can quickly route to the related person to review. --->


### 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](https://github.com/Azure/azure-cli/blob/release/doc/extensions/versioning_guidelines.md)

For new extensions:

- [ ] My extension description/summary conforms to the [Extension
Summary
Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/extensions/extension_summary_guidelines.md).


### 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`.
Update python SDK to include platform filtering commands

---

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

### Related command
<!--- Please provide the related command with az {command} if you can,
so that we can quickly route to the related person to review. --->


### 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](https://github.com/Azure/azure-cli/blob/release/doc/extensions/versioning_guidelines.md)

For new extensions:

- [ ] My extension description/summary conforms to the [Extension
Summary
Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/extensions/extension_summary_guidelines.md).


### 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`.
---

Added CLI arguments for --platforms, --sync-referrers,
--include-artifact-types, and --exclude-artifact-types to az acr cache
create and az acr cache update.

Documentation:

Updated help and README to reflect new parameter options and usage
examples.

Wheel file updated to VERSION = '1.0.0c3' to avoid mix up with previous
whl files.


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

### Related command
<!--- Please provide the related command with az {command} if you can,
so that we can quickly route to the related person to review. --->


### 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](https://github.com/Azure/azure-cli/blob/release/doc/extensions/versioning_guidelines.md)

For new extensions:

- [ ] My extension description/summary conforms to the [Extension
Summary
Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/extensions/extension_summary_guidelines.md).


### 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`.
---

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

### Related command
<!--- Please provide the related command with az {command} if you can,
so that we can quickly route to the related person to review. --->


### 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](https://github.com/Azure/azure-cli/blob/release/doc/extensions/versioning_guidelines.md)

For new extensions:

- [ ] My extension description/summary conforms to the [Extension
Summary
Guidelines](https://github.com/Azure/azure-cli/blob/dev/doc/extensions/extension_summary_guidelines.md).


### 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`.
…e values in cache rule creation/update logic
update version
…pdate operations

Add user-assigned managed identity support to cache rule create and update operations
Copilot AI review requested due to automatic review settings October 28, 2025 12:15
@azure-client-tools-bot-prd
Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

@azure-client-tools-bot-prd
Copy link

Hi @mabelegba,
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
Collaborator

yonzhan commented Oct 28, 2025

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

@github-actions
Copy link

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>

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for user-assigned managed identities to Azure Container Registry (ACR) cache rules, enabling secure cross-tenant authentication. The implementation includes CLI argument additions, identity validation logic, model updates, and comprehensive unit tests.

Key changes:

  • Added --assign-identity parameter to az acr cache create and az acr cache update commands
  • Implemented identity resource ID validation with proper error handling
  • Extended unit tests covering identity parameter handling and validation scenarios

Reviewed Changes

Copilot reviewed 124 out of 169 changed files in this pull request and generated 3 comments.

File Description
src/acrcache/setup.py Incremented extension version to 1.0.0c7 and added vendored SDK package references
src/acrcache/azext_acrcache/tests/latest/test_cache.py Added comprehensive unit tests for identity processing, validation, and integration with create/update operations
src/acrcache/azext_acrcache/vendored_sdks/containerregistry/v2025_09_01_preview/* Added vendored SDK files for the new API version with cache rule examples

@@ -0,0 +1,4 @@
```yaml
input-file:
- ./containerregistry.json
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The input-file reference './containerregistry.json' does not exist in the diff or related files shown. Verify that this JSON specification file exists or update the reference path.

Suggested change
- ./containerregistry.json
- ./containerregistry.yaml

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,4 @@
```yaml
input-file:
- ./containerregistry_aspnetcore1.json
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

The input-file reference './containerregistry_aspnetcore1.json' does not exist in the diff or related files shown. Verify that this JSON specification file exists or update the reference path.

Suggested change
- ./containerregistry_aspnetcore1.json

Copilot uses AI. Check for mistakes.
},
"201": {
"headers": {
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/packages/rpm/archives/myArchiveName/versions/myArchiveVersionName/operationStatuses/archoveversion-00000000-0000-0000-0000-000000000000?api-version=2023-01-01-preview"
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

Typo in URL segment: 'archoveversion' should be 'archiveversion'.

Suggested change
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/packages/rpm/archives/myArchiveName/versions/myArchiveVersionName/operationStatuses/archoveversion-00000000-0000-0000-0000-000000000000?api-version=2023-01-01-preview"
"Azure-AsyncOperation": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/packages/rpm/archives/myArchiveName/versions/myArchiveVersionName/operationStatuses/archiveversion-00000000-0000-0000-0000-000000000000?api-version=2023-01-01-preview"

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Hi @mabelegba

Release Suggestions

Module: acrcache

  • Update VERSION to 1.0.0b1 in src/acrcache/setup.py

Notes

@mabelegba mabelegba changed the base branch from main to AzdevCI October 28, 2025 12:19
@microsoft-github-policy-service
Copy link
Contributor

1 file(s) have code issues.

File Issues
.github/policies/resourceManagement.yml Exception during deserialization. Failed to create an instance of type 'GitOps.PullRequestIssueManagement.Core.Primitives.Data.Frequencies.SearchFrequency'.. Cannot dynamically create an instance of type 'GitOps.PullRequestIssueManagement.Core.Primitives.Data.Frequencies.SearchFrequency'. Reason: Cannot create an abstract class.

Total execution time: 0.04 seconds

@mabelegba mabelegba requested a review from Copilot October 28, 2025 14:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 138 out of 20204 changed files in this pull request and generated 2 comments.

arg_group="Properties",
help="Webhook status.",
enum={"false": "Enabled", "true": "Disabled"},
default="Enalbed",
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'Enalbed' to 'Enabled'.

Suggested change
default="Enalbed",
default="Enabled",

Copilot uses AI. Check for mistakes.
"acat report webhook update",
)
class Update(AAZCommand):
"""Update an exiting AppComplianceAutomation webhook.
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'exiting' to 'existing'.

Suggested change
"""Update an exiting AppComplianceAutomation webhook.
"""Update an existing AppComplianceAutomation webhook.

Copilot uses AI. Check for mistakes.
@mabelegba mabelegba marked this pull request as draft October 28, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.