Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure creating a cache rule with Azure CLI v2.70 that doesn't require a credential set #822

Open
luisdlp opened this issue Mar 7, 2025 · 3 comments
Assignees
Labels
bug Feature bugs that should be fixed.

Comments

@luisdlp
Copy link

luisdlp commented Mar 7, 2025

Describe the bug
When creating a cache rule that doesn't require a credential set we get the following error:

UnboundLocalError: cannot access local variable 'rg' where it is not associated with a value.

This repros only on the newest Azure CLI version 2.70.

To Reproduce
Steps to reproduce the behavior:

  1. az acr cache create -n cacherule01 -r myresourcegroup --source-repo docker.io/repo/hello-world --target-repo dh/hello-world -g afreadportaltest

Expected behavior
Cache rule should be created with no error

Screenshots

Image

Any relevant environment information

  • Azure CLI/PowerShell/SDK version: Azure CLI v 2.70

Additional context
Add any other context about the problem here.

If any information is a concern to post here, you can create a support ticket or send an email to acrsup@microsoft.com.

@luisdlp luisdlp added the bug Feature bugs that should be fixed. label Mar 7, 2025
@luisdlp luisdlp self-assigned this Mar 7, 2025
@luisdlp
Copy link
Author

luisdlp commented Mar 7, 2025

We are investigating the fix. Workaround is to use previous CLI version or use a credential set.

@renshao
Copy link

renshao commented Mar 7, 2025

We have identified the root cause. Will put a fix in soon. The fix should come out in the next az cli release, i.e. 2.71.

renshao added a commit to renshao/azure-cli that referenced this issue Mar 7, 2025
With latest az cli 2.70 release we unfortunately introduced a
regression. Creating a cache rule without a credential set would crash.
It is caused by a local variable not declared in the correct scope.

A bug issue has been created to track this issue:
Azure/acr#822

This commit fixed the issue. Now creating cache rules work as expected.
zhoxing-ms pushed a commit to Azure/azure-cli that referenced this issue Mar 10, 2025
…uld fail (#30984)

With latest az cli 2.70 release we unfortunately introduced a
regression. Creating a cache rule without a credential set would crash.
It is caused by a local variable not declared in the correct scope.

A bug issue has been created to track this issue:
Azure/acr#822

This commit fixed the issue. Now creating cache rules work as expected.
@renshao
Copy link

renshao commented Mar 11, 2025

The fix has been merged into Azure/azure-cli dev branch: Azure/azure-cli#30984

It will be included in the next release of az cli, 2.71.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature bugs that should be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants