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

[ACR] az acr tasks create | update, az acr build | run: Add ABAC support for ACR Tasks #31069

Draft
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

lizMSFT
Copy link
Contributor

@lizMSFT lizMSFT commented Mar 18, 2025

Related command
az acr tasks create | update
az acr build | run

Description
Added the new optional --source-registry-auth-id flag

This PR is not ready because the 2025-03-01-preview version hasn't been rolled out yet.

Testing Guide


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

Copy link

azure-client-tools-bot-prd bot commented Mar 18, 2025

❌AzureCLI-FullTest
❌acr
❌2020-09-01-hybrid
❌3.9
Type Test Case Error Message Line
Failed test_acr_create_webhook self = <urllib3.response.HTTPResponse object at 0x7fb910fc2730>

    @contextmanager
    def error_catcher(self):
        """
        Catch low-level python exceptions, instead re-raising urllib3
        variants, so that low-level exceptions are not leaked in the
        high-level api.
    
        On exit, release the connection back to the pool.
        """
        clean_exit = False
    
        try:
            try:
>               yield

env/lib/python3.9/site-packages/urllib3/response.py:444: 
                                        

self = <urllib3.response.HTTPResponse object at 0x7fb910fc2730>, amt = 4096
decode_content = True, cache_content = False

    def read(self, amt=None, decode_content=None, cache_content=False):
        """
        Similar to :meth:http.client.HTTPResponse.read, but with two additional
        parameters: decode_content and cache_content.
    
        :param amt:
            How much of the content to read. If specified, caching is skipped
            because it doesn't make sense to cache partial content as the full
            response.
    
        :param decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.
    
        :param cache_content:
            If True, will save the returned data such that the same result is
            returned despite of the state of the underlying file object. This
            is useful if you want the .data property to continue working
            after having .read() the file object. (Overridden if amt is
            set.)
        """
        self.init_decoder()
        if decode_content is None:
            decode_content = self.decode_content
    
        if self.fp is None:
            return
    
        flush_decoder = False
        fp_closed = getattr(self.fp, "closed", False)
    
        with self.error_catcher():
            data = self.fp_read(amt) if not fp_closed else b""
            if amt is None:
                flush_decoder = True
            else:
                cache_content = False
                if (
                    amt != 0 and not data
                ):  # Platform-specific: Buggy versions of Python.
                    # Close the connection when no data is returned
                    #
                    # This is redundant to what httplib/http.client should
                    # already do.  However, versions of python released before
                    # December 15, 2012 (http://bugs.python.org/issue16298)&nbsp;do
                    # not properly close the connection in all cases. There is
                    # no harm in redundantly calling close.
                    self.fp.close()
                    flush_decoder = True
                    if self.enforce_content_length and self.length_remaining not in (
                        0,
                        None,
                    ):
                        # This is an edge case that httplib failed to cover due
                        # to concerns of backward compatibility. We're
                        # addressing it here to make sure IncompleteRead is
                        # raised during streaming, so all calls with incorrect
                        # Content-Length are caught.
>                       raise IncompleteRead(self.fp_bytes_read, self.length_remaining)
E                       urllib3.exceptions.IncompleteRead: IncompleteRead(664 bytes read, 83 more expected)

env/lib/python3.9/site-packages/urllib3/response.py:593: IncompleteRead

During handling of the above exception, another exception occurred:

    def generate():
        # Special case for urllib3.
        if hasattr(self.raw, "stream"):
            try:
>               yield from self.raw.stream(chunk_size, decode_content=True)

env/lib/python3.9/site-packages/requests/models.py:820: 
 
 
 
 
 
 
 
                                 
env/lib/python3.9/site-packages/urllib3/response.py:628: in stream
    data = self.read(amt=amt, decode_content=decode_content)
env/lib/python3.9/site-packages/urllib3/response.py:593: in read
    raise IncompleteRead(self.fp_bytes_read, self.length_remaining)
/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/contextlib.py:137: in exit
    self.gen.throw(typ, value, traceback)
                                        

self = <urllib3.response.HTTPResponse object at 0x7fb910fc2730>

    @contextmanager
    def error_catcher(self):
        """
        Catch low-level python exceptions, instead re-raising urllib3
        variants, so that low-level exceptions are not leaked in the
        high-level api.
    
        On exit, release the connection back to the pool.
        """
        clean_exit = False
    
        try:
            try:
                yield
    
            except SocketTimeout:
                # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but
                # there is yet no clean way to get at it from this context.
                raise ReadTimeoutError(self.pool, None, "Read timed out.")
    
            except BaseSSLError as e:
                # FIXME: Is there a better way to differentiate between SSLErrors?
                if "read operation timed out" not in str(e):
                    # SSL errors related to framing/MAC get wrapped and reraised here
                    raise SSLError(e)
    
                raise ReadTimeoutError(self.pool, None, "Read timed out.")
    
            except (HTTPException, SocketError) as e:
                # This includes IncompleteRead.
>               raise ProtocolError("Connection broken: %r" % e, e)
E               urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(664 bytes read, 83 more expected)', IncompleteRead(664 bytes read, 83 more expected))

env/lib/python3.9/site-packages/urllib3/response.py:461: ProtocolError

During handling of the above exception, another exception occurred:

self = <azure.core.pipeline.transport.requests_basic.StreamDownloadGenerator object at 0x7fb913350ac0>

    def next(self):
        internal_response = self.response.internal_response
        try:
>           chunk = next(self.iter_content_func)

env/lib/python3.9/site-packages/azure/core/pipeline/transport/requests_basic.py:177: 
 
 
 
 
 
                                   

    def generate():
        # Special case for urllib3.
        if hasattr(self.raw, "stream"):
            try:
                yield from self.raw.stream(chunk_size, decode_content=True)
            except ProtocolError as e:
>               raise ChunkedEncodingError(e)
E               requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(664 bytes read, 83 more expected)', IncompleteRead(664 bytes read, 83 more expected))

env/lib/python3.9/site-packages/requests/models.py:822: ChunkedEncodingError

The above exception was the direct cause of the following exception:

self = <azure.cli.command_modules.acr.tests.hybrid_2020_09_01.test_acr_commands.AcrCommandsTests testMethod=test_acr_create_webhook>
resource_group = 'clitest.rg000001', resource_group_location = 'westus'

    @ResourceGroupPreparer()
    def test_acr_create_webhook(self, resource_group, resource_group_location):
        registry_name = self.create_random_name('clireg', 20)
        webhook_name = 'cliregwebhook'
    
        self.kwargs.update({
            'registry_name': registry_name,
            'webhook_name': webhook_name,
            'rg_loc': resource_group_location,
            'headers': 'key=value',
            'webhook_scope': 'hello-world',
            'uri': 'http://www.microsoft.com',
            'actions': 'push',
            'sku': 'Standard'
        })
    
