azure static web app not starting after successful build and deployment

Leonard Kong 1 Reputation point

Although my action, azure-static-web-apps-agreeable-sky-odd2be310.yml, appears to build and deploy correctly (green check), my app does not load. If I open the Build and Deploy job, and look at the Build and Deploy section I see:

Try to validate location at: '/github/workspace/FoodTruckNotification/FoodTruckNotification.Wasm/bin/Release/net7.0/dist'.
App Directory Location: 'FoodTruckNotification/FoodTruckNotification.Wasm/bin/Release/net7.0/dist' was found.
Try to validate location at: '/github/workspace/swa-db-connections'.
Looking for event info
Starting to build app with Oryx
Azure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here:
Oryx will build app with the following custom override command: dotnet build
---Oryx build logs---

Operation performed by Microsoft Oryx,
You can report issues at

Oryx Version: 0.2.20230717.2, Commit: 174f4287104c15e6f9ea3a4cf6e9f80accba3cf3, ReleaseTagName: 20230717.2

Build Operation ID: 1074f932d13cc62b
OS Type           : bullseye
Image Type        : jamstack

Detecting platforms...
Could not detect any platform in the source directory.
Error: Could not detect the language from repo.

---End of Oryx build logs---
Oryx was unable to determine the build steps. Continuing assuming the assets in this folder are already built. If this is an unexpected behavior please contact support.
Finished building app with Oryx
Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
No Api directory specified. Azure Functions will not be created.
Either no Api directory was specified, or the specified directory was not found. Azure Functions will not be created.
Zipping App Artifacts
Done Zipping App Artifacts
Uploading build artifacts.
Finished Upload. Polling on deployment.
Status: InProgress. Time: 0.0600334(s)
Status: Succeeded. Time: 15.1100465(s)
Deployment Complete :)
Visit your site at:
Unexectedly failed to add GitHub comment.
Thanks for using Azure Static Web Apps!

I have looked at the online help and made adjustments to my action, including removing the api_location and adding the app_build_command to the build and deploy section.

name: Azure Static Web Apps CI/CD

      - master
    types: [opened, synchronize, reopened, closed]
      - master

    if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
    runs-on: ubuntu-latest
    name: Build and Deploy Job
      - uses: actions/checkout@v3
          submodules: true
      - name: Setup dotnet
        uses: actions/setup-dotnet@v3.2.0
          dotnet-version: '7.0.100'
      - run: |
          cd FoodTruckNotification/FoodTruckNotification.Wasm
          dotnet restore
          dotnet build -c Release    
      - name: Build And Deploy
        id: builddeploy
        uses: Azure/static-web-apps-deploy@v1
          azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AGREEABLE_SKY_0DD2BE310 }}
          repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
          action: "upload"
          ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
          # For more information regarding Static Web App workflow configurations, please visit:
          app_location: "FoodTruckNotification/FoodTruckNotification.Wasm/bin/Release/net7.0/dist" # App source code path
          ### api_location: "" # Api source code path - optional
          output_location: "FoodTruckNotification/FoodTruckNotification.Wasm/bin/Release/net7.0/publish/wwwroot" # Built app content directory - optional
          app_build_command: "dotnet build"
          ###### End of Repository/Build Configurations ######

    if: github.event_name == 'pull_request' && github.event.action == 'closed'
    runs-on: ubuntu-latest
    name: Close Pull Request Job
      - name: Close Pull Request
        id: closepullrequest
        uses: Azure/static-web-apps-deploy@v1
          azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AGREEABLE_SKY_0DD2BE310 }}
          action: "close"

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
549 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 20,966 Reputation points Microsoft Employee

    Hi @Leonard Kong

    In looking at your yaml, it almost seems like you're building a Blazor server app. If you created your project using Visual Studio, and selected the ASP.NET Server hosting, then this may be the issue.

    User's image

    If you are, then you need to set to the app_location to the folder of the client app; using the example above, it would be /BlazorApp1.Client. Your app should start up, but if you're leveraging elements from the shared project, you'll likely run into reference issues. If that's the case, then you'll need to deploy your project to an app service as the Static Web App is client-side hosting.

    EDIT 13 Sept 2023: We determined that there was nothing wrong with your yaml configuration. Your Uno landing page was displaying but your app wasn't available. You changed your yaml to deploy -c Debug configuration your application ran as expected. Upon further investigation, you discovered that a shared folder was missing from your -c Release configuration.