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
329 stars 56 forks source link

AzureStaticWebApp@0 deploy fails around staticwebapp.config.json with no errors/logs #1142

Open DonThompson opened 1 year ago

DonThompson commented 1 year ago

Describe the bug

To Reproduce I have an Azure Devops pipeline that Builds my angular application and creates an artifact. I then have a Release pipeline that uses AzureStaticWebApp@0 to deploy that to an Azure Static Web App. This has been working fine until I attempted to add staticwebapp.config.json into my project. staticwebapp.config.json is in the /src/ directory of my angular application and also list as part of the assets configuration to output it to the root with the rest of the application (beside index.html). The file appears to be detected as normal, but then the deployment just quits for no reason. This does not seem to be an error state. I have enabled Verbose logging, but nothing more is written. (If I remove the staticwebapp.config.json from my project, this deployment works just fine)

2023-04-21T14:28:17.4621160Z Verbose logging enabled
2023-04-21T14:28:17.4981887Z Build timeout not specified, defaulting to 15 minutes
2023-04-21T14:28:17.4982618Z App Directory Location: '_Admin Web Build/drop' was found.
2023-04-21T14:28:17.4988260Z config_file_location: config file '_Admin Web Build/drop/staticwebapp.config.json' was found.
2023-04-21T14:28:17.4988625Z Looking for event info
2023-04-21T14:28:17.4993611Z Could not get event info. Proceeding
2023-04-21T14:28:21.3040039Z Skipping step to build /working_dir/_Admin Web Build/drop with Oryx
2023-04-21T14:28:21.3046880Z Didn't find Oryx manifest file under location: /2046f6c8-584a-474b-b9e2-4693eaebb7f7-swa-oryx/app-manifest/oryx-manifest.toml
2023-04-21T14:28:21.3126790Z Determined default file to be: index.html
2023-04-21T14:28:21.3127121Z Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
2023-04-21T14:28:21.3506023Z 
2023-04-21T14:28:21.3506728Z ##[warning]For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
2023-04-21T14:28:21.3507346Z ##[warning]If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
2023-04-21T14:28:21.3507518Z ##[warning]Exiting
2023-04-21T14:28:21.4573006Z ##[error]Error: The process '/usr/bin/bash' failed with exit code 1
2023-04-21T14:28:21.4608494Z ##[section]Finishing: Static Web App: 

Here's the YAML if helpful:

steps:
- task: AzureStaticWebApp@0
  displayName: 'Static Web App: '
  inputs:
    app_location: '_Admin Web Build/drop'
    output_location: '_Admin Web Build/drop'
    config_file_location: '_Admin Web Build/drop'
    skip_app_build: true
    skip_api_build: true
    is_static_export: false
    verbose: true
    azure_static_web_apps_api_token: <redacted>

Expected behavior Deployment would proceed as normal.

DonThompson commented 1 year ago

FWIW since I'm stuck here and if anyone else runs into this, I went with a routes.json which worked just fine. I know it's deprecated and I'd prefer not to use it, but it is at least functioning for me.

Bobetti commented 5 months ago

Same situation here: without staticwebapp.config.json get 404 on redirect authentication call back. Followed the suggestion: https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-blazor by adding this file, got problems with devops pipeline.

Stuck!