>       self.cmd('acr create -n {registry_name} -g {rg} -l {rg_loc} --sku {sku}',
                 checks=[self.check('name', '{registry_name}'),
                         self.check('location', '{rg_loc}'),
                         self.check('adminUserEnabled', False),
                         self.check('sku.name', 'Standard'),
                         self.check('sku.tier', 'Standard'),
                         self.check('provisioningState', 'Succeeded')])

src/azure-cli/azure/cli/command_modules/acr/tests/hybrid_2020_09_01/test_acr_commands.py:133: 
                                        
src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in in_process_execute
    raise ex.exception
env/lib/python3.9/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
src/azure-cli-core/azure/cli/core/commands/command_operation.py:120: in handler
    return op(**command_args)
src/azure-cli/azure/cli/command_modules/acr/custom.py:93: in acr_create
    lro_poller = client.begin_create(resource_group_name, registry_name, registry)
env/lib/python3.9/site-packages/azure/core/tracing/decorator.py:94: in wrapper_use_tracer
    return func(*args, **kwargs)
env/lib/python3.9/site-packages/azure/mgmt/containerregistry/v2019_05_01/operations/registries_operations.py:924: in begin_create
    raw_result.http_response.read()  # type: ignore
env/lib/python3.9/site-packages/azure/core/rest/http_response_impl.py:407: in read
    self.content = b"".join(self.iter_bytes())
