Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
324 stars 56 forks source link

Problem With Deploy Static Web App #1533

Open FarrudaGod opened 3 weeks ago

FarrudaGod commented 3 weeks ago

I encountered an unknown exception during the deployment of an Azure Static Web App using Azure Pipelines. The deployment process downloads the mcr.microsoft.com/appsvc/staticappsclient:stable image and attempts to deploy the app, but it fails with an unknown exception.

Steps to reproduce the behavior:

  1. Run the Azure Pipeline configured to deploy an Azure Static Web App.
  2. The pipeline executes successfully until it reaches the deployment step.
  3. The process fails with an unknown exception and exits with code 1.

The Azure Static Web App should deploy successfully without any exceptions, completing the deployment process.

Status: Downloaded newer image for mcr.microsoft.com/appsvc/staticappsclient 
DeploymentId: 2f5abc4a-1f8b-4440-acce-70ed9962f582

An unknown exception has occurred

For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
Exiting ##[error]Error: The process '/usr/bin/bash' failed with exit code 1

Any insights or suggestions on how to resolve this issue would be greatly appreciated. Thank you!

Taks:

                    - ${{ if releaseOp.value.staticWebAppKey }}:
                        - task: AzureStaticWebApp@0
                          displayName: "Deploy Static Web App"
                          inputs:
                            app_location: "$(Build.BuildId)/dist"
                            skip_app_build: false
                            skip_api_build: true
                            is_static_export: false
                            verbose: true
                            azure_static_web_apps_api_token: $(deployment_token)
sebastianblesgen commented 1 week ago

app_location is probably / and you need an output_location I guess. Here is what I have (using devops release pipeline)

steps:
- task: AzureStaticWebApp@0
  displayName: 'Static Web App: '
  inputs:
    workingDirectory: '$(System.DefaultWorkingDirectory)/$(build-artifacts-name)'
    app_location: /
    output_location: dist
    skip_app_build: false
    skip_api_build: true
    is_static_export: false
    verbose: false
    azure_static_web_apps_api_token: '$(APIToken)'