Skip to content

Commit b92e814

Browse files
committed
Fixed a cache rule creation bug
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.
1 parent 1c20fa6 commit b92e814

File tree

1 file changed

+1
-1
lines changed
  • src/azure-cli/azure/cli/command_modules/acr

1 file changed

+1
-1
lines changed

src/azure-cli/azure/cli/command_modules/acr/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ def acr_cache_create(cmd,
5656
resource_group_name=None,
5757
cred_set=None):
5858

59+
rg = get_resource_group_name_by_registry_name(cmd.cli_ctx, registry_name, resource_group_name)
5960
if cred_set:
6061
sub_id = get_subscription_id(cmd.cli_ctx)
61-
rg = get_resource_group_name_by_registry_name(cmd.cli_ctx, registry_name, resource_group_name)
6262
# Format the credential set ID using subscription ID, resource group, registry name, and credential set name
6363
cred_set_id = CREDENTIAL_SET_RESOURCE_ID_TEMPLATE.format(
6464
sub_id=sub_id,

0 commit comments

Comments
 (0)