使用 Service Fabric CLI 將應用程式從 Service Fabric 叢集中移除

這個範例指令碼會刪除一個執行中的 Service Fabric 應用程式執行個體,並將叢集中的一個應用程式類型和版本取消註冊。 刪除應用程式執行個體也會刪除應用程式相關聯的所有執行中服務執行個體。 接下來,系統會從映像存放區刪除應用程式檔案。

如有需要,請安裝 Service Fabric SDK

範例指令碼

#!/bin/bash

# Select cluster
sfctl cluster select \
    --endpoint http://svcfab1.westus2.cloudapp.azure.com:19080

# Delete the application
sfctl application delete \
    --application-id svcfab_app \
    --timeout 500

# Unprovision the application type
sfctl application unprovision \
    --application-type-name svcfab_appType \
    --application-type-version 1.0.0 \
    --timeout 500

# Delete the application files from the image store
sfctl store delete \
    --content-path myappfolder

下一步

如需詳細資訊,請參閱 Service Fabric CLI 文件

您可以在 Service Fabric CLI 範例中找到適用於 Azure Service Fabric 的其他 Service Fabric CLI 範例。