How to deploy django web application on Microsoft Azure cloud services How to deploy django web application on Microsoft Azure cloud services django django

How to deploy django web application on Microsoft Azure cloud services


It sounds like you want to know which way is the best choice for deploying a django app via Git for code management on Linux, using Cloud Services or App Services on Azure.

Per my experience, I think deploying a pure web app into App Service on Azure via Git on Linux is the simplest way for you. You can refer to the offical docuemnts below to know how to do it via Azure CLI or only Git.

  1. Deploy your first Python web app to Azure in five minutes
  2. Local Git Deployment to Azure App Service

And there is a code sample of Django on App Service as reference that you can know how to configure it for running on Azure.

However, if your app need more powerful features & performance, using Cloud Services for your django app is also a better way than using VM directly. Also as references, please view the document Python web and worker roles with Python Tools for Visual Studio to know how to let Azure support Python & Django on Cloud Services, and you can create & deploy it via Azure portal in the browser on Linux. Meanwhile, thanks for the third party GitHub sample of Django WebRole for Cloud Service which you can refer to know how to create a cloud service project structure without PTVS for VS on Linux.

Hope it helps.


I read this post, decided the how-to guides Peter Pan posted looked good, and set off on my own. With my one business day's worth of experience if you are looking to deploy your app to Azure, start with the Marketplace Django app and go from there. Reason being the virtual environment comes with it along with the activate script needed to run the virtual environment and the web.config is setup for you. If you follow the start from scratch how-to guides, these are the hardest parts to setup correctly. Once you create the app service from the template, do a git clone of the repo to your local machine. Make a small change and push it back up by running the command below in bash.

az webapp deployment source config-local-git --name <app name> --resource-group <group name> --query url --output tsv

Use the result of the command to add the git repo as a remote source.

git remote add azure https://<ftp_credential>@<app_name>.scm.azurewebsites.net/<app_name>.git

Finally, commit your changes and deploy

git add -Agit commit -m "Test change"git push azure remote

A couple of side notes

If you do not have your bash environment setup, you'll need to do so to use the az commands. The marketplace app does run error-free locally. I have not dug into this yet.

Good luck!