Azure App Service zip deploy does not unpack app files in ~/site/wwwroot

Luis Naranjo 0 Reputation points
2023-02-04T01:01:11.7533333+00:00

I have an Azure App Service that I am deploying to seemingly without a problem, but the actual artifacts I see via SSH are missing.

Here is what I am doing

  • Prepare zip archive with all source and node_modules. Have triple checked this is correct
  • Deploy zip to app service. Have tried doing this with az CLI and also via a Github actions pipeline
  • Can confirm deployment succeeds according to the logs. In deployment center, I can see the deployment logs passing. In my archive, I have a .deployment with a command that runs a bash script of mine which echo's some output. I can see that output and the bash script completing correctly. Good!

Here is what I would expect

  • The contents of my zip archive should be in ~/site/wwwroot after a succesfull zip deployment

Instead, this is what I see in an SSH session via SCM

  • ~/site/wwwroot exists but is empty
  • I do see the contents of my zip archive in /tmp/zipdeploy/extracted. Additionally, I can see that the command in my .deployment file was executed because the symlinks are created in there as expected (wouldn't have worked if symlinks were zipped because of ftp limitations)

I am at my wits end - have been debugging this for weeks. I'm pretty close to giving up on App Service and running my code in a VM or going to a managed service in another cloud hosting provider.

Can anyone here help?

I do not have run zip enabled. Below are the configuration settings I have set

{
  "deployment_branch": "master",
  "SCM_TRACE_LEVEL": "Verbose",
  "SCM_COMMAND_IDLE_TIMEOUT": "60",
  "SCM_LOGSTREAM_TIMEOUT": "7200",
  "SCM_BUILD_ARGS": "",
  "WEBSITE_AUTH_LOGOUT_PATH": "/.auth/logout",
  "WEBSITE_AUTH_ENABLED": "False",
  "WEBSITE_RUN_FROM_PACKAGE": "0",
  "SCM_USE_LIBGIT2SHARP_REPOSITORY": "0",
  "ScmType": "None",
  "FUNCTIONS_RUNTIME_SCALE_MONITORING_ENABLED": "0",
  "APPLICATIONINSIGHTS_CONNECTION_STRING": "InstrumentationKey=<redacted>",
  "SCM_DO_BUILD_DURING_DEPLOYMENT": "true",
  "WEBSITE_AUTH_AUTO_AAD": "False",
  "REMOTEDEBUGGINGVERSION": "16.0.32106.67",
  "WEBSITE_WEBDEPLOY_USE_SCM": "true",
  "WEBSITE_HTTPLOGGING_RETENTION_DAYS": "3",
  "XDT_MicrosoftApplicationInsights_Mode": "default",
  "WEBSITE_SITE_NAME": "<redacted>",
  "ApplicationInsightsAgent_EXTENSION_VERSION": "~3"
}
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,852 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 25,486 Reputation points Microsoft Employee
    2023-02-09T17:29:29.6866667+00:00

    Hi @Luis Naranjo

    I couldn't reproduce the issue you're seeing. I quickly stood up a dotnet app and deployed via the CLI with az webapp deploy on both windows and Linux with SCM_DO_BUILD_DURING_DEPLOYMENT set to true, which is the main setting that instructs the platform to extract your zip contents to D:\home\site\wwwroot (/home/site/wwwroot on linux).

    I verified the contents by navigating to https://<myappservice>.scm.azurewebsites.net/api/vfs/site/wwwroot/ and could see the contents of my zip file were indeed extracted. Now I used this method because an SSH connection wasn't established due to my application failing to start as a result of not properly configure it; i.e. the app failed to start. I simply was trying to repro your issue and isn't consider a factor.

    If you navigate to that kudu URL, do you still not see the contents of your app? Which CLI command did you use?

    0 comments No comments