Update an application using the Service Fabric CLI
This sample script uploads a new version of an existing application, and then upgrades a deployed application with the new bits.
Important
There are two CLI utilities used to interact with Service Fabric. Azure CLI is used to manage Azure resources, such as an Azure-hosted Service Fabric cluster. Service Fabric CLI is used to directly connect to the Service Fabric cluster (regardless of where it's hosted) and manage the cluster, applications, and services.
Sample script
#!/bin/bash
# Select cluster
sfctl cluster select \
--endpoint http://svcfab1.chinanorth2.cloudapp.chinacloudapi.cn:19080
# Upload the latest bits of an application
sfctl application upload --path ~/app_package_dir_2
# Provision the new application
sfctl application provision --application-type-build-path app_package_dir_2
# Upgrade an existing up with the new version
sfctl application upgrade --app-id TestApp --app-version 2.0.0 --parameters "{\"test\":\"value\"}" --mode Monitored
Next steps
For more information, see the Service Fabric CLI documentation.
Additional Service Fabric CLI samples for Azure Service Fabric can be found in the Service Fabric CLI samples.