I’m working to migrate a serverless resume website from Azure Blob Storage to Azure Static Web Apps. The website uses an Azure Function (HTTP trigger) to increment a visitor count in Azure Cosmos DB. While this functionality worked before, the count no longer updates after deployment to Static Web Apps.
Key Points:
Stopped Working After Deployment: The visitor count functionality worked when hosted on Azure Blob Storage.
Static Web Apps Limitation: I understand Azure Blob Storage doesn’t support server-side scripting, which is likely the issue.
Project Structure: Resume website with Azure Function and Cosmos DB.
Frontend: I’m not sure if my frontend files (index.html, layout.css, frontend.main.yml) are relevant to the migration issue.
I also have a previous post which was giving me issue and if you want to check that out its linked below with my Github.
GitHub Link: LINK
Previous StackOverflow Issue: LINK
Troubleshooting Attempts:
Cosmos DB Connection: Verified that the Cosmos DB connection string is correct and accessible within my Azure Static Web App configuration.
Deployment Review: Ensured my deployment process (Visual Studio Code, GitHub Actions, etc.) transfers all necessary function files to Static Web Apps.
Expectation:
I expected the Azure Function to continue updating the Cosmos DB visitor count seamlessly after migrating to Azure Static Web Apps.
But none of this worked even tho build were successful and evyerhting was getting uploaded and built.