PowerShell을 사용하여 Service Fabric 클러스터에서 애플리케이션 제거

이 샘플 스크립트는 실행 중인 Service Fabric 애플리케이션 인스턴스를 삭제하고, 클러스터에서 애플리케이션 유형 및 버전의 등록을 취소합니다. 애플리케이션 인스턴스를 삭제하면 해당 애플리케이션과 연결된 실행 중인 모든 서비스 인스턴스도 삭제됩니다. 필요에 따라 매개 변수를 사용자 지정합니다.

필요한 경우 Service Fabric SDK를 사용하여 Service Fabric PowerShell 모듈을 설치합니다.

샘플 스크립트

# Variables
$endpoint = 'mysftestcluster.southcentralus.cloudapp.azure.com:19000'
$thumbprint = '2779F0BB9A969FB88E04915FFE7955D0389DA7AF'
$packagepath="C:\Users\sfuser\Documents\Visual Studio 2017\Projects\MyApplication\MyApplication\pkg\Release"

# Connect to the cluster using a client certificate.
Connect-ServiceFabricCluster -ConnectionEndpoint $endpoint `
          -KeepAliveIntervalInSec 10 `
          -X509Credential -ServerCertThumbprint $thumbprint `
          -FindType FindByThumbprint -FindValue $thumbprint `
          -StoreLocation CurrentUser -StoreName My

# Remove an application instance
Remove-ServiceFabricApplication -ApplicationName fabric:/MyApplication

# Unregister the application type
Unregister-ServiceFabricApplicationType -ApplicationTypeName MyApplicationType -ApplicationTypeVersion 1.0.0

스크립트 설명

이 스크립트는 다음 명령을 사용합니다. 테이블에 있는 각 명령은 명령에 해당하는 문서에 연결됩니다.

명령 주의
Remove-ServiceFabricApplication 클러스터에서 실행 중인 Service Fabric 애플리케이션 인스턴스를 제거합니다.
Unregister-ServiceFabricApplicationType 클러스터에서 Service Fabric 애플리케이션 유형 및 버전을 등록 취소합니다.

다음 단계

Service Fabric PowerShell 모듈에 대한 자세한 내용은 Azure PowerShell 설명서를 참조하세요.

Azure Service Fabric에 대한 추가 PowerShell 샘플은 Azure PowerShell 샘플에서 확인할 수 있습니다.