Hi crxwn,
Even though the GitHub Action uploads the build output, Azure App Service won’t
serve the Vite static
files unless they’re correctly placed and the server is configured
. Make sure the build output is in a directory the Python app can serve (/static
) and the static files are referenced in the app’s routes (like for /index.html
). If not, Azure may serve outdated content.
- Make sure the
Vite build
output goes to thestatic/
folder. Update yourvite.config.js
to match the build output path with your Python backend’s static folder.
export default {
build: {
outDir: 'static', // or 'wwwroot' depending on your server
}
}
- Make sure your Python server serves
static/
as the root. if you're using Flask:
from flask import Flask, send_from_directory
app = Flask(__name__, static_folder='static')
@app.route('/')
def serve():
return send_from_directory(app.static_folder, 'index.html')
- Update GitHub Actions to build and deploy the correct static output folder.
- name: Build
run: npm run build
- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v3
with:
app-name: 'TreeTopMate'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ./static # Make sure this is the Vite build output
After these changes, rebuild your site with npm run build
, push to main to trigger the GitHub Action, and the new static/ content will be deployed. Clear your browser cache or use incognito mode to check the updated site and use az webapp browse
or curl https://treetopmate.azurewebsites.net
to confirm the fresh deploy.
Troubleshooting Azure Static Web Apps | Microsoft Learn
Please accept as "Yes" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.
Let me know if you have any further Queries.