5

I have a simple index.html in github. I created a static web app in azure and pointed it to git hub. It ran some sort of build pipeline and my page was live without problem.

Now I added some more pages, but when I push to git, the static web app build fails with:

Oryx built the app folder but was unable to determine the location of the app artifacts. Please specify the app artifact location.

Many people have the same issue, and the general recommendation is to set api_location, but I cant find where this is specified.

I cant find any build scripts, and I certainly dont have enough knowledge to write one from scratch.

The build script presumably only needs to do a simple checkout of the git files.

UPDATE

Searching for a solution, I came across a yaml file hidden under .github.

It has the following:

      app_location: "/" # App source code path
      api_location: "" # Api source code path - optional
      output_location: "" # Built app content directory - optional

This doesn't really help, as its not obvious what an "app artifact" is, nor where it should go.

Any suggestions?

John Little
  • 10,707
  • 19
  • 86
  • 158

1 Answers1

4

The solution was to find the hidden yaml build file created by Azure, and add this line:

     skip_app_build: true

The build file was in .github/workflows/ and was called something like azure-static-web-apps-happy-banana-0ed8b4dxx.yml

Not sure why this settings is not in there by default - most static web sites are just static sites. As far as I know, you can't have php or other server side code in static web apps.

John Little
  • 10,707
  • 19
  • 86
  • 158
  • Just want to add that I tried using this today in Bitbucket Cloud and it requires the property "skip_app_build" to be a string and not a boolean. `skip_app_build: 'true'` – Ryan Cannon Feb 27 '23 at 21:22
  • That's interesting @RyanCannon I did *not* need single-quotes... (but otherwise the two answers by @JohnLittle and @Sneha helped me; I used `skip_app_build: true` (and `skip_api_build: true`) – Nate Anderson Apr 05 '23 at 23:34