I took the weekend off for 4th of July. Fireworks are cool. Today I was back to work creating a React application and hosting it with Azure static web apps. But I ran into some fireworks... After setting up the GitHub repository and adding the project, I set up the resources, connected the Static Web App to my GitHub repository and setup the GitHub actions workflow to make an automated deployment pipeline. This means that all I need to do to update my application is push the code from my local machine to my repository and the automated build and deploy process takes care of the rest. Right? The automated build failed. Upon closer inspection the error message initially led me to think that there was something wrong with the npm installation but after some googling and trial and error I eventually figured out that in the .yml configuration file for the GitHub workflow, I had set the app_location property to "/" instead of "ClientApp" which is where the react files are located in my project. Because the system was looking in the wrong folder for the files it didn't run the npm install. Once it was set correctly it worked like it should. I enjoy troubleshooting these kinds of problems and look forward to documenting more of my adventures with Azure. Thanks for reading! Here are some basic resources to get started with Azure Static Web Apps:
Azure Static Web Apps documentation | Microsoft Docs Quickstart: Building your first static site with the Azure Static Web Apps | Microsoft Docs
0 Comments
Your comment will be posted after it is approved.
Leave a Reply. |
AuthorWalker Crystal Archives
December 2022
Categories |