在子目录下部署应用程序 - Azure

时间:2018-01-09 22:12:24

标签: azure

我在github存储库的子文件夹中有一个微服务应用程序。我正在尝试将其部署到Azure。

我发现如果我在根目录中添加.deployment文件,Azure将自动部署在给定路径下找到的应用程序。 Here

我尝试了以下内容,

[config]
project = myFlaskProject/helloFlask

Azure成功构建项目,但它仍然给了我You do not have permission to view this directory or page.不确定为什么,任何想法?

P.S。如果我将所有应用程序文件保存在我的根目录中,它可以正常工作。

这是我制作的演示测试存储库。 Hello World Flash Repo

以下是该网站的live demo

以下是Azure的构建日志,

Using the following command to generate deployment script: 'azure site deploymentscript -y --no-dot-deployment -r "D:\home\site\repository" -o "D:\home\site\deployments\tools" --python --sitePath "D:\home\site\repository\flask\helloWorld"'.
The site directory path: .\flask\helloWorld
Generating deployment script for python Web Site
Generated deployment script files

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling python deployment.
KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
Copying file: 'requirements.txt'
Copying file: 'web.2.7.config'
Copying file: 'web.3.4.config'
Copying file: 'flask\helloWorld\.gitignore'
Copying file: 'flask\helloWorld\index.html'
Copying file: 'flask\helloWorld\LICENSE'
Copying file: 'flask\helloWorld\main.py'
Copying file: 'flask\helloWorld\ptvs_virtualenv_proxy.py'
Copying file: 'flask\helloWorld\README.md'
Copying file: 'flask\helloWorld\requirements.txt'
Copying file: 'flask\helloWorld\web.2.7.config'
Copying file: 'flask\helloWorld\web.3.4.config'
Detected requirements.txt.  You can skip Python specific steps with a .skipPythonDeployment file.
Detecting Python runtime from site configuration
Detected python-2.7
Found compatible virtual environment.
Pip install requirements.
Requirement already satisfied (use --upgrade to upgrade): Flask==0.12.1 in d:\home\site\wwwroot\env\lib\site-packages (from -r requirements.txt (line 1))
Cleaning up...
Overwriting web.config with web.2.7.config
        1 file(s) copied.
Finished successfully.

1 个答案:

答案 0 :(得分:2)

Azure的python部署中存在一个错误。但是有一个工作要解决它。 Read my issue here