Search code examples
typescriptnpmdeploymentazure-web-app-servicebotframework

During deployment: 500 - The request timed out when installing dependencies


I'm trying to deploy my bot to Azure. So I ran the following command:

az bot publish --name --proj-name "" --resource-group --code-dir "/path/to/my-app" --verbose --version v4

But it times out (I removed my project name and username for security reasons):

Configured default '' for arg resource_group_name

Detected SDK version v4. Running prepare publish in code directory

/Users//Documents/GitHub// and for project file

Preparing Bot Builder SDK v4 bot for publish, with code directory

/Users//Documents/GitHub// and project file .

Detected bot language Node, Bot Builder version v4.

Creating upload zip file.

Creating upload zip file, code directory

/Users//Documents/GitHub//.

Adding node_modules to folders to exclude from zip file.

Compressing bot source into /Users//Documents/GitHub//upload.zip.

Zip file path created, at /Users//Documents/GitHub//upload.zip.

Emptying the "site/wwwroot/" folder on Kudu in preparation for publishing.

"site/wwwroot/" successfully emptied.

Source code read, uploading to Kudu.

Source code successfully uploaded.

Retrieving the latest deployment info.

Bot source published. Preparing bot application to run the new source.

Detected language javascript. Installing node dependencies in remote bot.

Then here's the error:

Failed with status code 500 and reason 500 - The request timed out.

500 - The request timed out.

The web server failed to respond within the specified time.
"dependencies": {
    "botbuilder": "^4.2.0",
    "botbuilder-ai": "^4.2.0",
    "botframework-config": "^4.2.0",
    "dotenv": "^6.1.0",
    "flex-menu": "git+https://[email protected]/yousef-shanawany-flex/flex-menu/_git/flex-menu",
    "replace": "^1.0.0",
    "restify": "^7.2.3"
},
"devDependencies": {
    "@types/dotenv": "6.1.0",
    "@types/restify": "7.2.6",
    "nodemon": "^1.18.7",
    "tslint": "^5.11.0",
    "typescript": "^3.1.6"
}

Solution

  • Yeah so this is a known issue with the az bot publish command right now. Unfortunately it performs some proprietary deployment steps which make it behave differently from a typical web application deployment on Azure. Specifically, at the point when you're getting the error, it's executing the npm install command via Kudu and it's just taking too long for that command to finish and, therefore, it times out causing the 500 error. The team is aware of this and will be working to improve the experience.

    My recommendation, for now, would be to set up and use the local git deploy method. That is the simplest approach that requires no other services to get going. If your project is already up in a remote git repo in Azure DevOps/GitHub/GitLab/BitBucket/etc, you might want to consider using the Continuous Deployment support for those instead which will light up CD for all the contributors on your team. Either of these approaches will trigger the "standard" Kudu deployment process for web applications which you can read all about here if you ever needed to further customize.