Skip to content

[Backup] Add SQL instance snapshot backup and restore support - #34235

Open
iwrinshow wants to merge 6 commits into
Azure:devfrom
iwrinshow:sqlinstclichanges
Open

iwrinshow wants to merge 6 commits into
Azure:devfrom
iwrinshow:sqlinstclichanges

Conversation

@iwrinshow

@iwrinshow iwrinshow commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

🤖 PR Validation — ❌ Action needed

Breaking Changes Tests
⚠️ None ❌ 128/130
⚠️AzureCLI-BreakingChangeTest
⚠️backup
rule cmd_name rule_message suggest_message
⚠️ 1010 - ParaPropUpdate backup container re-register cmd backup container re-register update parameter workload_type: updated property choices from ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase'] to ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance']
⚠️ 1006 - ParaAdd backup container register cmd backup container register added parameter container_subscription_id
⚠️ 1010 - ParaPropUpdate backup container register cmd backup container register update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance']
⚠️ 1010 - ParaPropUpdate backup item list cmd backup item list update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup item set-policy cmd backup item set-policy update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup item show cmd backup item show update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup policy create cmd backup policy create update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup policy list cmd backup policy list update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup protectable-item initialize cmd backup protectable-item initialize update parameter workload_type: updated property choices from ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase'] to ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance']
⚠️ 1010 - ParaPropUpdate backup protectable-item list cmd backup protectable-item list update parameter workload_type: updated property choices from ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase'] to ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance']
⚠️ 1010 - ParaPropUpdate backup protectable-item show cmd backup protectable-item show update parameter workload_type: updated property choices from ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase'] to ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance']
⚠️ 1010 - ParaPropUpdate backup protection auto-disable-for-azurewl cmd backup protection auto-disable-for-azurewl update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup protection auto-enable-for-azurewl cmd backup protection auto-enable-for-azurewl update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup protection backup-now cmd backup protection backup-now update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup protection disable cmd backup protection disable update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1006 - ParaAdd backup protection enable-for-azurewl cmd backup protection enable-for-azurewl added parameter child_database_names
⚠️ 1010 - ParaPropUpdate backup protection enable-for-azurewl cmd backup protection enable-for-azurewl update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup protection reconfigure cmd backup protection reconfigure update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup protection resume cmd backup protection resume update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup protection undelete cmd backup protection undelete update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1006 - ParaAdd backup recoveryconfig show cmd backup recoveryconfig show added parameter no_recovery_mode
⚠️ 1006 - ParaAdd backup recoveryconfig show cmd backup recoveryconfig show added parameter recovery_mode
⚠️ 1010 - ParaPropUpdate backup recoveryconfig show cmd backup recoveryconfig show update parameter workload_type: updated property choices from ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase'] to ['MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance']
⚠️ 1006 - ParaAdd backup recoverypoint list cmd backup recoverypoint list added parameter get_latest_recovery_point_only
⚠️ 1006 - ParaAdd backup recoverypoint list cmd backup recoverypoint list added parameter restore_point_query_type
⚠️ 1010 - ParaPropUpdate backup recoverypoint list cmd backup recoverypoint list update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup recoverypoint move cmd backup recoverypoint move update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1010 - ParaPropUpdate backup recoverypoint show cmd backup recoverypoint show update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
⚠️ 1006 - ParaAdd backup recoverypoint show-log-chain cmd backup recoverypoint show-log-chain added parameter base_recovery_point_datasource_id
⚠️ 1006 - ParaAdd backup recoverypoint show-log-chain cmd backup recoverypoint show-log-chain added parameter base_snapshot_recovery_point_id
⚠️ 1006 - ParaAdd backup recoverypoint show-log-chain cmd backup recoverypoint show-log-chain added parameter recovery_mode
⚠️ 1010 - ParaPropUpdate backup recoverypoint show-log-chain cmd backup recoverypoint show-log-chain update parameter workload_type: updated property choices from ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'VM'] to ['AzureFileShare', 'MSSQL', 'SAPASE', 'SAPAseDatabase', 'SAPHANA', 'SAPHanaDBInstance', 'SAPHanaDatabase', 'SQLDataBase', 'SQLInstance', 'VM']
❌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_afs_backup_protection_undelete The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_afs_commands.py:68
Failed test_afs_msi_reregistration_protection_restore self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f52b2900200>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f52b6531a30>
command = 'backup container register -g bhar11-prt-restore-rg -v bhar11-prt-olr-rsv --backup-management-type AzureStorage --workload-type AzureFileShare --storage-account afsuami09191425 --access-type IdentityBased --mi-system-assigned --yes'
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_base.py:537: in register_container
    return custom_afs.register_afs_container(
src/azure-cli/azure/cli/command_modules/backup/custom_afs.py:199: in register_afs_container
    ensure_storage_account_registration(
src/azure-cli/azure/cli/command_modules/backup/custom_afs.py:155: in ensure_storage_account_registration
    registered_containers = common.list_containers(
src/azure-cli/azure/cli/command_modules/backup/custom_common.py:67: in list_containers
    return get_containers(client, backup_management_type, status, resource_group_name, vault_name,
src/azure-cli/azure/cli/command_modules/backup/custom_common.py:385: in get_containers
    containers = custom_help.get_list_from_paged_response(paged_containers)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli/azure/cli/command_modules/backup/custom_help.py:563: in get_list_from_paged_response
    return list(obj_list) if is_paged(obj_list) else obj_list
           ^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/paging.py:136: in next
    return next(self.page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/core/paging.py:82: in next
    self.response = self.get_next(self.continuation_token)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.12/site-packages/azure/mgmt/recoveryservicesbackup/operations/operations.py:12177: in get_next
    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_afs_msi_reregistration_protection_restore.yaml(host='management.azure.com', port=443) at 0x7f52b276e2a0>
 = 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_afs_msi_reregistration_protection_restore.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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-10-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>)&nbsp;was&nbsp;found.
E               Found 7 similar requests with 1 different matcher(s) :
E               
E               1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20friendlyName%20eq%20%27afsuami09191425%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20friendlyName%20eq%20%27afsuami09191425%27%20and%20status%20eq%20%27Registered%27>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               7 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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:

self = <azure.cli.command_modules.backup.tests.latest.test_afs_commands.BackupTests testMethod=test_afs_msi_reregistration_protection_restore>

    @AllowLargeResponse()
    @record_only()
    def test_afs_msi_reregistration_protection_restore(self):
        source_subscription = self.get_subscription_id()
        target_subscription = self.get_subscription_id()
        self.kwargs.update({
            'rg': 'bhar11-prt-restore-rg',
            'vault': 'bhar11-prt-olr-rsv',
            'policy': 'bhar11-prt-snapshot-policy',
            'storage_account': 'afsuami09191425',
            'uami_id': (
                '/subscriptions/{}/'
                'resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.ManagedIdentity/'
                'userAssignedIdentities/afs-test-uami-09191425'
            ).format(source_subscription),
            'target_subscription': target_subscription,
            'target_resource_group': 'afs-softdelete-rg',
            'target_storage_account': 'bhar11csrtgtsa',
            'target_share': 'restoredfs',
            'share': self.create_random_name('climsirec', 20),
            'type': 'AzureStorage'
        })
    
>       self.cmd(
            'backup container register -g {rg} -v {vault} '
            '--backup-management-type {type} --workload-type AzureFileShare '
            '--storage-account {storage_account} --access-type IdentityBased '
            '--mi-system-assigned --yes'
        )

src/azure-cli/azure/cli/command_modules/backup/tests/latest/test_afs_commands.py:379: 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                          
src/azure-cli-testsdk/azure/cli/testsdk/base.py:177: 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:252: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
 
                                       

self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f52b2900200>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f52b6531a30>
command = 'backup container register -g bhar11-prt-restore-rg -v bhar11-prt-olr-rsv --backup-management-type AzureStorage --workload-type AzureFileShare --storage-account afsuami09191425 --access-type IdentityBased --mi-system-assigned --yes'
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_afs_msi_reregistration_protection_restore.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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-10-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>)&nbsp;was&nbsp;found.
E           Found 7 similar requests with 1 different matcher(s) :
E           
E           1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20friendlyName%20eq%20%27afsuami09191425%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20friendlyName%20eq%20%27afsuami09191425%27%20and%20status%20eq%20%27Registered%27>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           7 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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_afs_commands.py:355
Failed test_afs_sami_protection_restore The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_afs_commands.py:489
Failed test_backup_CrossZonalRestore The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1188
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:291
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:1458
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:1707
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:1596
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:441
Failed test_backup_item_source_scan_configuration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:532
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:1374
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:326
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:656
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:1075
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:1229
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:1865
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:631
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:87
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:1414
Failed test_backup_source_scan_recovery_points The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:592
Failed test_backup_vault The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:134
Failed test_backup_vault_source_scan_configuration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:269
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:2000
Failed test_backup_wl_hana_snapshot The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_hana_commands.py:101
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:807
Failed test_backup_wl_sql_container The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:103
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:680
Failed test_backup_wl_sql_item The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:345
Failed test_backup_wl_sql_policy The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:154
Failed test_backup_wl_sql_protectable_item The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:217
Failed test_backup_wl_sql_protection The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:437
Failed test_backup_wl_sql_restore The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:510
Failed test_backup_wl_sql_restore_as_files The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:604
Failed test_backup_wl_sql_rp The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:261
❌3.14
Type Test Case Error Message Line
Failed test_afs_backup_protection_undelete The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_afs_commands.py:68
Failed test_afs_msi_reregistration_protection_restore self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f430d4b2f90>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f431518aad0>
command = 'backup container register -g bhar11-prt-restore-rg -v bhar11-prt-olr-rsv --backup-management-type AzureStorage --workload-type AzureFileShare --storage-account afsuami09191425 --access-type IdentityBased --mi-system-assigned --yes'
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_base.py:537: in register_container
    return custom_afs.register_afs_container(
src/azure-cli/azure/cli/command_modules/backup/custom_afs.py:199: in register_afs_container
    ensure_storage_account_registration(
src/azure-cli/azure/cli/command_modules/backup/custom_afs.py:155: in ensure_storage_account_registration
    registered_containers = common.list_containers(
src/azure-cli/azure/cli/command_modules/backup/custom_common.py:67: in list_containers
    return get_containers(client, backup_management_type, status, resource_group_name, vault_name,
src/azure-cli/azure/cli/command_modules/backup/custom_common.py:385: in get_containers
    containers = custom_help.get_list_from_paged_response(paged_containers)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src/azure-cli/azure/cli/command_modules/backup/custom_help.py:563: in get_list_from_paged_response
    return list(obj_list) if is_paged(obj_list) else obj_list
           ^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/paging.py:136: in next
    return next(self.page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/core/paging.py:82: in next
    self.response = self.get_next(self.continuation_token)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
env/lib/python3.14/site-packages/azure/mgmt/recoveryservicesbackup/operations/operations.py:12177: in get_next
    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_afs_msi_reregistration_protection_restore.yaml(host='management.azure.com', port=443) at 0x7f430c2aa3c0>
 = 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_afs_msi_reregistration_protection_restore.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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-10-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>)&nbsp;was&nbsp;found.
E               Found 7 similar requests with 1 different matcher(s) :
E               
E               1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20friendlyName%20eq%20%27afsuami09191425%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20friendlyName%20eq%20%27afsuami09191425%27%20and%20status%20eq%20%27Registered%27>).
E               Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E               Matchers failed :
E               custom_request_query_matcher - assertion failure :
E               None
E               
E               7 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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:

self = <azure.cli.command_modules.backup.tests.latest.test_afs_commands.BackupTests testMethod=test_afs_msi_reregistration_protection_restore>

    @AllowLargeResponse()
    @record_only()
    def test_afs_msi_reregistration_protection_restore(self):
        source_subscription = self.get_subscription_id()
        target_subscription = self.get_subscription_id()
        self.kwargs.update({
            'rg': 'bhar11-prt-restore-rg',
            'vault': 'bhar11-prt-olr-rsv',
            'policy': 'bhar11-prt-snapshot-policy',
            'storage_account': 'afsuami09191425',
            'uami_id': (
                '/subscriptions/{}/'
                'resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.ManagedIdentity/'
                'userAssignedIdentities/afs-test-uami-09191425'
            ).format(source_subscription),
            'target_subscription': target_subscription,
            'target_resource_group': 'afs-softdelete-rg',
            'target_storage_account': 'bhar11csrtgtsa',
            'target_share': 'restoredfs',
            'share': self.create_random_name('climsirec', 20),
            'type': 'AzureStorage'
        })
    
>       self.cmd(
            'backup container register -g {rg} -v {vault} '
            '--backup-management-type {type} --workload-type AzureFileShare '
            '--storage-account {storage_account} --access-type IdentityBased '
            '--mi-system-assigned --yes'
        )

src/azure-cli/azure/cli/command_modules/backup/tests/latest/test_afs_commands.py:379: 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                          
src/azure-cli-testsdk/azure/cli/testsdk/base.py:177: 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:252: in init
    self.in_process_execute(cli_ctx, command, expect_failure=expect_failure)
 
                                       

self = <azure.cli.testsdk.base.ExecutionResult object at 0x7f430d4b2f90>
cli_ctx = <azure.cli.core.mock.DummyCli object at 0x7f431518aad0>
command = 'backup container register -g bhar11-prt-restore-rg -v bhar11-prt-olr-rsv --backup-management-type AzureStorage --workload-type AzureFileShare --storage-account afsuami09191425 --access-type IdentityBased --mi-system-assigned --yes'
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_afs_msi_reregistration_protection_restore.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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-10-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>)&nbsp;was&nbsp;found.
E           Found 7 similar requests with 1 different matcher(s) :
E           
E           1 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20friendlyName%20eq%20%27afsuami09191425%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20friendlyName%20eq%20%27afsuami09191425%27%20and%20status%20eq%20%27Registered%27>).
E           Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
E           Matchers failed :
E           _custom_request_query_matcher - assertion failure :
E           None
E           
E           7 - (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/bhar11-prt-restore-rg/providers/Microsoft.RecoveryServices/vaults/bhar11-prt-olr-rsv/backupProtectionContainers?api-version=2026-08-01&$filter=backupManagementType%20eq%20%27AzureStorage%27%20and%20status%20eq%20%27Registered%27>).
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_afs_commands.py:355
Failed test_afs_sami_protection_restore The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_afs_commands.py:489
Failed test_backup_CrossZonalRestore The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:1188
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:291
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:1458
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:1707
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:1596
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:441
Failed test_backup_item_source_scan_configuration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:532
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:1374
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:326
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:656
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:1075
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:1229
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:1865
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:631
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:87
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:1414
Failed test_backup_source_scan_recovery_points The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:592
Failed test_backup_vault The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:134
Failed test_backup_vault_source_scan_configuration The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_backup_commands.py:269
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:2000
Failed test_backup_wl_hana_snapshot The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_hana_commands.py:101
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:807
Failed test_backup_wl_sql_container The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:103
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:680
Failed test_backup_wl_sql_item The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:345
Failed test_backup_wl_sql_policy The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:154
Failed test_backup_wl_sql_protectable_item The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:217
Failed test_backup_wl_sql_protection The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:437
Failed test_backup_wl_sql_restore The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:510
Failed test_backup_wl_sql_restore_as_files The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:604
Failed test_backup_wl_sql_rp The error message is too long, please check the pipeline log for details. azure/cli/command_modules/backup/tests/latest/test_sql_commands.py:261
️✔️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

Related command

  • az backup container register
  • az backup protection enable-for-azurewl
  • az backup policy create / az backup policy set
  • az backup recoverypoint list / az backup recoverypoint show-log-chain
  • az backup recoveryconfig show
  • az backup restore restore-azurewl

Description

Add SQL instance snapshot backup and restore support to the Backup command module using azure-mgmt-recoveryservicesbackup==11.2.0, published from Azure/azure-sdk-for-python#49430.

  • Support SQLInstance workload discovery/protection, child-database selection, and SnapshotV2 policy handling.
  • Add recovery-point query filters and snapshot-based log-chain queries.
  • Generate SQL snapshot recovery configurations and restore requests for supported instance/database scenarios, including alternate-location restore, point-in-time recovery, managed identity, and no-recovery mode.
  • Support container registration with an explicitly selected source subscription.

The new SQL snapshot paths are intended to preserve existing workload behavior. Full existing-workload playback validation is not yet passing; see Testing Guide below.

Testing Guide

Focused offline validation on Windows, using the repository-local Python environment:

$env:PYTHONPATH = "$PWD\src\azure-cli;$PWD\src\azure-cli-core"
$env:AZURE_CONFIG_DIR = "$PWD\.venv-sqlinstance\azure-config"
$env:AZURE_CORE_COLLECT_TELEMETRY = 'false'
.\.venv-sqlinstance\Scripts\python.exe -m pytest src\azure-cli\azure\cli\command_modules\backup\tests\latest\test_custom.py src\azure-cli\azure\cli\command_modules\backup\tests\latest\test_sql_instance.py -q

Result: 31 passed, 27 subtests passed. The new test_sql_instance.py file is currently local/untracked and will be added in a follow-up; this result is not yet reproducible from the PR checkout alone.

Current CI results for commit 7c4d490fa94c9a8b6224411bf37475b9f4b863af:

  • Full-test Python 3.12 and 3.14 instance8 jobs: failed, each reporting 32 failed, 198 passed, 82 skipped, and 14 subtests passed. Logs show backup playback requests using API version 2026-10-01 against recordings using 2026-08-01. Recordings and any remaining SDK compatibility failures still need to be addressed.
  • CLI style: failed, reporting E128 indentation at backup/custom_wl.py:598.
  • CLI linter: failed, including long-option alias and new-parameter coverage findings.

Full live backup/restore scenarios have not been run as part of this validation. Existing-workload compatibility is not yet fully verified. After fixes, rerun the documented azdev style backup, azdev linter backup --ci-exclusions, and azdev test backup --no-exitfirst checks; these local azdev commands have not yet been rerun for this follow-up.

History Notes

[Backup] Add SQL instance snapshot backup and restore support


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

@iwrinshow
iwrinshow requested review from a team as code owners October 16, 2026 15:22
Copilot AI balanced review requested due to automatic review settings October 16, 2026 15:22
@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.

🟡 Changes recommended

Container selection and alternate-target resolution have unresolved correctness issues, and snapshot restore paths lack focused tests.

3 open findings
What changed in this PR

Adds SQL instance snapshot backup and restore support to Azure CLI’s backup commands.

Changes:

  • Adds snapshot protection, recovery-point filters, and restore configuration.
  • Extends discovery and validation helpers, arguments, and examples.
  • Upgrades the Recovery Services Backup SDK to 11.2.0.
File Description
src/​azure-cli/​requirements.py3.windows.txt Updates Windows SDK pin.
src/​azure-cli/​requirements.py3.Linux.txt Updates Linux SDK pin.
src/​azure-cli/​requirements.py3.Darwin.txt Updates macOS SDK pin.
src/​azure-cli/​pyproject.toml Updates SDK dependency requirement.
src/​azure-cli/​azure/​cli/​command_modules/​backup/​custom_wl.py Implements snapshot protection and restore workflows.
src/​azure-cli/​azure/​cli/​command_modules/​backup/​custom_help.py Extends polling, filtering, and JSON handling.
src/​azure-cli/​azure/​cli/​command_modules/​backup/​custom_common.py Adds SQLInstance workload mappings.
src/​azure-cli/​azure/​cli/​command_modules/​backup/​custom_base.py Routes new options to workload handlers.
src/​azure-cli/​azure/​cli/​command_modules/​backup/​_params.py Exposes snapshot and discovery options.
src/​azure-cli/​azure/​cli/​command_modules/​backup/​_help.py Documents snapshot commands and examples.
src/​azure-cli/​azure/​cli/​command_modules/​backup/​_client_factory.py Adds discovery-status client factory.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


def register_wl_container(cmd, client, vault_name, resource_group_name, workload_type, resource_id, container_type):
def register_wl_container(cmd, client, vault_name, resource_group_name, workload_type, resource_id, container_type,
container_subscription_id=None):
Comment on lines +720 to +722
if (target_item_name is not None or
(restore_mode == 'AlternateWorkloadRestore' and
(recovery_mode is not None or workload_type == 'SQLInstance'))):
client_id=details.client_id, principal_id=details.principal_id))


def _apply_sql_snapshot_restore(cmd, request, config, item, resource_group_name, vault_name):
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@yonzhan

Copy link
Copy Markdown
Collaborator

Please fix CI issues

@iwrinshow iwrinshow changed the title Changes to support SQL Instance snapshot backup [Backup] Add SQL instance snapshot backup and restore support Oct 17, 2026
Iwrin Show and others added 3 commits October 21, 2026 21:02
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…changes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve SQL instance source-subscription discovery alongside Azure Files managed identity registration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 34235 in repo Azure/azure-cli

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants