此脚本示例将连接到 Service Fabric 群集并列出所有预配的应用程序。
重要
可以使用两个 CLI 实用工具来与 Service Fabric 交互。 Azure CLI 用于管理 Azure 资源,例如 Azure 托管的 Service Fabric 群集。 Service Fabric CLI 用于直接连接到 Service Fabric 群集(不管托管在哪个位置)和管理群集、应用程序与服务。
#!/bin/bash
# Select cluster
sfctl cluster select \
--endpoint http://svcfab1.chinanorth2.cloudapp.chinacloudapi.cn:19080
# Retrieve all applications from the cluster
sfctl application list
有关详细信息,请参阅 Service Fabric CLI 文档。
在 Service Fabric CLI 示例中可找到 Azure Service Fabric 的其他 Service Fabric CLI 示例。