Skip to content

Added support for cost management settings#33757

Open
vidyadharijami wants to merge 6 commits into
Azure:devfrom
vidyadharijami:deve/vijami/clichanges
Open

Added support for cost management settings#33757
vidyadharijami wants to merge 6 commits into
Azure:devfrom
vidyadharijami:deve/vijami/clichanges

Conversation

@vidyadharijami

@vidyadharijami vidyadharijami commented Jul 21, 2026

Copy link
Copy Markdown
Member

Related command

Description

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


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

🤖 PR Validation — ❌ Action needed

Breaking Changes Tests
⚠️ None ❌ 128/130
⚠️AzureCLI-BreakingChangeTest
⚠️backup
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd backup vault create cmd backup vault create added parameter cost_management_granularity
⚠️ 1006 - ParaAdd backup vault update cmd backup vault update added parameter cost_management_granularity
❌AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.14
️✔️acs
️✔️latest
️✔️3.12
️✔️3.14
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.14
️✔️ams
️✔️latest
️✔️3.12
️✔️3.14
️✔️apim
️✔️latest
️✔️3.12
️✔️3.14
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.14
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️aro
️✔️latest
️✔️3.12
️✔️3.14
❌backup
❌latest
❌3.12
Type Test Case Error Message Line
Failed test_backup_CrossZonalRestore self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f0b469ec560>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f0b4d663950>
command = 'backup vault create -n clitest-vault000003 -g AzureBackupRG_clitest_000001 --location eastus2euap'
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:303: 
                                        
env/lib/python3.12/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/init.py:153: in exception_handler
    return handle_exception(ex)
           ^^^^^^^^^^^^^^^^^^^^
src/azure-cli-testsdk/azure/cli/testsdk/patches.py:33: in handle_main_exception
    raise ex
env/lib/python3.12/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:677: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:820: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:812: in run_job
    return cmd_copy.exception_handler(ex)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli/azure/cli/command_modules/backup/exception_handler.py:11: in backup_exception_handler
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:789: in run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:335: 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/backup/custom.py:216: in create_vault
    client.get(resource_group_name, vault_name)
env/lib/python3.12/site-packages/azure/core/tracing/decorator.py:119: in wrapper_use_tracer
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/mgmt/recoveryservices/operations/operations.py:915: in get
    pipeline_response: PipelineResponse = self.client.pipeline.run(  # pylint: disable=protected-access
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:242: in run
    return first_node.send(pipeline_request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/mgmt/core/policies/base.py:95: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/policies/redirect.py:205: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/policies/retry.py:545: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/policies/authentication.py:194: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/base.py:130: in send
    self.sender.send(request.http_request, **request.context.options),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/pipeline/transport/requests_basic.py:375: in send
    response = self.session.request(  # type: ignore
env/lib/python3.12/site-packages/requests/sessions.py:592: in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/requests/sessions.py:706: in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/requests/adapters.py:645: in send
    resp = conn.urlopen(
env/lib/python3.12/site-packages/urllib3/connectionpool.py:788: in urlopen
    response = self.make_request(
env/lib/python3.12/site-packages/urllib3/connectionpool.py:534: in make_request
    response = conn.getresponse()
               ^^^^^^^^^^^^^^^^^^
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
           

self = <VCRRequestsHTTPSConnection/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_CrossZonalRestore.yaml(host='management.azure.com', port=443) at 0x7f0b46203b30>
 = False, kwargs = {}

    def getresponse(self, =False, **kwargs):
        """Retrieve the response"""
        # Check to see if the cassette has a response for this request. If so,
        # then return it
        if self.cassette.can_play_response_for(self.vcr_request):
            log.info(f"Playing response for {self.vcr_request} from cassette")
            response = self.cassette.play_response(self.vcr_request)
            return VCRHTTPResponse(response, self.vcr_request.uri)
        else:
            if self.cassette.write_protected and self.cassette.filter_request(self.vcr_request):
>               raise CannotOverwriteExistingCassetteException(
                    cassette=self.cassette,
                    failed_request=self.vcr_request,
                )
E               vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_CrossZonalRestore.yaml') in your current record mode (RecordMode.ONCE: 'once').
E               No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2026-05-01>)&nbsp;was&nbsp;found.
E               Found 6 similar requests with 1 different matcher(s) :
E               
E               1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               3 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               4 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               5 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               6 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None

env/lib/python3.12/site-packages/vcr/stubs/init.py:279: CannotOverwriteExistingCassetteException

During handling of the above exception, another exception occurred:
src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/decorators.py:40: in preparer_wrapper
    fn(test_class_instance, **kwargs)
src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py:50: in preparer_wrapper
    fn(test_class_instance, **kwargs)
src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py:50: in preparer_wrapper
    fn(test_class_instance, **kwargs)
src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py:39: in preparer_wrapper
    parameter_update = self.create_resource(
src/azure-cli/azure/cli/command_modules/backup/tests/latest/preparers.py:137: in create_resource
    execute(self.cli_ctx, cmd)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:252: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                     _ 

self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f0b469ec560>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f0b4d663950>
command = 'backup vault create -n clitest-vault000003 -g AzureBackupRG_clitest_000001 --location eastus2euap'
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
            self.output = stdout_buf.getvalue()
            self.applog = logging_buf.getvalue()
    
        except CannotOverwriteExistingCassetteException as ex:
>           raise AssertionError(ex)
E           AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_CrossZonalRestore.yaml') in your current record mode (RecordMode.ONCE: 'once').
E           No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2026-05-01>)&nbsp;was&nbsp;found.
E           Found 6 similar requests with 1 different matcher(s) :
E           
E           1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           3 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           4 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           5 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           6 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None

src/azure-cli-testsdk/azure/cli/testsdk/base.py:308: AssertionError
azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1010
Failed test_backup_container The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:229
Failed test_backup_disk_exclusion The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1280
Failed test_backup_encryption The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1529
Failed test_backup_identity The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1418
Failed test_backup_item The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:379
Failed test_backup_job The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1196
Failed test_backup_policy The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:264
Failed test_backup_protection The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:495
Failed test_backup_restore The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:897
Failed test_backup_restore_multiple_containers_same_friendly_name The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:688
Failed test_backup_restore_when_storage_in_different_rg The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1051
Failed test_backup_rg_mapping The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1689
Failed test_backup_rp The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:470
Failed test_backup_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:47
Failed test_backup_softdelete The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1236
Failed test_vault_soft_delete_basic The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1777
Failed test_vault_soft_delete_misc_operations The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1902
Failed test_vault_soft_delete_with_items The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1824
Failed test_backup_wl_reconfigure The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:790
Failed test_backup_wl_sql_crr The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:664
❌3.14
Type Test Case Error Message Line
Failed test_backup_CrossZonalRestore self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f4ba9b22ba0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f4bb0414f50>
command = 'backup vault create -n clitest-vault000003 -g AzureBackupRG_clitest_000001 --location eastus2euap'
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:303: 
                                        
env/lib/python3.14/site-packages/knack/cli.py:245: in invoke
    exit_code = self.exception_handler(ex)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/init.py:153: in exception_handler
    return handle_exception(ex)
           ^^^^^^^^^^^^^^^^^^^^
src/azure-cli-testsdk/azure/cli/testsdk/patches.py:33: in handle_main_exception
    raise ex
env/lib/python3.14/site-packages/knack/cli.py:233: in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:677: in execute
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:820: in run_jobs_serially
    results.append(self.run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:812: in run_job
    return cmd_copy.exception_handler(ex)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli/azure/cli/command_modules/backup/exception_handler.py:11: in backup_exception_handler
    raise ex
src/azure-cli-core/azure/cli/core/commands/init.py:789: in run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
src/azure-cli-core/azure/cli/core/commands/init.py:335: 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/backup/custom.py:216: in create_vault
    client.get(resource_group_name, vault_name)
env/lib/python3.14/site-packages/azure/core/tracing/decorator.py:119: in wrapper_use_tracer
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/mgmt/recoveryservices/operations/operations.py:915: in get
    pipeline_response: PipelineResponse = self.client.pipeline.run(  # pylint: disable=protected-access
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:242: in run
    return first_node.send(pipeline_request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/mgmt/core/policies/base.py:95: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/policies/redirect.py:205: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/policies/retry.py:545: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/policies/authentication.py:194: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:98: in send
    response = self.next.send(request)
               ^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/base.py:130: in send
    self.sender.send(request.http_request, **request.context.options),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/pipeline/transport/requests_basic.py:375: in send
    response = self.session.request(  # type: ignore
env/lib/python3.14/site-packages/requests/sessions.py:592: in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/requests/sessions.py:706: in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/requests/adapters.py:645: in send
    resp = conn.urlopen(
env/lib/python3.14/site-packages/urllib3/connectionpool.py:788: in urlopen
    response = self.make_request(
env/lib/python3.14/site-packages/urllib3/connectionpool.py:534: in make_request
    response = conn.getresponse()
               ^^^^^^^^^^^^^^^^^^
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
           

self = <VCRRequestsHTTPSConnection/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_CrossZonalRestore.yaml(host='management.azure.com', port=443) at 0x7f4ba8c5eba0>
 = False, kwargs = {}

    def getresponse(self, =False, **kwargs):
        """Retrieve the response"""
        # Check to see if the cassette has a response for this request. If so,
        # then return it
        if self.cassette.can_play_response_for(self.vcr_request):
            log.info(f"Playing response for {self.vcr_request} from cassette")
            response = self.cassette.play_response(self.vcr_request)
            return VCRHTTPResponse(response, self.vcr_request.uri)
        else:
            if self.cassette.write_protected and self.cassette.filter_request(self.vcr_request):
>               raise CannotOverwriteExistingCassetteException(
                    cassette=self.cassette,
                    failed_request=self.vcr_request,
                )
E               vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('/mnt/vss/work/1/s/src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_CrossZonalRestore.yaml') in your current record mode (RecordMode.ONCE: 'once').
E               No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2026-05-01>)&nbsp;was&nbsp;found.
E               Found 6 similar requests with 1 different matcher(s) :
E               
E               1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               3 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               4 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               5 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               6 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None

env/lib/python3.14/site-packages/vcr/stubs/init.py:279: CannotOverwriteExistingCassetteException

During handling of the above exception, another exception occurred:
src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/decorators.py:40: in preparer_wrapper
    fn(test_class_instance, **kwargs)
src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py:50: in preparer_wrapper
    fn(test_class_instance, **kwargs)
src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py:50: in preparer_wrapper
    fn(test_class_instance, **kwargs)
src/azure-cli-testsdk/azure/cli/testsdk/scenario_tests/preparers.py:39: in preparer_wrapper
    parameter_update = self.create_resource(
src/azure-cli/azure/cli/command_modules/backup/tests/latest/preparers.py:137: in create_resource
    execute(self.cli_ctx, cmd)
src/azure-cli-testsdk/azure/cli/testsdk/base.py:252: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                     _ 

self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f4ba9b22ba0>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f4bb0414f50>
command = 'backup vault create -n clitest-vault000003 -g AzureBackupRG_clitest_000001 --location eastus2euap'
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
            self.output = stdout_buf.getvalue()
            self.applog = logging_buf.getvalue()
    
        except CannotOverwriteExistingCassetteException as ex:
>           raise AssertionError(ex)
E           AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_CrossZonalRestore.yaml') in your current record mode (RecordMode.ONCE: 'once').
E           No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2026-05-01>)&nbsp;was&nbsp;found.
E           Found 6 similar requests with 1 different matcher(s) :
E           
E           1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           2 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           3 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           4 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           5 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           6 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/AzureBackupRG_clitest_000001/providers/Microsoft.RecoveryServices/vaults/clitest-vault000003?api-version=2025-08-01>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None

src/azure-cli-testsdk/azure/cli/testsdk/base.py:308: AssertionError
azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1010
Failed test_backup_container The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:229
Failed test_backup_disk_exclusion The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1280
Failed test_backup_encryption The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1529
Failed test_backup_identity The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1418
Failed test_backup_item The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:379
Failed test_backup_job The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1196
Failed test_backup_policy The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:264
Failed test_backup_protection The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:495
Failed test_backup_restore The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:897
Failed test_backup_restore_multiple_containers_same_friendly_name The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:688
Failed test_backup_restore_when_storage_in_different_rg The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1051
Failed test_backup_rg_mapping The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1689
Failed test_backup_rp The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:470
Failed test_backup_scenario The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:47
Failed test_backup_softdelete The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1236
Failed test_vault_soft_delete_basic The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1777
Failed test_vault_soft_delete_misc_operations The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1902
Failed test_vault_soft_delete_with_items The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1824
Failed test_backup_wl_reconfigure The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:790
Failed test_backup_wl_sql_crr The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:664
️✔️batch
️✔️latest
️✔️3.12
️✔️3.14
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.14
️✔️billing
️✔️latest
️✔️3.12
️✔️3.14
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.14
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.14
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.14
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.14
️✔️config
️✔️latest
️✔️3.12
️✔️3.14
️✔️configure
️✔️latest
️✔️3.12
️✔️3.14
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.14
️✔️container
️✔️latest
️✔️3.12
️✔️3.14
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.14
️✔️core
️✔️latest
️✔️3.12
️✔️3.14
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.14
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.14
️✔️dls
️✔️latest
️✔️3.12
️✔️3.14
️✔️dms
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.14
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.14
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.14
️✔️find
️✔️latest
️✔️3.12
️✔️3.14
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.14
️✔️identity
️✔️latest
️✔️3.12
️✔️3.14
️✔️iot
️✔️latest
️✔️3.12
️✔️3.14
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.14
️✔️lab
️✔️latest
️✔️3.12
️✔️3.14
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.14
️✔️maps
️✔️latest
️✔️3.12
️✔️3.14
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.14
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.14
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.14
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.14
️✔️network
️✔️latest
️✔️3.12
️✔️3.14
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.14
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.14
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.14
️✔️profile
️✔️latest
️✔️3.12
️✔️3.14
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.14
️✔️redis
️✔️latest
️✔️3.12
️✔️3.14
️✔️relay
️✔️latest
️✔️3.12
️✔️3.14
️✔️resource
️✔️latest
️✔️3.12
️✔️3.14
️✔️role
️✔️latest
️✔️3.12
️✔️3.14
️✔️search
️✔️latest
️✔️3.12
️✔️3.14
️✔️security
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.14
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.14
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.14
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.14
️✔️sql
️✔️latest
️✔️3.12
️✔️3.14
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.14
️✔️storage
️✔️latest
️✔️3.12
️✔️3.14
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.14
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.14
️✔️util
️✔️latest
️✔️3.12
️✔️3.14
️✔️vm
️✔️latest
️✔️3.12
️✔️3.14

vidyadharijami and others added 4 commits July 17, 2026 10:24
… RG teardown

The BCDR_StorageAccount_RequiredTags deny policy (management-group scope) blocks
the untagged storage account created by the test preparer, and the GPv1 'Storage'
kind is no longer allowed for new accounts. Add a self-contained
StorageAccountPreparer that creates the account with the required tags
(DisableLocalAuth=false, Reason, ETA, Owner) and kind StorageV2.

Consolidate to a single custom ResourceGroupPreparer (subclass of the testsdk
preparer) whose teardown clears any resource locks and retries on ScopeLocked,
since Azure Backup releases the AFS storage-account CanNotDelete lock
asynchronously. Remove the unused RGPreparer stopgap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…uard op count

Use the backup-local StorageAccountPreparer (StorageV2 + BCDR-required tags) in
test_backup_commands.py so the VM/CRR/restore tests' storage accounts satisfy the
BCDR_StorageAccount_RequiredTags deny policy (clears the RequestDisallowedByPolicy
failures). Bump test_backup_rg_mapping's expected resourceGuardOperationDetails
from 9 to 14 to match the current service critical-operations set (adds
backupCrossTenantVaultMappings/* and immutability duration/state operations).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 21, 2026 05:33
@vidyadharijami
vidyadharijami requested review from a team as code owners July 21, 2026 05:33
@azure-client-tools-bot-prd

Copy link
Copy Markdown

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

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Azure CLI Backup module to support configuring Recovery Services Vault cost management settings (granularity) and aligns the Recovery Services management SDK dependency to a newer version needed for the updated vault models.

Changes:

  • Bump azure-mgmt-recoveryservices to 4.1.0 across setup and platform-specific requirements.
  • Add --cost-management-granularity support to az backup vault create/update, including defaulting to VaultLevel on create.
  • Update vault immutability update logic to include an ImmutabilityConfiguration when enabling immutability, and extend tests to validate cost management behavior.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/azure-cli/setup.py Updates azure-mgmt-recoveryservices dependency range to ~=4.1.0.
src/azure-cli/requirements.py3.windows.txt Pins azure-mgmt-recoveryservices==4.1.0 for Windows builds.
src/azure-cli/requirements.py3.Linux.txt Pins azure-mgmt-recoveryservices==4.1.0 for Linux builds.
src/azure-cli/requirements.py3.Darwin.txt Pins azure-mgmt-recoveryservices==4.1.0 for macOS builds.
src/azure-cli/azure/cli/command_modules/backup/custom.py Implements cost management settings update/create plumbing and immutability configuration handling.
src/azure-cli/azure/cli/command_modules/backup/_params.py Exposes the new --cost-management-granularity enum parameter for create/update.
src/azure-cli/azure/cli/command_modules/backup/tests/latest/test_backup_commands.py Adds assertions and update coverage for cost management granularity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +347 to +353
if existing_vault is not None:
cost_management_settings = existing_vault.properties.cost_management_settings
else :
# Create scenario
cost_management_settings = CostManagementSettings()
cost_management_settings.granularity_level = "VaultLevel"

Comment on lines +222 to +228
return update_vault(cmd, client, vault_name, resource_group_name, tags=tags,
public_network_access=public_network_access,
immutability_state=immutability_state,
cross_subscription_restore_state=cross_subscription_restore_state,
classic_alerts=classic_alerts,
azure_monitor_alerts_for_job_failures=azure_monitor_alerts_for_job_failures,
cost_management_granularity=cost_management_granularity)
allowed_rehyd_priority_type = ['Standard', 'High']
allowed_softdelete_options = ['Enable', 'Disable', 'AlwaysOn']
allowed_immutability_options = ['Disabled', 'Locked', 'Unlocked']
allowed_granularitylevel_options = ['VaultLevel','ProtectedItemLevel','ProtectedItemWithParentTag']
@yonzhan

yonzhan commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

backup

@a0x1ab

a0x1ab commented Jul 22, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Command 'run

@VeryEarly

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@VeryEarly

Copy link
Copy Markdown

Hi @vidyadharijami , please resolve
image
and
image

@VeryEarly VeryEarly assigned VeryEarly and unassigned yanzhudd Jul 26, 2026
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.

7 participants