Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--preview parameter of az vm repair run #6820

Open
hkelley opened this issue Sep 29, 2023 · 6 comments
Open

--preview parameter of az vm repair run #6820

hkelley opened this issue Sep 29, 2023 · 6 comments
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Milestone

Comments

@hkelley
Copy link

hkelley commented Sep 29, 2023

Describe the bug

The --preview parameter works with this command:

az vm repair list-scripts --preview $scripts 

but doesn't seem to work with

az vm repair run -g $rgname -n $vmname --run-on-repair --preview "$scripts" --run-id script-name

Related command

az vm repair run

Errors

az vm repair run -g $rgname -n $vmname --run-on-repair --preview "$scripts" --run-id win-reset-csfalcon-aid

Issue script & Debug output

az vm repair run -g $rgname -n $vmname --run-on-repair --preview "$scripts" --run-id win-reset-csfalcon-aid --debug

cli.knack.cli: Command arguments: ['vm', 'repair', 'run', '-g', 'RG-EUC-SANDBOX-RZRECOVERTEST', '-n', 'xxxxrztest1', '--run-on-repair', '--preview', 'https://github.com/hkelley/repair-script-library/blob/master/map.json', '--run-id', 'win-reset-csfalcon-aid', '--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 0x7fad98ec71f0>, <function OutputProducer.on_global_arguments at 0x7fad98de1d30>, <function CLIQuery.on_global_arguments at 0x7fad98d79310>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'vm': ['azure.cli.command_modules.vm', 'azext_vm_repair']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: vm 0.207 57 244
cli.azure.cli.core: Total (1) 0.207 57 244
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.084 1 1 /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples
cli.azure.cli.core: vm-repair 0.005 2 6 /home/hkelley/.azure/cliextensions/vm-repair
cli.azure.cli.core: Total (2) 0.088 3 7
cli.azure.cli.core: Loaded 59 groups, 251 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : vm repair run
cli.azure.cli.core: Command table: vm repair run
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fad9821c430>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/hkelley/.azure/commands/2023-09-29.23-15-16.vm_repair_run.4244.log'.
az_command_data_logger: command args: vm repair run -g {} -n {} --run-on-repair --preview {} --run-id {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7fad981c7040>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7fad981850d0>, <function register_cache_arguments..add_cache_arguments at 0x7fad9818dee0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7fad98de1dc0>, <function CLIQuery.handle_query_parameter at 0x7fad98d793a0>, <function register_ids_argument..parse_ids_arguments at 0x7fad9818de50>]
az_command_data_logger: extension name: vm-repair
az_command_data_logger: extension version: 0.5.6
urllib3.connectionpool: Starting new HTTPS connection (1): aka.ms:443
urllib3.connectionpool: https://aka.ms:443 "GET /azure-cli-extension-index-v1 HTTP/1.1" 301 0
urllib3.connectionpool: Starting new HTTPS connection (1): azcliextensionsync.blob.core.windows.net:443
urllib3.connectionpool: https://azcliextensionsync.blob.core.windows.net:443 "GET /index1/index.json HTTP/1.1" 200 3248112
cli.azext_vm_repair.repair_utils: The extension with name vm-repair does not exist within available extensions.
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ComputeManagementClient
urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342
urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2414
msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'}
cli.azure.cli.core.auth.adal_authentication: MSIAuthenticationWrapper.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342
urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2414
msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'}
cli.azure.cli.core.auth.adal_authentication: Normalize expires_on: '1696032972' -> 1696032972
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-SANDBOX-RZRECOVERTEST/providers/Microsoft.Compute/virtualMachines/xxxxrztest1?api-version=2022-11-01'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '0cee93d6-5f1e-11ee-84fa-00155d9a454d'
cli.azure.cli.core.sdk.policies: 'CommandName': 'vm repair run'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-g -n --run-on-repair --preview --run-id --debug'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.53.0 (RPM) azsdk-python-azure-mgmt-compute/30.0.0 Python/3.9.14 (Linux-5.10.102.2-microsoft-standard-x86_64-with-glibc2.35) cloud-shell/1.0'
cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-SANDBOX-RZRECOVERTEST/providers/Microsoft.Compute/virtualMachines/xxxxrztest1?api-version=2022-11-01 HTTP/1.1" 200 None
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Transfer-Encoding': 'chunked'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies: 'Content-Encoding': 'gzip'
cli.azure.cli.core.sdk.policies: 'Expires': '-1'
cli.azure.cli.core.sdk.policies: 'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31964'
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'cb94c6c6-c23a-4a26-a357-96aacabf5f78'
cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11993'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '431c93f1-7e2e-4f2a-9a28-2e002bad763f'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'EASTUS:20230929T231519Z:431c93f1-7e2e-4f2a-9a28-2e002bad763f'
cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies: 'Date': 'Fri, 29 Sep 2023 23:15:19 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {
"name": "xxxxrztest1",
"id": "/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-SANDBOX-RZRECOVERTEST/providers/Microsoft.Compute/virtualMachines/xxxxrztest1",
"type": "Microsoft.Compute/virtualMachines",
"location": "eastus",
"tags": {},
"properties": {
"hardwareProfile": {
"vmSize": "Standard_D2_v5"
},
"provisioningState": "Succeeded",
"vmId": "a67e66c8-8473-4c3f-80af-0a536809a06f",
"storageProfile": {
"osDisk": {
"osType": "Windows",
"name": "xxxxrztest1-0fea17a7-fef6-4279-9efe-700e5d418da8_Disk-1",
"createOption": "Attach",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-Sandbox-RZRecoverTest/providers/Microsoft.Compute/disks/xxxxrztest1-0fea17a7-fef6-4279-9efe-700e5d418da8_Disk-1"
},
"deleteOption": "Detach",
"diskSizeGB": 101
},
"dataDisks": [
{
"lun": 0,
"name": "xxxxrztest1-baa2e550-aad8-4861-82d3-ced6e68958d2_Disk-1",
"createOption": "Attach",
"caching": "None",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-Sandbox-RZRecoverTest/providers/Microsoft.Compute/disks/xxxxrztest1-baa2e550-aad8-4861-82d3-ced6e68958d2_Disk-1"
},
"deleteOption": "Detach",
"diskSizeGB": 41,
"toBeDetached": false
}
]
},
"networkProfile": {"networkInterfaces":[{"id":"/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-Sandbox-RZRecoverTest/providers/Microsoft.Network/networkInterfaces/xxxxrztest1netinterface"}]},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true
}
},
"timeCreated": "2023-09-29T10:09:31.082651+00:00"
}
}
cli.azext_vm_repair._validators: Searching for repair-vm within subscription...
cli.azext_vm_repair.repair_utils: Calling: az resource list --tag repair_source=RG-EUC-SANDBOX-RZRECOVERTEST/xxxxrztest1 --query "[?type=='microsoft.compute/virtualmachines' || type=='Microsoft.Compute/virtualMachines']" -o json
cli.azext_vm_repair.repair_utils: Success.

cli.azext_vm_repair.validators: Found repair VM: /subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/repair-xxxxrztest1-20230929223045/providers/Microsoft.Compute/virtualMachines/repair-xxxxrz

cli.azext_vm_repair.custom: vm repair run parameters: vm_name: xxxxrztest1, resource_group_name: RG-EUC-SANDBOX-RZRECOVERTEST, run_id: win-reset-csfalcon-aid, repair_vm_id: /subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/repair-xxxxrztest1-20230929223045/providers/Microsoft.Compute/virtualMachines/repair-xxxxrz_, custom_script_file: None, parameters: None, run_on_repair: True, preview: https://github.com/hkelley/repair-script-library/blob/master/map.json
https://raw.githubusercontent.com/hkelley/repair-script-library/master/map.json
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ComputeManagementClient
urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342
urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2414
msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'}
cli.azure.cli.core.auth.adal_authentication: MSIAuthenticationWrapper.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
urllib3.connectionpool: Starting new HTTP connection (1): localhost:50342
urllib3.connectionpool: http://localhost:50342 "POST /oauth2/token HTTP/1.1" 200 2414
msrestazure.azure_active_directory: MSI: Retrieving a token from http://localhost:50342/oauth2/token, with payload {'resource': 'https://management.core.windows.net/'}
cli.azure.cli.core.auth.adal_authentication: Normalize expires_on: '1696032972' -> 1696032972
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-SANDBOX-RZRECOVERTEST/providers/Microsoft.Compute/virtualMachines/xxxxrztest1?api-version=2022-11-01'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '0cee93d6-5f1e-11ee-84fa-00155d9a454d'
cli.azure.cli.core.sdk.policies: 'CommandName': 'vm repair run'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-g -n --run-on-repair --preview --run-id --debug'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.53.0 (RPM) azsdk-python-azure-mgmt-compute/30.0.0 Python/3.9.14 (Linux-5.10.102.2-microsoft-standard-x86_64-with-glibc2.35) cloud-shell/1.0'
cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-SANDBOX-RZRECOVERTEST/providers/Microsoft.Compute/virtualMachines/xxxxrztest1?api-version=2022-11-01 HTTP/1.1" 200 None
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Transfer-Encoding': 'chunked'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies: 'Content-Encoding': 'gzip'
cli.azure.cli.core.sdk.policies: 'Expires': '-1'
cli.azure.cli.core.sdk.policies: 'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31963'
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '9ebee0eb-1f61-43be-a101-d2b2377f21a0'
cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '11997'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '61fbecc2-9c11-45b2-b65d-a214fb84d539'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'EASTUS:20230929T231521Z:61fbecc2-9c11-45b2-b65d-a214fb84d539'
cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies: 'Date': 'Fri, 29 Sep 2023 23:15:20 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {
"name": "xxxxrztest1",
"id": "/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-SANDBOX-RZRECOVERTEST/providers/Microsoft.Compute/virtualMachines/xxxxrztest1",
"type": "Microsoft.Compute/virtualMachines",
"location": "eastus",
"tags": {},
"properties": {
"hardwareProfile": {
"vmSize": "Standard_D2_v5"
},
"provisioningState": "Succeeded",
"vmId": "a67e66c8-8473-4c3f-80af-0a536809a06f",
"storageProfile": {
"osDisk": {
"osType": "Windows",
"name": "xxxxrztest1-0fea17a7-fef6-4279-9efe-700e5d418da8_Disk-1",
"createOption": "Attach",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-Sandbox-RZRecoverTest/providers/Microsoft.Compute/disks/xxxxrztest1-0fea17a7-fef6-4279-9efe-700e5d418da8_Disk-1"
},
"deleteOption": "Detach",
"diskSizeGB": 101
},
"dataDisks": [
{
"lun": 0,
"name": "xxxxrztest1-baa2e550-aad8-4861-82d3-ced6e68958d2_Disk-1",
"createOption": "Attach",
"caching": "None",
"managedDisk": {
"storageAccountType": "Standard_LRS",
"id": "/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-Sandbox-RZRecoverTest/providers/Microsoft.Compute/disks/xxxxrztest1-baa2e550-aad8-4861-82d3-ced6e68958d2_Disk-1"
},
"deleteOption": "Detach",
"diskSizeGB": 41,
"toBeDetached": false
}
]
},
"networkProfile": {"networkInterfaces":[{"id":"/subscriptions/7d6de5dd-bfc5-47b2-acee-e18b6c76bb2c/resourceGroups/RG-EUC-Sandbox-RZRecoverTest/providers/Microsoft.Network/networkInterfaces/xxxxrztest1netinterface"}]},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true
}
},
"timeCreated": "2023-09-29T10:09:31.082651+00:00"
}
}
urllib3.connectionpool: Starting new HTTPS connection (1): raw.githubusercontent.com:443
urllib3.connectionpool: https://raw.githubusercontent.com:443 "GET /hkelley/repair-script-library/master/map.json HTTP/1.1" 200 1351
cli.azext_vm_repair.custom: Running script on repair VM: repair-xxxxrz_
cli.azext_vm_repair.repair_utils: Calling: az vm run-command invoke -g repair-xxxxrztest1-20230929223045 -n repair-xxxxrz_ --command-id RunPowerShellScript --scripts @"/home/hkelley/.azure/cliextensions/vm-repair/azext_vm_repair/scripts/win-run-driver.ps1" -o json --parameters script_path="./src/windows/win-reset-csfalcon-aid.ps1"
cli.azext_vm_repair.repair_utils: Success.

