简体   繁体   中英

Azure Django deployment failure

I am trying to deploy a Django web app to Azure app service. I have set up the continuous deployment with a Github repo for the project.

The project is functuioning locally. The deployment is failing with the following logs:

Command: deploy.cmd
Handling python deployment.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'web.2.7.config'
Detected requirements.txt.
Creating  virtual environment.
The system cannot find the path specified.
An error has occurred during web site deployment.
The system cannot find the path specified.
The system cannot find the path specified.\r\nThe system cannot find the path specified.\r\nD:\Program Files(x86)\SiteExtensions\Kudu\61.60316.2745\bin\Scripts\starter.cmd deploy.cmd

I have included the following deployment files at the project root level:

.deployment, 
deploy.cmd, 
ptvs_virtualenv_proxy.py, 
requiremnts.txt, 
web.2.7.config

I tried deploying the project from a local git repo. Which returned the following logs:

git push azure
Counting objects: 198, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (118/118), done.
Writing objects: 100% (198/198), 47.36 KiB | 0 bytes/s, done.
Total 198 (delta 94), reused 120 (delta 65)
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id 'a68e71809f'.
remote: Running custom deployment command...
remote: Running deployment command...
remote: Handling python deployment.
remote: KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
remote: Copying file: '.gitignore'
remote: Copying file: 'db.sqlite3'
remote: Copying file: 'manage.py'
remote: Copying file: 'ptvs_virtualenv_proxy.py'
remote: Copying file: 'requirements.txt'
remote: Copying file: 'web.2.7.config'
remote: Copying file: 'accounts\admin.py'
remote: Copying file: 'accounts\apps.py'
remote: Copying file: 'accounts\backends.py'
remote: Copying file: 'accounts\forms.py'
remote: Copying file: 'accounts\models.py'
remote: Copying file: 'accounts\tests.py'
remote: Copying file: 'accounts\views.py'
remote: Copying file: 'accounts\__init__.py'
remote: Copying file: 'accounts\migrations\0001_initial.py'
remote: Copying file: 'accounts\migrations\__init__.py'
remote: Copying file: 'isi_django\settings.py'
remote: Copying file: 'isi_django\urls.py'
remote: Copying file: 'isi_django\wsgi.py'
remote: Copying file: 'isi_django\__init__.py'
remote: Copying file: 'isi_hours\admin.py'
remote: The system cannot find the path specified.
remote: Copying file: 'isi_hours\apps.py'
remote: The system cannot find the path specified.
remote: Copying file: 'isi_hours\forms.py'
remote: Copying file: 'isi_hours\models.py'
remote: Copying file: 'isi_hours\tests.py'
remote: Copying file: 'isi_hours\views.py'
remote: Copying file: 'isi_hours\__init__.py'
remote: Copying file: 'isi_hours\migrations\__init__.py'
remote: Copying file: 'static\css\home.css'
remote: Copying file: 'templates\base.html'
remote: Copying file: 'templates\datepicker.html'
remote: Copying file: 'templates\employee.html'
remote: Copying file: 'templates\empreport.html'
remote: Copying file: 'templates\home.html'
remote: Copying file: 'templates\index.html'
remote: Copying file: 'templates\login.html'
remote: Copying file: 'templates\logout.html'
remote: Copying file: 'templates\project.html'
remote: Copying file: 'templates\projreport.html'
remote: Copying file: 'templates\register.html'
remote: Detected requirements.txt.
remote: Creating  virtual environment.
remote: An error has occurred during web site deployment.
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://isireporting.scm.azurewebsites.net:443/isireporting.git
 * [new branch]      master -> master

Is this resulting from the deployment not finding the deploy.cmd file? Or are the deployment files imporperly configured?

Any pointers on how to go about solving this issue.

According to your description & error information, per my experience, I think this issue might be caused by some required python packages in the requirements.txt which not be directly supported on Azure App Service, that the reason as below.

Some packages may not install using pip when run on Azure. It may simply be that the package is not available on the Python Package Index. It could be that a compiler is required (a compiler is not available on the machine running the web app in Azure App Service).

Please see the details about Troubleshooting - Package Installation to know how to resolve it manually.

Meanwhile, I discovered another possible issue of yours. The web.2.7.config file is a web.config template file for Python 2.7. If your project didn't include the web.config file, please copy web.2.7.config and rename web.config , then follow the section Web.config of the same document above to check & configure the deployment to make it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM