Oryx icon indicating copy to clipboard operation
Oryx copied to clipboard

staticwebapp.config.json file not being copied to Azure after build

Open StephenWBertrand opened this issue 3 years ago • 2 comments

Bug Report

  • At what date and time did you most recently experience the problem? April-8-2022 4pm EST

  • Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use. Azure Static Web Apps, deployed from both github actions and Azure DevOps

  • What happened? When deploying my project, it appears the step to copy the staticwebapp.config.json file to build output is being omitted. No error message is given. The log entry Copying 'staticwebapp.config.json' to build output is just missing.

  • What did you expect or want to happen? I expect to see a line in the log saying Copying 'staticwebapp.config.json' to build output

  • How can we reproduce it? I havent yet determine what is causing it. I've started with a basic project (https://github.com/staticwebdev/blazor-basic) and that works. I've renamed the folders structure similar to my larger project and still works. But once getting all project copied over it stops working.

  • Do you have log output? Please include between the backticks:

This is snippet from basic working project showing the 'copying' log line

---End of Oryx build logs---
Finished building app with Oryx
Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
Copying 'staticwebapp.config.json' to build output
Either no Api directory was specified, or the specified directory was not found. Azure Functions will not be created.

Here is snippet from my larger project where the line is omitted

---End of Oryx build logs---
Finished building app with Oryx
Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
Starting to build function app with Oryx
---Oryx build logs---

The project builds fine, deploys to Azure, and runs fine, except that the config doesn't seem to copy over to Azure, so any rules and such are not applied by Azure.

Is there any scenario that would that step to be omitted??

StephenWBertrand avatar Apr 08 '22 20:04 StephenWBertrand

Issue identified.

After much step by step... I found that the staticwebapp.config.json file actually appeared twice in my repo. For some reason I had a copy down in the wwwroot folder as well as the root. argh.

I guess the process was getting confused by the two files or just using the deeper version under wwwroot but not reporting it back in the log. It would have been nice if the logs would have indicated an error or something. I suppose the fact that no copying message was displayed actually did help me determine why Azure was not responding as expected.

I would still ask that some additional error logging be added to cover this scenario if possible. Thanks.

StephenWBertrand avatar Apr 08 '22 21:04 StephenWBertrand

@StephenWBertrand -- Hey there, sorry for the delayed response; in order to ensure that the necessary logging additions are assigned to the correct team (Oryx vs. Static Web Apps), if you're able to reproduce the above issue, would you be able to send the full set of logs that are returned when running the Static Web Apps build against your Blazor app in either Azure DevOps or GitHub Actions?

cormacpayne avatar Apr 14 '22 22:04 cormacpayne

This issue seems resolved. Will be closing this issue. If this is still relevant and impacting you please open a new issue and link back to this issue for reference.

simonjj avatar Jan 11 '24 17:01 simonjj