Bereitstellen einer Anwendung in einem Service Fabric-Cluster mithilfe der Service Fabric-CLI

Dieses Beispielskript kopiert ein Anwendungspaket in einen Clusterimagespeicher, registriert den Anwendungstyp im Cluster und erstellt eine Anwendungsinstanz aus dem Anwendungstyp. Alle Standarddienste werden ebenfalls zu diesem Zeitpunkt erstellt.

Installieren Sie ggf. die Service Fabric-CLI.

Beispielskript

#!/bin/bash

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

# Upload the application files to the image store
# (note the last folder name, Debug in this example)
sfctl application upload \
    --path  C:\Code\svcfab-vs\svcfab-vs\pkg\Debug \
    --show-progress

# Register the application (manifest files) from the image store
# (Note the last folder from the previous command is used: Debug)
sfctl application provision \
    --application-type-build-path Debug \
    --timeout 500

# Create an instance of the registered application and 
# auto deploy any defined services
sfctl application create \
    --app-name fabric:/MyApp \
    --app-type MyAppType \
    --app-version 1.0.0
    

Bereinigen der Bereitstellung

Nach Abschluss kann die Anwendung mit dem Entfernungsskript entfernt werden. Das Entfernungsskript löscht die Anwendungsinstanz, hebt die Registrierung des Anwendungstyps auf und löscht das Anwendungspaket aus dem Imagespeicher.

Nächste Schritte

Weitere Informationen finden Sie in der Dokumentation der Service Fabric-Befehlszeilenschnittstelle.

Zusätzliche Service Fabric-CLI-Beispiele für Azure Service Fabric finden Sie unter Azure PowerShell-Beispiele.