共享 Streamlit in Snowflake 应用程序

This topic covers URLs for sharing Streamlit in Snowflake apps with or without the Snowsight interface.

应用程序 URLs

Each Streamlit in Snowflake app has two URLs: app-builder URLs that show the Snowsight elements and app-viewer URLs that hide them. This allows you to share view-only links with business users.

By default, sharing an app using the app-viewer URL lets end users change the URL to access other parts of Snowflake. To enforce restricted access to only app-viewer URLs, an administrator must configure the ALLOWED_INTERFACES user property. For more information, see 将用户的访问权限限制为仅访问 Streamlit in Snowflake.

管理员还可以配置应用程序查看器 URLs,以重定向到组织的身份提供商 (IdP)。有关更多信息,请参阅 基本安全设置

应用程序构建器 URLs

当您从应用程序构建器 URL 查看应用程序时时,对象工具栏会出现在应用程序的顶部。工具栏的左侧显示应用程序的名称。工具栏的右侧显示应用程序的状态。此外,如果您具有编辑应用程序所需的权限,则工具栏会包含 Edit 按钮。如果您具有与其他角色共享应用程序所需的权限,则工具栏会包含 Share 按钮。

如果您从 Snowsight 的 Streamlit Apps 页面中选择任何应用程序,系统会打开新选项卡,转到应用程序构建器 URL。URL 具有以下格式:

https://app.snowflake.cn/<organization_name>/<account_name>/#/streamlit-apps/<app_database>.<app_schema>.<app_name>

应用程序查看器 URLs

When you view an app from its app-viewer URL, the app is displayed without any part of the Snowsight interface. To enforce restricted access to only app-viewer URLs, an administrator must configure the ALLOWED_INTERFACES user property. For more information, see 将用户的访问权限限制为仅访问 Streamlit in Snowflake.

应用程序查看器 URL 具有以下格式:

https://app.snowflake.cn/streamlit/<organization_name>/<account_name>/#/apps/<url_id>

您的应用程序的 url_id 由 DESCRIBE STREAMLIT 返回.

共享 Streamlit 应用程序

Streamlit in Snowflake 应用程序有两个共享权限级别:

  • View and share:选择使用 时默认使用的角色和仓库。如果用户访问应用程序构建器 URL,他们可以查看应用程序并与其他角色共享。

  • View only:选择使用 时默认使用的角色和仓库。如果用户访问应用程序构建器 URL,他们只能查看应用程序。他们不能与其他角色共享。

所有对该应用具有必要 USAGE 权限的角色均可访问应用程序查看器 URL,与分享选项无关。

要共享 Streamlit 应用程序,请执行以下步骤:

  1. 登录 Snowsight

  2. 在导航菜单中,选择 Projects » Streamlit

  3. 选择要共享的 Streamlit 应用程序。

  4. 选择 Share

    此时 Share Streamlit app 窗口将打开。

  5. 要将角色添加到应用程序的共享列表,请开始键入角色的名称。

  6. 选择该角色的名称。

    新角色将显示在角色列表中。

  7. 在角色右侧的下拉列表中,选择共享权限级别。

  8. 要复制应用程序的 URL,请选择 Copy link

    • 要复制应用程序构建器 URL,请从下拉列表中选择 For app builders

    • 要复制应用程序查看器 URL,请从下拉列表中选择 For app viewers

    然后,可以通过电子邮件或短信发送此 URL。

  9. 选择 Done