azure-devops-cli-extension icon indicating copy to clipboard operation
azure-devops-cli-extension copied to clipboard

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

Open Pete-PlaytimeSolutions opened this issue 3 years ago • 0 comments

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...

    1. set project and org defaults...
  • az devops configure -d project=$name organization="$organization" --use-git-aliases true

    1. save a valid config file to "/c/dev/devops/projects/service-endpoint-configuration.json"
    1. 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

Additional Context

Pete-PlaytimeSolutions avatar Jun 08 '22 06:06 Pete-PlaytimeSolutions