Artifact script location is 100% correct and even converted 05-azcli-app-settings.sh with dos2unix and also set chmod +x on my local machine, before pushing to azure devops git.
I've no idea, why he can't find the script. Tried the same with the bash extension and script can be executed, but of course with errors due missing az installation.
Working with latest Azure DevOps and preview features enabled. Azure cli 1.x is used in the task sequence.
Thanks for any hints!
2018-11-02T15:33:22.0140785Z ##[section]Starting: Azure CLI: Web App Config Settings
2018-11-02T15:33:22.0144808Z ==============================================================================
2018-11-02T15:33:22.0144940Z Task : Azure CLI
2018-11-02T15:33:22.0145059Z Description : Run a Shell or Batch script with Azure CLI commands against an azure subscription
2018-11-02T15:33:22.0145162Z Version : 1.140.1
2018-11-02T15:33:22.0145261Z Author : Microsoft Corporation
2018-11-02T15:33:22.0145363Z Help : More Information
2018-11-02T15:33:22.0145496Z ==============================================================================
2018-11-02T15:33:22.3362592Z ##[error]Script failed with error: Error: Unable to locate executable file: 'D:\a\r1\a_Operations\xxxxx\05-azcli-app-settings.sh'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
2018-11-02T15:33:22.3383077Z ##[section]Finishing: Azure CLI: Web App Config Settings
xxxx was just masked by myself... the displayed location is 100% correct and file should be in the relevant working directory
Please provide task debug logs by setting 'system.debug' as 'true' in release variables.
@zerohat
Ping!
Feel free to reopen once you can provide debug logs.
I have the same issue
Extract from logs:
This from Download artifact task
2019-01-08T14:06:32.2804364Z Downloading drop/Database.Iac/deployment.sh to D:\a\r1\a\Database.Iac_CI\drop\Database.Iac\deployment.sh
2019-01-08T14:06:32.2808813Z Downloaded drop/Database.Iac/deployment.sh to D:\a\r1\a\Database.Iac_CI\drop\Database.Iac\deployment.sh
This from the actual task Azure CLI
2019-01-08T14:07:24.9511844Z ##[debug]testing directory 'D:\a\r1\a\Database.Iac_CI\drop\Database.Iac'
2019-01-08T14:07:24.9519611Z ##[debug]which 'D:\a\r1\a\Database.Iac_CI\drop\Database.Iac\deployment.sh'
2019-01-08T14:07:24.9526827Z ##[debug]not found
2019-01-08T14:07:24.9549245Z ##[debug]task result: Failed
2019-01-08T14:07:24.9608504Z ##[error]Script failed with error: Error: Unable to locate executable file: 'D:\a\r1\a\Database.Iac_CI\drop\Database.Iac\deployment.sh'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
@reallydontask it seems that you are running the task on a windows agent. On a windows agent, sh file extension is not considered executable and wont be run. Either change your agent to a Linux based machine or you would have to provide a windows cmd/bat file as the script file. We are also updating the documentation with this help text #9237
@sachinma I realized of my folly after i posted this but couldn't find this thread ...
So to confirm, i was running a bash script on a windows agent ... D'oh
what about yaml file?
I am facing the same issues
2019-08-29T11:49:32.7814178Z ##[debug]Evaluating condition for step: 'Configuration -Tier2 Kubernetes Secrets.'
2019-08-29T11:49:32.7815331Z ##[debug]Evaluating: succeeded()
2019-08-29T11:49:32.7815482Z ##[debug]Evaluating succeeded:
2019-08-29T11:49:32.7815700Z ##[debug]=> True
2019-08-29T11:49:32.7815942Z ##[debug]Result: True
2019-08-29T11:49:32.7816147Z ##[section]Starting: Configuration -Tier2 Kubernetes Secrets.
2019-08-29T11:49:32.7923391Z ==============================================================================
2019-08-29T11:49:32.7923595Z Task : Azure CLI
2019-08-29T11:49:32.7923671Z Description : Run Azure CLI commands against an Azure subscription in a Shell script when running on Linux agent or Batch script when running on Windows agent.
2019-08-29T11:49:32.7923725Z Version : 1.155.1
2019-08-29T11:49:32.7923780Z Author : Microsoft Corporation
2019-08-29T11:49:32.7923829Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-cli
2019-08-29T11:49:32.7923901Z ==============================================================================
2019-08-29T11:49:33.0072873Z ##[debug]agent.workFolder=d:\a
2019-08-29T11:49:33.0102097Z ##[debug]loading inputs and endpoints
2019-08-29T11:49:33.0108960Z ##[debug]loading ENDPOINT_AUTH_f1f48941-6faf-42b0-8fa9-a94b43690b24
2019-08-29T11:49:33.0118671Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_f1f48941-6faf-42b0-8fa9-a94b43690b24_AUTHENTICATIONTYPE
2019-08-29T11:49:33.0121400Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_f1f48941-6faf-42b0-8fa9-a94b43690b24_SERVICEPRINCIPALID
2019-08-29T11:49:33.0123349Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_f1f48941-6faf-42b0-8fa9-a94b43690b24_SERVICEPRINCIPALKEY
2019-08-29T11:49:33.0125340Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_f1f48941-6faf-42b0-8fa9-a94b43690b24_TENANTID
2019-08-29T11:49:33.0127234Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2019-08-29T11:49:33.0128991Z ##[debug]loading ENDPOINT_AUTH_SCHEME_f1f48941-6faf-42b0-8fa9-a94b43690b24
2019-08-29T11:49:33.0130658Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2019-08-29T11:49:33.0132003Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2019-08-29T11:49:33.0135505Z ##[debug]loading INPUT_ADDSPNTOENVIRONMENT
2019-08-29T11:49:33.0137350Z ##[debug]loading INPUT_ARGS
2019-08-29T11:49:33.0139197Z ##[debug]loading INPUT_CONNECTEDSERVICENAMEARM
2019-08-29T11:49:33.0140573Z ##[debug]loading INPUT_CWD
2019-08-29T11:49:33.0142198Z ##[debug]loading INPUT_FAILONSTANDARDERROR
2019-08-29T11:49:33.0145749Z ##[debug]loading INPUT_SCRIPTLOCATION
2019-08-29T11:49:33.0147874Z ##[debug]loading INPUT_SCRIPTPATH
2019-08-29T11:49:33.0162073Z ##[debug]loading INPUT_USEGLOBALCONFIG
2019-08-29T11:49:33.0170818Z ##[debug]loaded 17
2019-08-29T11:49:33.0181422Z ##[debug]check path : d:\a_tasks\AzureCLI_46e4be58-730b-4389-8a2f-ea10b3e5e815\1.155.1\task.json
2019-08-29T11:49:33.0183290Z ##[debug]set resource file to: d:\a_tasks\AzureCLI_46e4be58-730b-4389-8a2f-ea10b3e5e815\1.155.1\task.json
2019-08-29T11:49:33.0183477Z ##[debug]system.culture=en-US
2019-08-29T11:49:33.0201330Z ##[debug]which 'az'
2019-08-29T11:49:33.0389651Z ##[debug]found: 'C:\Program Files (x86)\Microsoft SDKs\AzureCLI2\wbin\az.cmd'
2019-08-29T11:49:33.0419059Z ##[debug]scriptLocation=scriptPath
2019-08-29T11:49:33.0423174Z ##[debug]cwd=d:\a\r1\a
2019-08-29T11:49:33.0425026Z ##[debug]scriptPath=d:\a\r1\a_InfraDev-Build-DEV\DEV\Kubernetes.aks_2.0\Scripts\tier2.add.serviceprincipal.secrects.ps1
2019-08-29T11:49:33.0425461Z ##[debug]check path : d:\a\r1\a_InfraDev-Build-DEV\DEV\Kubernetes.aks_2.0\Scripts\tier2.add.serviceprincipal.secrects.ps1
2019-08-29T11:49:33.0428485Z ##[debug]cwd=d:\a\r1\a
2019-08-29T11:49:33.0437154Z ##[debug]Absolute path for pathSegments: d:\a\r1\a = d:\a\r1\a
2019-08-29T11:49:33.0437891Z ##[debug]build.sourcesDirectory=undefined
2019-08-29T11:49:33.0438545Z ##[debug]system.defaultWorkingDirectory=d:\a\r1\a
2019-08-29T11:49:33.0438769Z ##[debug]Absolute path for pathSegments: d:\a\r1\a = d:\a\r1\a
2019-08-29T11:49:33.0440252Z ##[debug]cwdpath supplied :false
2019-08-29T11:49:33.0440717Z ##[debug]args=-keyVaultName "digital-dev-avk-001" -servicePrincipalIdKey "$(servicePrincipalIdKey)" -servicePrincipalIdValue "$(servicePrincipalId)" -servicePrincipalSecretKey "$(servicePrincipalSecretKey)" -servicePrincipalSecretValue "$(servicePrincipalSecret)"
2019-08-29T11:49:33.0443702Z ##[debug]failOnStandardError=false
2019-08-29T11:49:33.0447075Z ##[debug]testing directory 'd:\a\r1\a_InfraDev-Build-DEV\DEV\Kubernetes.aks_2.0\Scripts'
2019-08-29T11:49:33.0453372Z ##[debug]which 'd:\a\r1\a_InfraDev-Build-DEV\DEV\Kubernetes.aks_2.0\Scripts\tier2.add.serviceprincipal.secrects.ps1'
2019-08-29T11:49:33.0460883Z ##[debug]not found
2019-08-29T11:49:33.0483737Z ##[debug]task result: Failed
2019-08-29T11:49:33.0485988Z ##[error]Script failed with error: Error: Unable to locate executable file: 'd:\a\r1\a_InfraDev-Build-DEV\DEV\Kubernetes.aks_2.0\Scripts\tier2.add.serviceprincipal.secrects.ps1'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
2019-08-29T11:49:33.0486391Z ##[debug]Processed: ##vso[task.issue type=error;]Script failed with error: Error: Unable to locate executable file: 'd:\a\r1\a_InfraDev-Build-DEV\DEV\Kubernetes.aks_2.0\Scripts\tier2.add.serviceprincipal.secrects.ps1'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
2019-08-29T11:49:33.0487186Z ##[debug]Processed: ##vso[task.complete result=Failed;]Script failed with error: Error: Unable to locate executable file: 'd:\a\r1\a_InfraDev-Build-DEV\DEV\Kubernetes.aks_2.0\Scripts\tier2.add.serviceprincipal.secrects.ps1'. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
2019-08-29T11:49:33.0549156Z ##[section]Finishing: Configuration -Tier2 Kubernetes Secrets.
Most helpful comment
@reallydontask it seems that you are running the task on a windows agent. On a windows agent, sh file extension is not considered executable and wont be run. Either change your agent to a Linux based machine or you would have to provide a windows cmd/bat file as the script file. We are also updating the documentation with this help text #9237