'azure static web "Oryx built the app folder but was unable to determine the location of the app artifacts. Please specify the app artifact location"
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?
Solution 1:[1]
Thanks, Could you see if your app directory [app_location] is pointing to '/' -as this setting will typically be / or the location of the JavaScript and HTML for your project.
Please review and set the ‘app_location’ and ‘ output_location’ appropriately.
To elaborate on this: ‘api_location’ is the root location of your Azure Functions application hosted by Azure Static Web Apps, contains the source code of the application and the value is relative to the repository root in GitHub and the current working folder in Azure DevOps.
Please refer to this document for better information
Also, try setting the skip_app_build to true to skip building the front-end app.
Solution 2:[2]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | SnehaAgrawal-MSFT |
| Solution 2 | John Little |
