microsoft / azurechat

🤖 💼 Azure Chat Solution Accelerator powered by Azure Open AI Service
MIT License
1.24k stars 1.21k forks source link

Deploying to App Service from local VS Code - Application Error when browsing site #215

Closed jupiter19914 closed 1 year ago

jupiter19914 commented 1 year ago

I am trying to deploy the application to the App Service as some customers are not able to access github or deploy from azd. I followed the run locally steps and ran npm run build, then deploy to my app service. The deployment succeeds however when browsing to website I get the following attached errors Screenshot 2023-10-12 124532

"ERROR - Container xxxxxxxxx for site ....... has exited, failing to start.

thivy commented 1 year ago

@jupiter19914 how are you deploying the application to App service?

Also are you able to check what is deployed by navigating to this link https://YOUR_WEBSITE_NAME.scm.azurewebsites.net/wwwroot/

jupiter19914 commented 1 year ago

@thivy I deployed using a zip file. I included everything in SRC including .next folder contents.

az webapp deployment source config-zip -g "rg-name" -n "app-svc-name" --src filename.zip

I am able to see what was deployed. I did notice looking at deployment logs a failure part way through (kudu failure)

An error has occurred during web site deployment. /home/site/deployments/tools/deploy.sh: line 82: 20053 Killed "$KUDU_SYNC_CMD" -v 50 $IGNORE_MANIFEST_PARAM -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh"\n/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"

thivy commented 1 year ago

@jupiter19914 could you please try adding this to the App Service settings? SCM_DO_BUILD_DURING_DEPLOYMENT=false

jupiter19914 commented 1 year ago

@thivy the SCM_DO_BUILD_DURING_DEPLOYMENT was set to false. I created a new deployment (infra) and a new app zip deployment and deployed with SCM set to false. I compared the wwwroot with another deployment I did using GH Actions and noticed some differences. So I re-deployed the zip file setting SCM to true and that fixed my issue. This is good as I have now deployed using AZD, GH Actions and manually with zip file. This may help for those with more secure environments, however they still need to be able to npm build locally. Thanks for all your help!