env/lib/python3.9/site-packages/azure/core/rest/http_response_impl.py:423: in iter_bytes
    yield from self.stream_download_generator(
 
 
 
 
 
 
 
 
 
                               

self = <azure.core.pipeline.transport._requests_basic.StreamDownloadGenerator object at 0x7fb913350ac0>

    def next(self):
        internal_response = self.response.internal_response
        try:
            chunk = next(self.iter_content_func)
            if not chunk:
                raise StopIteration()
            return chunk
        except StopIteration:
            internal_response.close()
            raise StopIteration()  # pylint: disable=raise-missing-from
        except requests.exceptions.StreamConsumedError:
            raise
        except requests.exceptions.ContentDecodingError as err:
            raise DecodeError(err, error=err) from err
        except requests.exceptions.ChunkedEncodingError as err:
            msg = err.str()
            if "IncompleteRead" in msg:
                _LOGGER.warning("Incomplete download: %s", err)
                internal_response.close()
>               raise IncompleteReadError(err, error=err) from err
E               azure.core.exceptions.IncompleteReadError: ('Connection broken: IncompleteRead(664 bytes read, 83 more expected)', IncompleteRead(664 bytes read, 83 more expected))

env/lib/python3.9/site-packages/azure/core/pipeline/transport/_requests_basic.py:193: IncompleteReadError
azure/cli/command_modules/acr/tests/hybrid_2020_09_01/test_acr_commands.py:116
Failed test_acr_create_with_managed_registry self = <urllib3.response.HTTPResponse object at 0x7fb910f9b160>

    @contextmanager
    def error_catcher(self):
        """
        Catch low-level python exceptions, instead re-raising urllib3
        variants, so that low-level exceptions are not leaked in the
        high-level api.
    
        On exit, release the connection back to the pool.
        """
        clean_exit = False
    
        try:
            try:
>               yield

env/lib/python3.9/site-packages/urllib3/response.py:444: 
                                        

self = <urllib3.response.HTTPResponse object at 0x7fb910f9b160>, amt = 4096
decode_content = True, cache_content = False

    def read(self, amt=None, decode_content=None, cache_content=False):
        """
        Similar to :meth:http.client.HTTPResponse.read, but with two additional
        parameters: decode_content and cache_content.
    
        :param amt:
            How much of the content to read. If specified, caching is skipped
            because it doesn't make sense to cache partial content as the full
            response.
    
        :param decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.
    
        :param cache_content:
            If True, will save the returned data such that the same result is
            returned despite of the state of the underlying file object. This
            is useful if you want the .data property to continue working
            after having .read() the file object. (Overridden if amt is
            set.)
        """
        self.init_decoder()
        if decode_content is None:
            decode_content = self.decode_content
    
        if self.fp is None:
            return
    
        flush_decoder = False
        fp_closed = getattr(self.fp, "closed", False)
    
        with self.error_catcher():
            data = self.fp_read(amt) if not fp_closed else b""
            if amt is None:
                flush_decoder = True
            else:
                cache_content = False
                if (
                    amt != 0 and not data
                ):  # Platform-specific: Buggy versions of Python.
                    # Close the connection when no data is returned
                    #
                    # This is redundant to what httplib/http.client should
                    # already do.  However, versions of python released before
                    # December 15, 2012 (http://bugs.python.org/issue16298)&nbsp;do
                    # not properly close the connection in all cases. There is
                    # no harm in redundantly calling close.
                    self.fp.close()
                    flush_decoder = True
                    if self.enforce_content_length and self.length_remaining not in (
                        0,
                        None,
                    ):
                        # This is an edge case that httplib failed to cover due
                        # to concerns of backward compatibility. We're
                        # addressing it here to make sure IncompleteRead is
                        # raised during streaming, so all calls with incorrect
                        # Content-Length are caught.
>                       raise IncompleteRead(self.fp_bytes_read, self.length_remaining)
E                       urllib3.exceptions.IncompleteRead: IncompleteRead(744 bytes read, 83 more expected)

env/lib/python3.9/site-packages/urllib3/response.py:593: IncompleteRead

During handling of the above exception, another exception occurred:

    def generate():
        # Special case for urllib3.
        if hasattr(self.raw, "stream"):
            try:
>               yield from self.raw.stream(chunk_size, decode_content=True)

env/lib/python3.9/site-packages/requests/models.py:820: 
 
 
 
 
 
 
 
                                 
env/lib/python3.9/site-packages/urllib3/response.py:628: in stream
    data = self.read(amt=amt, decode_content=decode_content)
env/lib/python3.9/site-packages/urllib3/response.py:593: in read
    raise IncompleteRead(self.fp_bytes_read, self.length_remaining)
/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/contextlib.py:137: in exit
    self.gen.throw(typ, value, traceback)
                                        

self = <urllib3.response.HTTPResponse object at 0x7fb910f9b160>

    @contextmanager
    def error_catcher(self):
        """
        Catch low-level python exceptions, instead re-raising urllib3
        variants, so that low-level exceptions are not leaked in the
        high-level api.
    
        On exit, release the connection back to the pool.
        """
        clean_exit = False
    
        try:
            try:
                yield
    
            except SocketTimeout:
                # FIXME: Ideally we'd like to include the url in the ReadTimeoutError but
                # there is yet no clean way to get at it from this context.
                raise ReadTimeoutError(self.pool, None, "Read timed out.")
    
            except BaseSSLError as e:
                # FIXME: Is there a better way to differentiate between SSLErrors?
                if "read operation timed out" not in str(e):
                    # SSL errors related to framing/MAC get wrapped and reraised here
                    raise SSLError(e)
    
                raise ReadTimeoutError(self.pool, None, "Read timed out.")
    
            except (HTTPException, SocketError) as e:
                # This includes IncompleteRead.
>               raise ProtocolError("Connection broken: %r" % e, e)
E               urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(744 bytes read, 83 more expected)', IncompleteRead(744 bytes read, 83 more expected))

env/lib/python3.9/site-packages/urllib3/response.py:461: ProtocolError

During handling of the above exception, another exception occurred:

self = <azure.core.pipeline.transport.requests_basic.StreamDownloadGenerator object at 0x7fb910fcc670>

    def next(self):
        internal_response = self.response.internal_response
        try:
>           chunk = next(self.iter_content_func)

env/lib/python3.9/site-packages/azure/core/pipeline/transport/requests_basic.py:177: 
 
 
 
 
 
                                   

    def generate():
        # Special case for urllib3.
        if hasattr(self.raw, "stream"):
            try:
                yield from self.raw.stream(chunk_size, decode_content=True)
            except ProtocolError as e:
>               raise ChunkedEncodingError(e)
E               requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(744 bytes read, 83 more expected)', IncompleteRead(744 bytes read, 83 more expected))

env/lib/python3.9/site-packages/requests/models.py:822: ChunkedEncodingError

The above exception was the direct cause of the following exception:

self = <azure.cli.command_modules.acr.tests.hybrid_2020_09_01.test_acr_commands.AcrCommandsTests testMethod=test_acr_create_with_managed_registry>
resource_group = 'clitest.rg000001', resource_group_location = 'westus'

    @ResourceGroupPreparer()
    def test_acr_create_with_managed_registry(self, resource_group, resource_group_location):
        registry_name = self.create_random_name('clireg', 20)
    
        self.kwargs.update({
            'registry_name': registry_name,
            'rg_loc': resource_group_location,
            'sku': 'Premium'
        })
    
>       self.cmd('acr create -n {registry_name} -g {rg} -l {rg_loc} --sku {sku}',
                 checks=[self.check('name', '{registry_name}'),
                         self.check('location', '{rg_loc}'),
                         self.check('adminUserEnabled', False),
                         self.check('sku.name', 'Premium'),
                         self.check('sku.tier', 'Premium'),
                         self.check('provisioningState', 'Succeeded')])

src/azure-cli/azure/cli/command_modules/acr/tests/hybrid_2020_09_01/test_acr_commands.py:107: 
                                        
src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in in_process_execute
    raise ex.exception
env/lib/python3.9/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
src/azure-cli-core/azure/cli/core/commands/command_operation.py:120: in handler
    return op(**command_args)
src/azure-cli/azure/cli/command_modules/acr/custom.py:93: in acr_create
    lro_poller = client.begin_create(resource_group_name, registry_name, registry)
env/lib/python3.9/site-packages/azure/core/tracing/decorator.py:94: in wrapper_use_tracer
    return func(*args, **kwargs)
env/lib/python3.9/site-packages/azure/mgmt/containerregistry/v2019_05_01/operations/registries_operations.py:924: in begin_create
    raw_result.http_response.read()  # type: ignore
env/lib/python3.9/site-packages/azure/core/rest/http_response_impl.py:407: in read
    self.content = b"".join(self.iter_bytes())
env/lib/python3.9/site-packages/azure/core/rest/http_response_impl.py:423: in iter_bytes
    yield from self.stream_download_generator(
 
 
 
 
 
 
 
 
 
                               

self = <azure.core.pipeline.transport._requests_basic.StreamDownloadGenerator object at 0x7fb910fcc670>

    def next(self):
        internal_response = self.response.internal_response
        try:
            chunk = next(self.iter_content_func)
            if not chunk:
                raise StopIteration()
            return chunk
        except StopIteration:
            internal_response.close()
            raise StopIteration()  # pylint: disable=raise-missing-from
        except requests.exceptions.StreamConsumedError:
            raise
        except requests.exceptions.ContentDecodingError as err:
            raise DecodeError(err, error=err) from err
        except requests.exceptions.ChunkedEncodingError as err:
            msg = err.str()
            if "IncompleteRead" in msg:
                _LOGGER.warning("Incomplete download: %s", err)
                internal_response.close()
>               raise IncompleteReadError(err, error=err) from err
E               azure.core.exceptions.IncompleteReadError: ('Connection broken: IncompleteRead(744 bytes read, 83 more expected)', IncompleteRead(744 bytes read, 83 more expected))

env/lib/python3.9/site-packages/azure/core/pipeline/transport/_requests_basic.py:193: IncompleteReadError
azure/cli/command_modules/acr/tests/hybrid_2020_09_01/test_acr_commands.py:96
🔄latest
🔄3.12
🔄3.9
🔄acs
️✔️2020-09-01-hybrid
️✔️3.9
🔄latest
🔄3.12
🔄3.9
🔄advisor
🔄latest
🔄3.12
🔄3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
🔄apim
🔄latest
🔄3.12
🔄3.9
🔄appconfig
🔄latest
🔄3.12
🔄3.9
❌appservice
❌latest
🔄3.12
❌3.9
Type Test Case Error Message Line
Failed test_acr_integration_function_app self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f4e9d2f8df0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f4e9ac8a7f0>
command = 'acr create --admin-enabled -g clitest.rg000001 -n functionappacrtest000004 --sku Basic'
expect_failure = False

    def in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
>           self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0

src/azure-cli-testsdk/azure/cli/testsdk/base.py:302: 
                                        
env/lib/python3.9/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
src/azure-cli-core/azure/cli/core/init.py:129: in exception_handler
    return handle_exception(ex)
                                        

ex = ValueError("API version 2025-03-01-preview does not have operation group 'registries'")
args = (), kwargs = {}

    def handle_main_exception(ex, *args, **kwargs):  # pylint: disable=unused-argument
        if isinstance(ex, CannotOverwriteExistingCassetteException):
            # This exception usually caused by a no match HTTP request. This is a product error
            # that is caused by change of SDK invocation.
            raise ex
    
>       raise CliExecutionError(ex)
E       azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception ValueError during execution and fails the command.

src/azure-cli-testsdk/azure/cli/testsdk/patches.py:35: CliExecutionError

During handling of the above exception, another exception occurred:

self = <azure.cli.command_modules.appservice.tests.latest.test_functionapp_commands.FunctionappACRScenarioTest testMethod=test_acr_integration_function_app>
resource_group = 'clitest.rg000001', storage_account = 'clitest000002'

    @ResourceGroupPreparer(location='eastus')
    @StorageAccountPreparer()
    @AllowLargeResponse()
    def test_acr_integration_function_app(self, resource_group, storage_account):
        plan = self.create_random_name(prefix='acrtestplanfunction', length=24)
        functionapp = self.create_random_name(
            prefix='functionappacrtest', length=24)
        runtime = 'node'
        acr_registry_name = functionapp
>       self.cmd('acr create --admin-enabled -g {} -n {} --sku Basic'.format(
            resource_group, acr_registry_name))

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:44: 
 
                                       
src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in in_process_execute
    raise ex.exception
env/lib/python3.9/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
src/azure-cli-core/azure/cli/core/commands/command_operation.py:111: in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
src/azure-cli/azure/cli/command_modules/acr/client_factory.py:25: in cf_acr_registries
    return get_acr_service_client(cli_ctx).registries
 
 
 
 
 
                                   

self = <azure.mgmt.containerregistry._container_registry_management_client.ContainerRegistryManagementClient object at 0x7f4e976eec10>

    @Property
    def registries(self):
        """Instance depends on the API version:
    
            2019-05-01: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01.operations.RegistriesOperations>
           
 2019-05-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01_preview.operations.RegistriesOperations>
            2019-06-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_06_01_preview.operations.RegistriesOperations>
           
 2020-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2020_11_01_preview.operations.RegistriesOperations>
            2021-08-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2021_08_01_preview.operations.RegistriesOperations>
           
 2022-02-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2022_02_01_preview.operations.RegistriesOperations>
            2023-01-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_01_01_preview.operations.RegistriesOperations>
           
 2023-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_11_01_preview.operations.RegistriesOperations>
           * 2024-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2024_11_01_preview.operations.RegistriesOperations>
        """
        api_version = self._get_api_version('registries')
        if api_version == '2019-05-01':
            from .v2019_05_01.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-06-01-preview':
            from .v2019_06_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2021-08-01-preview':
            from .v2021_08_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2022-02-01-preview':
            from .v2022_02_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-01-01-preview':
            from .v2023_01_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-11-01-preview':
            from .v2023_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2024-11-01-preview':
            from .v2024_11_01_preview.operations import RegistriesOperations as OperationClass
        else:
>           raise ValueError("API version {} does not have operation group 'registries'".format(api_version))
E           ValueError: API version 2025-03-01-preview does not have operation group 'registries'

env/lib/python3.9/site-packages/azure/mgmt/containerregistry/_container_registry_management_client.py:450: ValueError
azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:34
Failed test_acr_create_function_app self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f4e9d2f01c0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f4e9ac2e6a0>
command = 'acr create --admin-enabled -g clitest.rg000001 -n functionappacrtest000004 --sku Basic'
expect_failure = False

    def in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
>           self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0

src/azure-cli-testsdk/azure/cli/testsdk/base.py:302: 
                                        
env/lib/python3.9/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
src/azure-cli-core/azure/cli/core/init.py:129: in exception_handler
    return handle_exception(ex)
                                        

ex = ValueError("API version 2025-03-01-preview does not have operation group 'registries'")
args = (), kwargs = {}

    def handle_main_exception(ex, *args, **kwargs):  # pylint: disable=unused-argument
        if isinstance(ex, CannotOverwriteExistingCassetteException):
            # This exception usually caused by a no match HTTP request. This is a product error
            # that is caused by change of SDK invocation.
            raise ex
    
>       raise CliExecutionError(ex)
E       azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception ValueError during execution and fails the command.

src/azure-cli-testsdk/azure/cli/testsdk/patches.py:35: CliExecutionError

During handling of the above exception, another exception occurred:

self = <azure.cli.command_modules.appservice.tests.latest.test_functionapp_commands.FunctionAppCreateUsingACR testMethod=test_acr_create_function_app>
resource_group = 'clitest.rg000001', storage_account = 'clitestacr000002'

    @ResourceGroupPreparer(location='brazilsouth')
    @StorageAccountPreparer(name_prefix='clitestacr')
    @AllowLargeResponse()
    def test_acr_create_function_app(self, resource_group, storage_account):
        plan = self.create_random_name(prefix='acrtestplanfunction', length=24)
        functionapp = self.create_random_name(
            prefix='functionappacrtest', length=24)
        runtime = 'node'
        acr_registry_name = functionapp
>       self.cmd('acr create --admin-enabled -g {} -n {} --sku Basic'.format(
            resource_group, acr_registry_name))

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:93: 
 
                                       
src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in in_process_execute
    raise ex.exception
env/lib/python3.9/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
src/azure-cli-core/azure/cli/core/commands/command_operation.py:111: in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
src/azure-cli/azure/cli/command_modules/acr/client_factory.py:25: in cf_acr_registries
    return get_acr_service_client(cli_ctx).registries
 
 
 
 
 
                                   

self = <azure.mgmt.containerregistry._container_registry_management_client.ContainerRegistryManagementClient object at 0x7f4e97683a60>

    @Property
    def registries(self):
        """Instance depends on the API version:
    
            2019-05-01: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01.operations.RegistriesOperations>
           
 2019-05-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01_preview.operations.RegistriesOperations>
            2019-06-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_06_01_preview.operations.RegistriesOperations>
           
 2020-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2020_11_01_preview.operations.RegistriesOperations>
            2021-08-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2021_08_01_preview.operations.RegistriesOperations>
           
 2022-02-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2022_02_01_preview.operations.RegistriesOperations>
            2023-01-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_01_01_preview.operations.RegistriesOperations>
           
 2023-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_11_01_preview.operations.RegistriesOperations>
           * 2024-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2024_11_01_preview.operations.RegistriesOperations>
        """
        api_version = self._get_api_version('registries')
        if api_version == '2019-05-01':
            from .v2019_05_01.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-06-01-preview':
            from .v2019_06_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2021-08-01-preview':
            from .v2021_08_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2022-02-01-preview':
            from .v2022_02_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-01-01-preview':
            from .v2023_01_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-11-01-preview':
            from .v2023_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2024-11-01-preview':
            from .v2024_11_01_preview.operations import RegistriesOperations as OperationClass
        else:
>           raise ValueError("API version {} does not have operation group 'registries'".format(api_version))
E           ValueError: API version 2025-03-01-preview does not have operation group 'registries'

env/lib/python3.9/site-packages/azure/mgmt/containerregistry/_container_registry_management_client.py:450: ValueError
azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:83
Failed test_acr_deployment_function_app self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f4e98d731f0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f4e9ab12730>
command = 'acr create --admin-enabled -g clitest.rg000001 -n functionappacrtest000004 --sku Basic'
expect_failure = False

    def in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
>           self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0

src/azure-cli-testsdk/azure/cli/testsdk/base.py:302: 
                                        
env/lib/python3.9/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
src/azure-cli-core/azure/cli/core/init.py:129: in exception_handler
    return handle_exception(ex)
                                        

ex = ValueError("API version 2025-03-01-preview does not have operation group 'registries'")
args = (), kwargs = {}

    def handle_main_exception(ex, *args, **kwargs):  # pylint: disable=unused-argument
        if isinstance(ex, CannotOverwriteExistingCassetteException):
            # This exception usually caused by a no match HTTP request. This is a product error
            # that is caused by change of SDK invocation.
            raise ex
    
>       raise CliExecutionError(ex)
E       azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception ValueError during execution and fails the command.

src/azure-cli-testsdk/azure/cli/testsdk/patches.py:35: CliExecutionError

During handling of the above exception, another exception occurred:

self = <azure.cli.command_modules.appservice.tests.latest.test_functionapp_commands.FunctionappACRDeploymentScenarioTest testMethod=test_acr_deployment_function_app>
resource_group = 'clitest.rg000001', storage_account = 'clitestacrdeploy000002'

    @ResourceGroupPreparer(location='brazilsouth')
    @StorageAccountPreparer(name_prefix='clitestacrdeploy')
    def test_acr_deployment_function_app(self, resource_group, storage_account):
        plan = self.create_random_name(prefix='acrtestplanfunction', length=24)
        functionapp = self.create_random_name(
            prefix='functionappacrtest', length=24)
        runtime = 'node'
        acr_registry_name = functionapp
>       self.cmd('acr create --admin-enabled -g {} -n {} --sku Basic'.format(
            resource_group, acr_registry_name))

src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:143: 
 
                                       
src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in in_process_execute
    raise ex.exception
env/lib/python3.9/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
src/azure-cli-core/azure/cli/core/commands/command_operation.py:111: in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
src/azure-cli/azure/cli/command_modules/acr/client_factory.py:25: in cf_acr_registries
    return get_acr_service_client(cli_ctx).registries
 
 
 
 
 
                                   

self = <azure.mgmt.containerregistry._container_registry_management_client.ContainerRegistryManagementClient object at 0x7f4e97762df0>

    @Property
    def registries(self):
        """Instance depends on the API version:
    
            2019-05-01: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01.operations.RegistriesOperations>
           
 2019-05-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01_preview.operations.RegistriesOperations>
            2019-06-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_06_01_preview.operations.RegistriesOperations>
           
 2020-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2020_11_01_preview.operations.RegistriesOperations>
            2021-08-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2021_08_01_preview.operations.RegistriesOperations>
           
 2022-02-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2022_02_01_preview.operations.RegistriesOperations>
            2023-01-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_01_01_preview.operations.RegistriesOperations>
           
 2023-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_11_01_preview.operations.RegistriesOperations>
           * 2024-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2024_11_01_preview.operations.RegistriesOperations>
        """
        api_version = self._get_api_version('registries')
        if api_version == '2019-05-01':
            from .v2019_05_01.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-06-01-preview':
            from .v2019_06_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2021-08-01-preview':
            from .v2021_08_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2022-02-01-preview':
            from .v2022_02_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-01-01-preview':
            from .v2023_01_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-11-01-preview':
            from .v2023_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2024-11-01-preview':
            from .v2024_11_01_preview.operations import RegistriesOperations as OperationClass
        else:
>           raise ValueError("API version {} does not have operation group 'registries'".format(api_version))
E           ValueError: API version 2025-03-01-preview does not have operation group 'registries'

env/lib/python3.9/site-packages/azure/mgmt/containerregistry/_container_registry_management_client.py:450: ValueError
azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py:134
Failed test_staticapp_linked_backends The error message is too long, please check the pipeline log for details. azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands.py:11
Failed test_acr_integration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py:1381
Failed test_linux_slot_container_settings_override The error message is too long, please check the pipeline log for details. azure/cli/command_modules/appservice/tests/latest/test_webapp_commands.py:1403
🔄aro
🔄latest
🔄3.12
🔄3.9
🔄backup
🔄latest
🔄3.12
🔄3.9
🔄batch
🔄latest
🔄3.12
🔄3.9
🔄batchai
🔄latest
🔄3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
🔄botservice
🔄latest
🔄3.12
🔄3.9
🔄cdn
🔄latest
🔄3.12
️✔️3.9
🔄cloud
🔄latest
🔄3.12
🔄3.9
🔄cognitiveservices
🔄latest
🔄3.12
🔄3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
🔄computefleet
🔄latest
🔄3.12
️✔️3.9
🔄config
🔄latest
🔄3.12
️✔️3.9
🔄configure
🔄latest
🔄3.12
🔄3.9
🔄consumption
🔄latest
🔄3.12
🔄3.9
🔄container
🔄latest
🔄3.12
🔄3.9
🔄containerapp
🔄latest
🔄3.12
🔄3.9
🔄core
️✔️2018-03-01-hybrid
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.9
🔄latest
🔄3.12
🔄3.9
🔄cosmosdb
🔄latest
🔄3.12
🔄3.9
️✔️databoxedge
️✔️2020-09-01-hybrid
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
🔄dls
🔄latest
🔄3.12
️✔️3.9
🔄dms
🔄latest
🔄3.12
🔄3.9
🔄eventgrid
🔄latest
🔄3.12
🔄3.9
🔄eventhubs
🔄latest
🔄3.12
🔄3.9
🔄feedback
🔄latest
🔄3.12
🔄3.9
🔄find
🔄latest
🔄3.12
🔄3.9
🔄hdinsight
🔄latest
🔄3.12
🔄3.9
🔄identity
🔄latest
🔄3.12
🔄3.9
🔄iot
️✔️2020-09-01-hybrid
️✔️3.9
🔄latest
🔄3.12
🔄3.9
🔄keyvault
️✔️2018-03-01-hybrid
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.9
🔄latest
🔄3.12
🔄3.9
🔄lab
🔄latest
🔄3.12
️✔️3.9
🔄managedservices
🔄latest
🔄3.12
🔄3.9
🔄maps
🔄latest
🔄3.12
🔄3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
🔄monitor
🔄latest
🔄3.12
🔄3.9
🔄mysql
🔄latest
🔄3.12
🔄3.9
🔄netappfiles
🔄latest
🔄3.12
🔄3.9
❌network
️✔️2018-03-01-hybrid
️✔️3.9
❌latest
🔄3.12
❌3.9
Type Test Case Error Message Line
Failed test_private_endpoint_connection_acr self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f2d1ae0fbb0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f2d1b73d400>
command = 'acr create --name testreg000002 --resource-group clitest.rg000001 --sku premium'
expect_failure = False

    def in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
>           self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0

src/azure-cli-testsdk/azure/cli/testsdk/base.py:302: 
                                        
env/lib/python3.9/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
src/azure-cli-core/azure/cli/core/init.py:129: in exception_handler
    return handle_exception(ex)
                                        

ex = ValueError("API version 2025-03-01-preview does not have operation group 'registries'")
args = (), kwargs = {}

    def handle_main_exception(ex, *args, **kwargs):  # pylint: disable=unused-argument
        if isinstance(ex, CannotOverwriteExistingCassetteException):
            # This exception usually caused by a no match HTTP request. This is a product error
            # that is caused by change of SDK invocation.
            raise ex
    
>       raise CliExecutionError(ex)
E       azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception ValueError during execution and fails the command.

src/azure-cli-testsdk/azure/cli/testsdk/patches.py:35: CliExecutionError

During handling of the above exception, another exception occurred:

self = <azure.cli.command_modules.network.tests.latest.test_private_endpoint_commands.NetworkPrivateLinkACRScenarioTest testMethod=test_private_endpoint_connection_acr>
resource_group = 'clitest.rg000001'

    @ResourceGroupPreparer(location='centralus')
    def test_private_endpoint_connection_acr(self, resource_group):
        self.kwargs.update({
            'registry_name': self.create_random_name('testreg', 20),
            'vnet_name': self.create_random_name('testvnet', 20),
            'subnet_name': self.create_random_name('testsubnet', 20),
            'endpoint_name': self.create_random_name('priv_endpoint', 25),
            'endpoint_conn_name': self.create_random_name('priv_endpointconn', 25),
            'second_endpoint_name': self.create_random_name('priv_endpoint', 25),
            'second_endpoint_conn_name': self.create_random_name('priv_endpointconn', 25),
            'description_msg': 'somedescription'
        })
    
        # create subnet with disabled endpoint network policies
        self.cmd('network vnet create -g {rg} -n {vnet_name} --subnet-name {subnet_name}')
        self.cmd('network vnet subnet update -g {rg} --vnet-name {vnet_name} --name {subnet_name} --disable-private-endpoint-network-policies true')
    
>       result = self.cmd('acr create --name {registry_name} --resource-group {rg} --sku premium').get_output_in_json()

src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:462: 
 
                                       
src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in in_process_execute
    raise ex.exception
env/lib/python3.9/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
src/azure-cli-core/azure/cli/core/commands/command_operation.py:111: in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
src/azure-cli/azure/cli/command_modules/acr/client_factory.py:25: in cf_acr_registries
    return get_acr_service_client(cli_ctx).registries
 
 
 
 
 
                                   

self = <azure.mgmt.containerregistry._container_registry_management_client.ContainerRegistryManagementClient object at 0x7f2d198b2310>

    @Property
    def registries(self):
        """Instance depends on the API version:
    
            2019-05-01: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01.operations.RegistriesOperations>
           
 2019-05-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01_preview.operations.RegistriesOperations>
            2019-06-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_06_01_preview.operations.RegistriesOperations>
           
 2020-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2020_11_01_preview.operations.RegistriesOperations>
            2021-08-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2021_08_01_preview.operations.RegistriesOperations>
           
 2022-02-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2022_02_01_preview.operations.RegistriesOperations>
            2023-01-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_01_01_preview.operations.RegistriesOperations>
           
 2023-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_11_01_preview.operations.RegistriesOperations>
           * 2024-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2024_11_01_preview.operations.RegistriesOperations>
        """
        api_version = self._get_api_version('registries')
        if api_version == '2019-05-01':
            from .v2019_05_01.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-06-01-preview':
            from .v2019_06_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2021-08-01-preview':
            from .v2021_08_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2022-02-01-preview':
            from .v2022_02_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-01-01-preview':
            from .v2023_01_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-11-01-preview':
            from .v2023_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2024-11-01-preview':
            from .v2024_11_01_preview.operations import RegistriesOperations as OperationClass
        else:
>           raise ValueError("API version {} does not have operation group 'registries'".format(api_version))
E           ValueError: API version 2025-03-01-preview does not have operation group 'registries'

env/lib/python3.9/site-packages/azure/mgmt/containerregistry/_container_registry_management_client.py:450: ValueError
azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:444
Failed test_private_link_resource_acr self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f2d1ae770d0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f2d1b50deb0>
command = 'acr create --name testreg000002 --resource-group cli_test_sa_plr000001 --sku premium'
expect_failure = False

    def in_process_execute(self, cli_ctx, command, expect_failure=False):
        from io import StringIO
        from vcr.errors import CannotOverwriteExistingCassetteException
    
        if command.startswith('az '):
            command = command[3:]
    
        stdout_buf = StringIO()
        logging_buf = StringIO()
        try:
            # issue: stderr cannot be redirect in this form, as a result some failure information
            # is lost when command fails.
>           self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0

src/azure-cli-testsdk/azure/cli/testsdk/base.py:302: 
                                        
env/lib/python3.9/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
src/azure-cli-core/azure/cli/core/init.py:129: in exception_handler
    return handle_exception(ex)
                                        

ex = ValueError("API version 2025-03-01-preview does not have operation group 'registries'")
args = (), kwargs = {}

    def handle_main_exception(ex, *args, **kwargs):  # pylint: disable=unused-argument
        if isinstance(ex, CannotOverwriteExistingCassetteException):
            # This exception usually caused by a no match HTTP request. This is a product error
            # that is caused by change of SDK invocation.
            raise ex
    
>       raise CliExecutionError(ex)
E       azure.cli.testsdk.exceptions.CliExecutionError: The CLI throws exception ValueError during execution and fails the command.

src/azure-cli-testsdk/azure/cli/testsdk/patches.py:35: CliExecutionError

During handling of the above exception, another exception occurred:

self = <azure.cli.command_modules.network.tests.latest.test_private_endpoint_commands.NetworkPrivateLinkACRScenarioTest testMethod=test_private_link_resource_acr>

    @ResourceGroupPreparer(name_prefix='cli_test_sa_plr')
    def test_private_link_resource_acr(self):
        self.kwargs.update({
            'registry_name': self.create_random_name('testreg', 20)
        })
>       result = self.cmd('acr create --name {registry_name} --resource-group {rg} --sku premium').get_output_in_json()

src/azure-cli/azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:440: 
 
                                       
src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
    return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in in_process_execute
    raise ex.exception
env/lib/python3.9/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
src/azure-cli-core/azure/cli/core/commands/init.py:666: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:734: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
src/azure-cli-core/azure/cli/core/commands/init.py:703: in run_job
    result = cmd_copy(params)
src/azure-cli-core/azure/cli/core/commands/init.py:336: in call
    return self.handler(*args, **kwargs)
src/azure-cli-core/azure/cli/core/commands/command_operation.py:111: in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
src/azure-cli/azure/cli/command_modules/acr/client_factory.py:25: in cf_acr_registries
    return get_acr_service_client(cli_ctx).registries
 
 
 
 
 
                                   

self = <azure.mgmt.containerregistry._container_registry_management_client.ContainerRegistryManagementClient object at 0x7f2d1ad8dc40>

    @Property
    def registries(self):
        """Instance depends on the API version:
    
            2019-05-01: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01.operations.RegistriesOperations>
           
 2019-05-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_05_01_preview.operations.RegistriesOperations>
            2019-06-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2019_06_01_preview.operations.RegistriesOperations>
           
 2020-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2020_11_01_preview.operations.RegistriesOperations>
            2021-08-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2021_08_01_preview.operations.RegistriesOperations>
           
 2022-02-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2022_02_01_preview.operations.RegistriesOperations>
            2023-01-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_01_01_preview.operations.RegistriesOperations>
           
 2023-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2023_11_01_preview.operations.RegistriesOperations>
           * 2024-11-01-preview: :class:RegistriesOperations<azure.mgmt.containerregistry.v2024_11_01_preview.operations.RegistriesOperations>
        """
        api_version = self._get_api_version('registries')
        if api_version == '2019-05-01':
            from .v2019_05_01.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-05-01-preview':
            from .v2019_05_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2019-06-01-preview':
            from .v2019_06_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2020-11-01-preview':
            from .v2020_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2021-08-01-preview':
            from .v2021_08_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2022-02-01-preview':
            from .v2022_02_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-01-01-preview':
            from .v2023_01_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2023-11-01-preview':
            from .v2023_11_01_preview.operations import RegistriesOperations as OperationClass
        elif api_version == '2024-11-01-preview':
            from .v2024_11_01_preview.operations import RegistriesOperations as OperationClass
        else:
>           raise ValueError("API version {} does not have operation group 'registries'".format(api_version))
E           ValueError: API version 2025-03-01-preview does not have operation group 'registries'

env/lib/python3.9/site-packages/azure/mgmt/containerregistry/_container_registry_management_client.py:450: ValueError
azure/cli/command_modules/network/tests/latest/test_private_endpoint_commands.py:434
🔄policyinsights
🔄latest
🔄3.12
🔄3.9
🔄privatedns
🔄latest
🔄3.12
🔄3.9
🔄profile
🔄latest
🔄3.12
🔄3.9
🔄rdbms
🔄latest
🔄3.12
🔄3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
🔄relay
🔄latest
🔄3.12
🔄3.9
🔄resource
️✔️2018-03-01-hybrid
️✔️3.9
🔄latest
🔄3.12
🔄3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
🔄search
🔄latest
🔄3.12
🔄3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
🔄servicebus
🔄latest
🔄3.12
🔄3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
🔄servicefabric
🔄latest
🔄3.12
️✔️3.9
🔄signalr
🔄latest
🔄3.12
️✔️3.9
🔄sql
🔄latest
🔄3.12
🔄3.9
🔄sqlvm
🔄latest
🔄3.12
️✔️3.9
🔄storage
️✔️2018-03-01-hybrid
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.9
🔄latest
🔄3.12
🔄3.9
🔄synapse
🔄latest
🔄3.12
🔄3.9
🔄telemetry
️✔️2018-03-01-hybrid
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.9
🔄latest
🔄3.12
🔄3.9
🔄util
🔄latest
🔄3.12
️✔️3.9
🔄vm
️✔️2018-03-01-hybrid
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.9
🔄latest
🔄3.12
🔄3.9

Copy link

Hi @lizMSFT,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

Copy link

azure-client-tools-bot-prd bot commented Mar 18, 2025

❌AzureCLI-BreakingChangeTest
❌acr
rule cmd_name rule_message suggest_message
1006 - ParaAdd acr build cmd acr build added parameter source_location please remove parameter source_location for cmd acr build
1006 - ParaAdd acr pack build cmd acr pack build added parameter source_location please remove parameter source_location for cmd acr pack build
1006 - ParaAdd acr run cmd acr run added parameter source_location please remove parameter source_location for cmd acr run
⚠️ 1006 - ParaAdd acr build cmd acr build added parameter source_registry_auth_id
⚠️ 1009 - ParaPropRemove acr build cmd acr build update parameter auth_mode: removed property choices=['Default', 'None']
⚠️ 1010 - ParaPropUpdate acr build cmd acr build update parameter source_location: updated property name from source_location to registry_name
⚠️ 1010 - ParaPropUpdate acr build cmd acr build update parameter source_location: updated property options from [] to ['--registry', '-r']
⚠️ 1009 - ParaPropRemove acr config authentication-as-arm update cmd acr config authentication-as-arm update update parameter status: removed property choices=['disabled', 'enabled']
⚠️ 1009 - ParaPropRemove acr config content-trust update cmd acr config content-trust update update parameter status: removed property choices=['disabled', 'enabled']
⚠️ 1009 - ParaPropRemove acr config retention update cmd acr config retention update update parameter status: removed property choices=['disabled', 'enabled']
⚠️ 1009 - ParaPropRemove acr config soft-delete update cmd acr config soft-delete update update parameter status: removed property choices=['disabled', 'enabled']
⚠️ 1009 - ParaPropRemove acr create cmd acr create update parameter default_action: removed property choices=['Allow', 'Deny']
⚠️ 1009 - ParaPropRemove acr create cmd acr create update parameter zone_redundancy: removed property choices=['Disabled', 'Enabled']
⚠️ 1009 - ParaPropRemove acr credential renew cmd acr credential renew update parameter password_name: removed property choices=['password', 'password2']
⚠️ 1009 - ParaPropRemove acr pack build cmd acr pack build update parameter auth_mode: removed property choices=['Default', 'None']
⚠️ 1010 - ParaPropUpdate acr pack build cmd acr pack build update parameter source_location: updated property name from source_location to registry_name
⚠️ 1010 - ParaPropUpdate acr pack build cmd acr pack build update parameter source_location: updated property options from [] to ['--registry', '-r']
⚠️ 1009 - ParaPropRemove acr replication create cmd acr replication create update parameter zone_redundancy: removed property choices=['Disabled', 'Enabled']
⚠️ 1006 - ParaAdd acr run cmd acr run added parameter source_registry_auth_id
⚠️ 1009 - ParaPropRemove acr run cmd acr run update parameter auth_mode: removed property choices=['Default', 'None']
⚠️ 1010 - ParaPropUpdate acr run cmd acr run update parameter source_location: updated property name from source_location to registry_name
⚠️ 1010 - ParaPropUpdate acr run cmd acr run update parameter source_location: updated property options from [] to ['--registry', '-r']
⚠️ 1006 - ParaAdd acr task create cmd acr task create added parameter source_registry_auth_id
⚠️ 1009 - ParaPropRemove acr task create cmd acr task create update parameter auth_mode: removed property choices=['Default', 'None']
⚠️ 1009 - ParaPropRemove acr task create cmd acr task create update parameter base_image_trigger_type: removed property choices=['All', 'Runtime']
⚠️ 1009 - ParaPropRemove acr task create cmd acr task create update parameter status: removed property choices=['Disabled', 'Enabled']
⚠️ 1009 - ParaPropRemove acr task create cmd acr task create update parameter update_trigger_payload_type: removed property choices=['Default', 'Token']
⚠️ 1009 - ParaPropRemove acr task list-runs cmd acr task list-runs update parameter run_status: removed property choices=['Canceled', 'Error', 'Failed', 'Queued', 'Running', 'Started', 'Succeeded', 'Timeout']
⚠️ 1006 - ParaAdd acr task update cmd acr task update added parameter source_registry_auth_id
⚠️ 1009 - ParaPropRemove acr task update cmd acr task update update parameter auth_mode: removed property choices=['Default', 'None']
⚠️ 1009 - ParaPropRemove acr task update cmd acr task update update parameter base_image_trigger_type: removed property choices=['All', 'Runtime']
⚠️ 1009 - ParaPropRemove acr task update cmd acr task update update parameter status: removed property choices=['Disabled', 'Enabled']
⚠️ 1009 - ParaPropRemove acr task update cmd acr task update update parameter update_trigger_payload_type: removed property choices=['Default', 'Token']
⚠️ 1009 - ParaPropRemove acr token create cmd acr token create update parameter status: removed property choices=['disabled', 'enabled']
⚠️ 1009 - ParaPropRemove acr token update cmd acr token update update parameter status: removed property choices=['disabled', 'enabled']
⚠️ 1009 - ParaPropRemove acr update cmd acr update update parameter default_action: removed property choices=['Allow', 'Deny']
⚠️ 1009 - ParaPropRemove acr webhook create cmd acr webhook create update parameter actions: removed property choices=['chart_delete', 'chart_push', 'delete', 'push', 'quarantine']
⚠️ 1009 - ParaPropRemove acr webhook create cmd acr webhook create update parameter status: removed property choices=['disabled', 'enabled']
⚠️ 1009 - ParaPropRemove acr webhook update cmd acr webhook update update parameter actions: removed property choices=['chart_delete', 'chart_push', 'delete', 'push', 'quarantine']
⚠️ 1009 - ParaPropRemove acr webhook update cmd acr webhook update update parameter status: removed property choices=['disabled', 'enabled']

Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:

  • Breaking changes can only be merged during the designated breaking change window
  • A pre-announcement must be released at least one month in advance

For more details on how to introduce breaking changes, refer to the documentation: azure-cli/doc/how_to_introduce_breaking_changes.md

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 18, 2025

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

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>

@lizMSFT lizMSFT changed the title [ACR] az acr tasks create | update, az acr build | run: Add ABAC support for ACR Tasks [WIP][ACR] az acr tasks create | update, az acr build | run: Add ABAC support for ACR Tasks Mar 18, 2025
@lizMSFT lizMSFT changed the title [WIP][ACR] az acr tasks create | update, az acr build | run: Add ABAC support for ACR Tasks [ACR] az acr tasks create | update, az acr build | run: Add ABAC support for ACR Tasks Mar 18, 2025
elif source_registry_auth_id == IDENTITY_LOCAL_ID and identity is None:
identity = _build_identities_info(cmd, [source_registry_auth_id])

if source_registry_auth_id:
Copy link
Member

Choose a reason for hiding this comment

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

We have warning logic in multiple places: here, check_auth_mode_for_abac and get_custom_registry_credentials. We may consider consolidate them to one place for maintainability.

operation_group='runs')

registry_abac_enabled = registry.role_assignment_mode == RoleAssignmentMode.ABAC_REPOSITORY_PERMISSIONS
Copy link
Member

Choose a reason for hiding this comment

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

Do we consider a warning if user enabled abac but source identity is not specified? Similar to task.py:225

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The user will still be able to create the task successfully if ABAC is enabled but the source identity is not specified. They will encounter an error when they execute az acr task run, so a warning message could be useful.

However, for az acr build or az acr run, an error will be thrown directly if the user doesn't have the correct source registry credential. I'm not sure if a warning message would also be useful in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Container Registry az acr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants