Open robnotley opened 2 years ago
@robnotley We are looking into it and get back to you for any additional information.
route to CXP team
@robnotley - Have you got the content of the JSON file, does this validate?
route to CXP team
Is there any update on this support request?
@robnotley - Have you got the content of the JSON file, does this validate?
Yes the JSON file appears to be valid
Is there any update on this support request?
Is there any update on this support request?
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @pvrk, @adityabalaji-msft.
Author: | robnotley |
---|---|
Assignees: | - |
Labels: | `Service Attention`, `Recovery Services Backup`, `customer-reported`, `Backup`, `Auto-Assign` |
Milestone: | Backlog |
Hi @robnotley - would you be able to share the debug output of the command (using the debug flag), removing PII as needed? Also, what is the format of the value of container name and target container name you are using? This might help us debug further.
Hi @akshayneema - in the meantime, could you take a look at the recovery config show command that is provided above in the thread and whether all the parameters are as per requirement? It might be possible that some of the params like target-container-name and target-vault are applicable for certain scenarios only (eg. restore as files, CRR etc.), so would be good to confirm that.
+@Daya-Patil for visibility
Hi @adityabalaji-msft
Full detailed commands are below
I ran this from my local machine and also from Azure portal CLI with different results.
Local machine
az backup recoveryconfig show --resource-group "rg-rndev-westeurope-common-c799b2ce" --vault-name "rsv-rndev-f9161b42"
--container-name "VMAppContainer;compute;rg-rndev-westeurope-dashworks-0f0f7c68;vm-rndev-sql-green-9f412f7b" --item-name "SQLDataBase;mssqlserver;pm"
--restore-mode OriginalWorkloadRestore --rp-name 1847309172622175981
--target-item-name "SQLDataBase;mssqlserver;pm" --target-server-name "sql-green"
--target-server-type SQLInstance --workload-type SQLDataBase
--output json `
c:\github\recoveryconfig.json
az backup restore restore-azurewl --resource-group "rg-rndev-westeurope-common-c799b2ce" --vault-name "rsv-rndev-f9161b42" --recovery-config c:\github\recoveryconfig.json --debug
Result
PS C:\Github> az backup restore restore-azurewl --resource-group "rg-rndev-westeurope-common-c799b2ce" --vault-name "rsv-rndev-f9161b42" --recovery-config c:\github\recoveryconfig.json --debug
cli.knack.cli: Command arguments: ['backup', 'restore', 'restore-azurewl', '--resource-group', 'rg-rndev-westeurope-common-c799b2ce', '--vault-name', 'rsv-rndev-f9161b42', '--recovery-config', 'c:\github\recoveryconfig.json', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x022F9388>, <function OutputProducer.on_global_arguments at 0x024DD658>, <function CLIQuery.on_global_arguments at 0x024FA2B0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'backup': ['azure.cli.command_modules.backup']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: backup 0.006 16 58
cli.azure.cli.core: Total (1) 0.006 16 58
cli.azure.cli.core: Loaded 16 groups, 58 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : backup restore restore-azurewl
cli.azure.cli.core: Command table: backup restore restore-azurewl
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x04D066E8>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\RobNotley.azure\commands\2022-10-14.11-01-52.backup_restore_restore-azurewl.2940.log'.
az_command_data_logger: command args: backup restore restore-azurewl --resource-group {} --vault-name {} --recovery-config {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.
cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback: az_command_data_logger: The command failed with an unexpected error. Here is the traceback: cli.azure.cli.core.azclierror: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 663, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 718, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/_exception_handler.py", line 11, in backup_exception_handler File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/custom_base.py", line 508, in restore_azure_wl File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/custom_wl.py", line 618, in restore_azure_wl File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/custom_help.py", line 448, in get_or_read_json File "json__init.py", line 293, in load File "json__init.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) az_command_data_logger: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init__.py", line 663, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 726, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 718, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/_exception_handler.py", line 11, in backup_exception_handler File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 697, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 333, in call File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/custom_base.py", line 508, in restore_azure_wl File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/custom_wl.py", line 618, in restore_azure_wl File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/custom_help.py", line 448, in get_or_read_json File "json__init.py", line 293, in load File "json\init__.py", line 346, in loads File "json\decoder.py", line 337, in decode File "json\decoder.py", line 355, in raw_decode json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) To open an issue, please run: 'az feedback' cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x04D06808>] az_command_data_logger: exit code: 1 cli.main__: Command ran in 0.713 seconds (init: 0.356, invoke: 0.357) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 6651 in cache telemetry.check: Negative: The C:\Users\RobNotley.azure\telemetry.txt was modified at 2022-10-14 10:54:09.838550, which in less than 600.000000 s
Files
I can't upload JSON file as this isn't support but output of this is;
{ "alternate_directory_paths": null, "container_id": null, "container_uri": "VMAppContainer;Compute;rg-rndev-westeurope-dashworks-0f0f7c68;vm-rndev-sql-green-9f412f7b", "database_name": null, "filepath": null, "item_type": "SQL", "item_uri": "SQLDataBase;MSSQLSERVER;PM", "log_point_in_time": null, "recovery_mode": null, "recovery_point_id": "1847309172622175981", "restore_mode": "OriginalLocation", "source_resource_id": "/subscriptions/e64d6ed8-3ae2-4516-835c-1fc3df103568/resourceGroups/rg-rndev-westeurope-dashworks-0f0f7c68/providers/Microsoft.Compute/virtualMachines/vm-rndev-sql-green-9f412f7b", "workload_type": "SQLDataBase" }
Cloud Shell through Azure Portal
PS /home/rob> $rc = az backup recoveryconfig show --resource-group "rg-rndev-westeurope-common-c799b2ce" --vault-name "rsv-rndev-f9161b42" --container-name "VMAppContainer;compute;rg-rndev-westeurope-dashworks-0f0f7c68;vm-rndev-sql-green-9f412f7b" --item-name "SQLDataBase;mssqlserver;pm" --restore-mode OriginalWorkloadRestore --rp-name 1847309172622175981 --target-item-name "SQLDataBase;mssqlserver;pm" --target-server-name "sql-green" --target-server-type SQLInstance --workload-type SQLDataBase --output json
PS /home/rob> $rc
{
"alternate_directory_paths": null,
"container_id": null,
"container_uri": "VMAppContainer;Compute;rg-rndev-westeurope-dashworks-0f0f7c68;vm-rndev-sql-green-9f412f7b",
"database_name": null,
"filepath": null,
"item_type": "SQL",
"item_uri": "SQLDataBase;MSSQLSERVER;PM",
"log_point_in_time": null,
"recovery_mode": null,
"recovery_point_id": "1847309172622175981",
"restore_mode": "OriginalLocation",
"source_resource_id": "/subscriptions/e64d6ed8-3ae2-4516-835c-1fc3df103568/resourceGroups/rg-rndev-westeurope-dashworks-0f0f7c68/providers/Microsoft.Compute/virtualMachines/vm-rndev-sql-green-9f412f7b",
"workload_type": "SQLDataBase"
}
PS /home/rob> az backup restore restore-azurewl --resource-group "rg-rndev-westeurope-common-c799b2ce" --vault-name "rsv-rndev-f9161b42" --recovery-config $rc unrecognized arguments: alternate_directory_paths: null, container_id: null, container_uri: VMAppContainer;Compute;rg-rndev-westeurope-dashworks-0f0f7c68;vm-rndev-sql-green-9f412f7b, database_name: null, filepath: null, item_type: SQL, item_uri: SQLDataBase;MSSQLSERVER;PM, log_point_in_time: null, recovery_mode: null, recovery_point_id: 1847309172622175981, restore_mode: OriginalLocation, source_resource_id: /subscriptions/e64d6ed8-3ae2-4516-835c-1fc3df103568/resourceGroups/rg-rndev-westeurope-dashworks-0f0f7c68/providers/Microsoft.Compute/virtualMachines/vm-rndev-sql-green-9f412f7b, workload_type: SQLDataBase }
Examples from AI knowledge base:
https://aka.ms/cli_ref
Read more about the command in reference docs
PS /home/rob> az backup restore restore-azurewl --resource-group "rg-rndev-westeurope-common-c799b2ce" --vault-name "rsv-rndev-f9161b42" --recovery-config $rc --debug
cli.knack.cli: Command arguments: ['backup', 'restore', 'restore-azurewl', '--resource-group', 'rg-rndev-westeurope-common-c799b2ce', '--vault-name', 'rsv-rndev-f9161b42', '--recovery-config', '{', ' alternate_directory_paths: null,', ' container_id: null,', ' container_uri: VMAppContainer;Compute;rg-rndev-westeurope-dashworks-0f0f7c68;vm-rndev-sql-green-9f412f7b,', ' database_name: null,', ' filepath: null,', ' item_type: SQL,', ' item_uri: SQLDataBase;MSSQLSERVER;PM,', ' log_point_in_time: null,', ' recovery_mode: null,', ' recovery_point_id: 1847309172622175981,', ' restore_mode: OriginalLocation,', ' source_resource_id: /subscriptions/e64d6ed8-3ae2-4516-835c-1fc3df103568/resourceGroups/rg-rndev-westeurope-dashworks-0f0f7c68/providers/Microsoft.Compute/virtualMachines/vm-rndev-sql-green-9f412f7b,', ' workload_type: SQLDataBase', '}', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7faf69814160>, <function OutputProducer.on_global_arguments at 0x7faf696d24c0>, <function CLIQuery.on_global_arguments at 0x7faf696d7a60>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'backup': ['azure.cli.command_modules.backup']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: backup 0.004 16 58
cli.azure.cli.core: Total (1) 0.004 16 58
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: ai-examples 0.136 1 1 /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples
cli.azure.cli.core: Total (1) 0.136 1 1
cli.azure.cli.core: Loaded 17 groups, 59 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : backup restore restore-azurewl
cli.azure.cli.core: Command table: backup restore restore-azurewl
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7faf68c5b9d0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/rob/.azure/commands/2022-10-14.10-05-31.backup_restore_restore-azurewl.167.log'.
az_command_data_logger: command args: backup restore restore-azurewl --resource-group {} --vault-name {} --recovery-config {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.
Examples from AI knowledge base: https://aka.ms/cli_ref Read more about the command in reference docs cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7faf68c5bc10>] az_command_data_logger: exit code: 2 cli.main: Command ran in 0.532 seconds (init: 0.123, invoke: 0.409) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 3926 in cache telemetry.check: Negative: The /home/rob/.azure/telemetry.txt was modified at 2022-10-14 10:02:30.794808, which in less than 600.000000 s
@robnotley can you save the JSON output manually into a file instead of using the > c:\github\recovery.json
bit, and try the request with that file instead? It appears to be an file encoding issue with the way Powershell < 6 behaves, and not a CLI bug. You can check https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/vscode/understanding-file-encoding?view=powershell-7#configuring-powershell for more details if the workaround works for you.
@robnotley would you be able to confirm if this worked for you? If so, we can close this issue.
This is autogenerated. Please review and update as needed.
Describe the bug
When running
az backup restore restore-azurewl
the error below occurs.Initially I run
az backup recoverypoint list
to get a list of recovery points to work with. Then I runaz backup recoveryconfig show
to create a recovery config JSON file before runningaz backup restore restore-azurewl
using the JSON file. The issue appears to be related to the JSON file but the formatting appears to be correct as the JSON file appears to validate.Command Name
az backup restore restore-azurewl
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
get list of recovery points to work with
build recoveryconfig json file
--backup-management-type AzureWorkload
--container-name %container%--item-name "SQLDataBase;mssqlserver;pm"
--log-point-in-time "27-09-2022-07:32:58"--resource-group %resourcegroup%
--target-container-name %targetcontainer%--target-item-name "SQLDataBase;mssqlserver;pm"
--target-resource-group %resourcegroup%--target-server-name %servername%
--target-server-type SQLDatabase--target-vault-name %RSVVault%
--vault-name %RSVVault%--workload-type SQLDataBase
--output json `run restore task
Expected Behavior
A restore job should be started in Azure RSV.
Environment Summary
Additional Context
I have been following the docs below; https://learn.microsoft.com/en-us/azure/backup/backup-azure-sql-restore-cli https://learn.microsoft.com/en-us/cli/azure/backup/recoveryconfig?view=azure-cli-latest https://learn.microsoft.com/en-us/cli/azure/backup/restore?view=azure-cli-latest#az-backup-restore-restore-azurewl