azure-devops-cli-extension
azure-devops-cli-extension copied to clipboard
absolute path not working with az devops service-endpoint create --service-endpoint-configuration
Describe the bug
When running the az devops service-endpoint create --service-endpoint-configuration "[absolute path]" I get the following error. If I change it to use a relative path it completes successfully.
Command Name
az devops service-endpoint create Extension Name: azure-devops. Version: 0.21.0.
Errors:
[Errno 2] No such file or directory: '/mnt/d/dev/ANZICS/SURVEYS/devops/scripts/service-principal.json'
Traceback (most recent call last):
Temp\pip-unpacked-wheel-mtleih48\knack\cli.py, ln 215, in invoke
cli\core\commands\__init__.py, ln 654, in execute
cli\core\commands\__init__.py, ln 718, in _run_jobs_serially
cli\core\commands\__init__.py, ln 709, in _run_job
azext_devops\dev\common\exception_handler.py, ln 31, in azure_devops_exception_handler
reraise(*sys.exc_info())
...
azext_devops\dev\common\utils.py, ln 78, in _read_file_content_ver3
with open(file_path, 'r', encoding=encoding) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/c/dev/devops/projects/service-principal.json'
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
-
Put any pre-requisite steps here...
-
- set project and org defaults...
-
az devops configure -d project=$name organization="$organization" --use-git-aliases true
-
- save a valid config file to "/c/dev/devops/projects/service-endpoint-configuration.json"
-
- exec the "az devops service-endpoint create" command
-
az devops service-endpoint create --detect true --service-endpoint-configuration "/c/dev/devops/projects/service-endpoint-configuration.json--query "id" -o tsv
Expected Behavior
service endpoint should be created
Environment Summary
Windows-10-10.0.22000-SP0
Python 3.6.8
Installer:
azure-cli 2.11.1
Extensions:
azure-devops 0.21.0