I am trying to deploy my first Azure Static Web App from Azure DevOps using a self-hosted agent on my local Windows machine. The agent is set up and appears online in the Azure DevOps settings. However, I am encountering an issue with the AzureStaticWebApp task in my pipeline.
Here is the YAML configuration of the pipeline:
name: Azure Static Web Apps CI/CD
pr:
branches:
include:
- master
trigger:
branches:
include:
- master
jobs:
- job: build_and_deploy_job
displayName: Build and Deploy Job
condition: or(eq(variables['Build.Reason'], 'Manual'),or(eq(variables['Build.Reason'], 'PullRequest'),eq(variables['Build.Reason'], 'IndividualCI')))
pool:
name: Local Agent Pool
variables:
- group: Azure-Static-Web-Apps-victorious-beach-0d42cb803-variable-group
steps:
- checkout: self
submodules: true
- task: AzureStaticWebApp@0
inputs:
azure_static_web_apps_api_token: $(AZURE_STATIC_WEB_APPS_API_TOKEN_VICTORIOUS_BEACH_0D42CB803)
app_location: "/"
api_location: ""
output_location: "build"
skip_api_build: true
Now the issue: When I run the pipeline, the AzureStaticWebApp task fails with the following error message:
2024-10-04T14:42:16.5040695Z [command]C:\WINDOWS\system32\bash.exe C:\agent\_work\_tasks\AzureStaticWebApp_18aad896-e191-4720-88d6-8ced4806941a\0.246.1\launch-docker.sh
2024-10-04T14:42:22.3067301Z /bin/bash: C:agent_work_tasksAzureStaticWebApp_18aad896-e191-4720-88d6-8ced4806941a0.246.1launch-docker.sh: No such file or directory
2024-10-04T14:42:22.3142262Z
2024-10-04T14:42:22.3238448Z ##[error]Error: The process 'C:\WINDOWS\system32\bash.exe' failed with exit code 127
2024-10-04T14:42:22.3285032Z ##[section]Finishing: AzureStaticWebApp
I think the problem appears to be related to how paths are being handled. The command that fails seems to use a Windows-style path, but the Bash environment expects a Linux-style path. I believe it should look something like this:
C:\WINDOWS\system32\bash.exe mnt\c\agent\_work\_tasks\AzureStaticWebApp_18aad896-e191-4720-88d6-8ced4806941a\0.246.1\launch-docker.sh
But I have no idea to change it, nor any idea if I should change it somewhere or if my configuration is incorrect... Any help?
WSL is correctly installed and docker is also accessible within the WSL environment.
