Azure / azure-batch-cli-extensions

Batch extension cli commands for Azure cli v2
Other
12 stars 18 forks source link

Batch azure-batch-cli-extensions shows unknown version #103

Closed mifung closed 5 years ago

mifung commented 5 years ago

While running a batch job command: az batch job create --template sql_job_template.json --parameters job-params.json, a series of python file errors return. /***** Unexpect element blobSource in template Traceback (most recent call last): File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/init.py", line 328, in execute raise ex ****/

bgklein commented 5 years ago

@mifung Could you run az --version to get some version information? Our REST API recently had a breaking change where blobSource was renamed httpUrl. Replacing this in your template should mitigate your issue, but I would like to investigate this further as the CLI should have been non-breaking.

mifung commented 5 years ago

Yes, the az- v returns the following:

Extensions: azure-batch-cli-extensions Unknown

Python location '/opt/az/bin/python3' Extensions directory '/home/michael/.azure/cliextensions'

Python (Linux) 3.6.5 (default, Feb 21 2019, 23:58:07) [GCC 5.4.0 20160609]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

From: Brandon Klein notifications@github.com Sent: Monday, March 4, 2019 1:47 PM To: Azure/azure-batch-cli-extensions azure-batch-cli-extensions@noreply.github.com Cc: Michael Fung mifung@microsoft.com; Author author@noreply.github.com Subject: Re: [Azure/azure-batch-cli-extensions] Batch azure-batch-cli-extensions shows unknown version (#103)

Could you run az --version to get some version information? Our REST API recently had a breaking change where blobSource was renamed httpUrl. Replacing this in your template should mitigate your issue, but I would like to investigate this further as the CLI should have been non-breaking.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-batch-cli-extensions%2Fissues%2F103%23issuecomment-469372438&data=02%7C01%7Cmifung%40microsoft.com%7C70bdf9f7eae84a74863108d6a0d1c437%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636873220167100368&sdata=rjUMMuZ%2BwLHf5NUwh82fyaJ1eThyTcH1akeb3kVigHU%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAiJqv1GgLyXdkvDgtvwUTJnxFEPh3bYGks5vTWobgaJpZM4bc8DD&data=02%7C01%7Cmifung%40microsoft.com%7C70bdf9f7eae84a74863108d6a0d1c437%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636873220167100368&sdata=Y3TwWwAaY7BszfE%2FBsIxphvY9YbMlDK26XfqXYdHXxg%3D&reserved=0.

bgklein commented 5 years ago

It looks like there is a piece of validation code which is raising this error when it doesn't need to. I will update the SDK to fix this.

To mitigate the error immediately you should be able to replace blobSource with httpUrl in the file with no other changes necessary. You could also downgrade to CLI v 2.0.58 and its respective version of the extension which should still use the old REST API.

bgklein commented 5 years ago

Could you try reinstalling the Batch CLI Extension? It looks like we have already added some code which should address this.