azure - 在不使用 Docker 的情况下在 Azure 中部署 Streamlit 应用程序

标签 azure deployment streamlit

有没有办法在不使用 Docker 的情况下在 Azure 应用服务上部署 Streamlit 应用程序? 互联网上的所有指南都提到 Docker 虚拟化,而理论上,Azure Web App 应该能够从 Azure Repo 自动部署代码。我在 Azure 配置选项卡中使用“streamlit run app.py”作为启动命令,但什么也没发生。

最佳答案

您可以通过设置普通的 Steamlit 应用程序并添加应用程序服务特定配置来实现此目的。具体步骤如下:

  1. 创建定价层 B1 或更高的 Azure 应用服务。免费版本(F1)不支持Streamlit所需的websocket。

  2. 为项目创建一个文件夹。并添加 requirements.txt 并包含以下内容。

    流线型

  3. 将此文件夹部署到 Azure 应用服务。

  4. 进行以下配置更改。在配置>常规设置>启动命令下提供以下值

    python -m Streamlit hello --server.port 8000 --server.address 0.0.0.0

  5. 在 Azure 应用服务配置中启用 Web Sockets。

Azure only allows pip binaries to run when used as modules instead of directly. We are mentioning port beacuse by default the service listens to port 8000. We are mentioning the server.address as 0.0.0.0 so that the it can serve all the incoming request from azure infra.

enter image description here

关于azure - 在不使用 Docker 的情况下在 Azure 中部署 Streamlit 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72442371/

相关文章:

deployment - 使用 cargo 和无效的 SSL 证书进行部署

debugging - 如何从 IDE 运行/调试流式应用程序

Azure api 管理克隆 API

c# - Quartz.Net 调度程序在 Azure 中不工作

git - 将批处理文件部署到引导 Windows EC2 实例时出现问题

git - 单文件git部署到服务器

azure - 从流分析中的 json 对象中删除别名

azure - 在 Azure 网站上的 DotNetNuke 中部署扩展时出现问题

Streamlit 按钮只能使用一次

Python Streamlit - 在不重新运行整个脚本的情况下过滤 Pandas 数据框