Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
617 stars 239 forks source link

absolute path not working with az devops service-endpoint create --service-endpoint-configuration #1277

Open Pete-PlaytimeSolutions opened 2 years ago

Pete-PlaytimeSolutions commented 2 years ago

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.

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

Additional Context