我正在尝试将Django Web应用程序部署到Azure应用程序服务。 我已经为项目设置了Github仓库的持续部署。
该项目在当地很有吸引力。 部署失败,并显示以下日志:
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
我在项目根级别包含了以下部署文件:
.deployment,
deploy.cmd,
ptvs_virtualenv_proxy.py,
requiremnts.txt,
web.2.7.config
我尝试从本地git仓库部署项目。返回了以下日志:
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
这是因为部署没有找到deploy.cmd文件吗? 或部署文件是否配置不当?
有关如何解决此问题的任何指示。
答案 0 :(得分:0)
根据你的描述&错误信息,根据我的经验,我认为这个问题可能是由于requirements.txt
中某些必需的python包引起的,这些包在Azure App Service上没有直接支持,原因如下。
在Azure上运行时,某些程序包可能无法使用pip进行安装。可能只是Python包索引上没有包。可能需要编译器(在Azure App Service中运行Web应用程序的计算机上没有编译器。)
请参阅有关Troubleshooting - Package Installation的详细信息,了解如何手动解决此问题。
与此同时,我发现了你的另一个问题。 web.2.7.config
文件是Python 2.7的web.config
模板文件。如果您的项目未包含web.config
文件,请复制web.2.7.config
并重命名web.config
,然后按照上述同一文档中的Web.config
部分进行检查&配置部署以使其工作。
答案 1 :(得分:0)