cli.azext_vm_repair.custom: stderr:
cli.azext_vm_repair.custom:
Script returned with error:
[Error 09/29/2023 23:15:33] The term './src/windows/win-reset-csfalcon-aid.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at , : line 1
at , C:\Packages\Plugins\Microsoft.CPlat.Core.RunCommandWindows\1.1.15\Downloads\script3.ps1: line 23

cli.knack.cli: Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x7fad981e6310>, <function x509_from_base64_to_hex_transform at 0x7fad981e63a0>]
cli.knack.cli: Event: CommandInvoker.OnFilterResult []
{
"log_full_path": "C:\Packages\Plugins\Microsoft.CPlat.Core.RunCommandWindows\1.1.15\Downloads\repair-files-20230929231532\logs-20230929231532.txt",
"logs": "[Log-Start 09/29/2023 23:15:32]\n[Error 09/29/2023 23:15:33] The term './src/windows/win-reset-csfalcon-aid.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at , : line 1\nat , C:\Packages\Plugins\Microsoft.CPlat.Core.RunCommandWindows\1.1.15\Downloads\script3.ps1: line 23\n[Log-End 09/29/2023 23:15:33]C:\Packages\Plugins\Microsoft.CPlat.Core.RunCommandWindows\1.1.15\Downloads\repair-files-20230929231532\logs-20230929231532.txt",
"message": "Script completed with errors.",
"output": "[Error 09/29/2023 23:15:33] The term './src/windows/win-reset-csfalcon-aid.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at , : line 1\nat , C:\Packages\Plugins\Microsoft.CPlat.Core.RunCommandWindows\1.1.15\Downloads\script3.ps1: line 23",
"resource_group": "repair-xxxxrztest1-20230929223045",
"script_status": "ERROR",
"status": "SUCCESS",
"vm_name": "repair-xxxxrz
"
}
cli.knack.cli: Event: Cli.SuccessfulExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fad9821c670>]
az_command_data_logger: exit code: 0
cli.main: Command ran in 37.237 seconds (init: 0.154, invoke: 37.083)
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 3523 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/bin/python3.9 /usr/lib/az/lib/python3.9/site-packages/azure/cli/telemetry/init.py /home/hkelley/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

Expect github-based fork map.json and script to be used.

list-scripts shows my custom map.json content (although it shows the wrong URL in the message property

az vm repair list-scripts --preview $scripts 
https://raw.githubusercontent.com/hkelley/repair-script-library/master/map.json
{
  "map": [
......
    {
      "description": "Reset the CrowdStrike Falcon AID so that this VM will be separate from its source (which may still be network isolated).",
      "id": "win-reset-csfalcon-aid",
      "path": "src/windows/win-reset-csfalcon-aid.ps1"
    }
  ],
  "message": "Available script list succesfully fetched from https://github.com/Azure/repair-script-library",
  "status": "SUCCESS"
}

Similar parameter signature fails for repair run :

az vm repair run -g $rgname -n $vmname --run-on-repair --preview "$scripts" --run-id win-reset-csfalcon-aid 
https://raw.githubusercontent.com/hkelley/repair-script-library/master/map.json

Script returned with error:
[Error 09/29/2023 23:06:33] The term './src/windows/win-reset-csfalcon-aid.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at <ScriptBlock>, <No file>: line 1
at <ScriptBlock>, C:\Packages\Plugins\Microsoft.CPlat.Core.RunCommandWindows\1.1.15\Downloads\script2.ps1: line 23

{
  "log_full_path": "C:\\Packages\\Plugins\\Microsoft.CPlat.Core.RunCommandWindows\\1.1.15\\Downloads\\repair-files-20230929230632\\logs-20230929230632.txt",
  "logs": "[Log-Start 09/29/2023 23:06:32]\n[Error 09/29/2023 23:06:33] The term './src/windows/win-reset-csfalcon-aid.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at <ScriptBlock>, <No file>: line 1\nat <ScriptBlock>, C:\\Packages\\Plugins\\Microsoft.CPlat.Core.RunCommandWindows\\1.1.15\\Downloads\\script2.ps1: line 23\n[Log-End 09/29/2023 23:06:33]C:\\Packages\\Plugins\\Microsoft.CPlat.Core.RunCommandWindows\\1.1.15\\Downloads\\repair-files-20230929230632\\logs-20230929230632.txt",
  "message": "Script completed with errors.",
  "output": "[Error 09/29/2023 23:06:33] The term './src/windows/win-reset-csfalcon-aid.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at <ScriptBlock>, <No file>: line 1\nat <ScriptBlock>, C:\\Packages\\Plugins\\Microsoft.CPlat.Core.RunCommandWindows\\1.1.15\\Downloads\\script2.ps1: line 23",
  "resource_group": "repair-tcnw1rztest1-20230929223045",
  "script_status": "ERROR",
  "status": "SUCCESS",
  "vm_name": "repair-xxxx_"
}

Environment Summary

az --version
azure-cli 2.53.0

core 2.53.0
telemetry 1.1.0

Extensions:
ai-examples 0.2.5
ml 2.20.0
ssh 2.0.1
vm-repair 0.5.6

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location '/usr/bin/python3.9'
Extensions directory '/home/hkelley/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.14 (main, Feb 8 2023, 03:39:52)
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

@hkelley hkelley added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Sep 29, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. Compute labels Sep 29, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team labels Sep 29, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Sep 29, 2023

Thank you for opening this issue, we will look into it.

@yanzhudd
Copy link
Contributor

Hi @haagha, could you please help look at this question? Thanks.

@haagha
Copy link
Member

haagha commented Oct 13, 2023

Looking into this. Thanks

@haagha haagha self-assigned this Oct 13, 2023
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 14, 2023
@yonzhan yonzhan added this to the Backlog milestone Oct 14, 2023
@yonzhan yonzhan added the Service Attention This issue is responsible by Azure service team. label Oct 14, 2023
@microsoft-github-policy-service
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @TravisCragg-MSFT, @nikhilpatel909, @sandeepraichura, @hilaryw29, @GabstaMSFT, @ramankumarlive, @ushnaarshadkhan.

@haagha
Copy link
Member

haagha commented Oct 26, 2023

Hi After further investigation, a fix is not required. The customer has a mistep when running the command: Their map.json file path does not exist because the branch master does not exist:

az vm repair run -g RG-EUC-SANDBOX-RZRECOVERTEST -n tcnw1rztest1 --run-on-repair --preview https://github.com/hkelley/repair-script-library/blob/master/map.json --run-id win-hello-world

The above command should be :
az vm repair run -g RG-EUC-SANDBOX-RZRECOVERTEST -n tcnw1rztest1 --run-on-repair --preview https://github.com/hkelley/repair-script-library/blob/main/map.json --run-id win-hello-world

@hkelley
Copy link
Author

hkelley commented Oct 30, 2023

Thank you for pointing that out. Why does it work (with the wrong branch name) in the list-scripts command but not the run command?

For example, this shows my custom map.json file contents even if I use the master branch name:

az vm repair list-scripts --preview 'https://github.com/hkelley/repair-script-library/blob/master/map.json'

Perhaps the examples section on this page should be updated to use the new branch name. I assumed, because I had forked the MS repair-script-library directly, that could copy the command as-is.

https://learn.microsoft.com/en-us/cli/azure/vm/repair?view=azure-cli-latest#az-vm-repair-run-examples

az vm repair run -g MyResourceGroup -n MySourceWinVM --preview "https://github.com/haagha/repair-script-library/blob/master/map.json" --run-id test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants