Is it possible to deploy only Application Parameters (cloud.xml) in Service Fabric without having to change the Application version? - powershell

Is there a possibility to deploy only Application Parameters (cloud.xml) somehow without having to redeploy the code or upgrade the application version? For example after deploying the Application on Service fabric cluster, there could be a minor thing I might need to change in one of the parameters in cloud.xml. And it won't make sense to upgrade the version of the Application for this minor change.
I have combed through various sites but did not find anything suitable.

I'd say - no, you can't do this. Here is what Service Fabric application upgrade says on this -
During an upgrade, Service Fabric compares the new application manifest with the previous version and determines which services in the application require updates. Service Fabric compares the version numbers in the service manifests with the version numbers in the previous version. If a service has not changed, that service is not upgraded.

Related

Azure Service Fabric - install previous version of application from Service Fabric Explorer?

I'm trying to determine if it's possible to install a previous version of a Service Fabric application using the online Service Fabric Explorer as opposed to having to use a PowerShell script? In our case, the previous version of the application exists in the cluster and is visible in the list of application versions in the Explorer.
I appreciate any input.
This topic has been raised a few times around SO, short answer is no.
This answer give more details: Service fabric rollback to previous version from visual stuido or service fabric explorer

Error while upgrading Azure Service Fabric through VSTS CI/CD

I am using VSTS to setup CI/CD for service fabric build and deployment. First deploy goes through without error but second update deployment gives me below error.
The content in ConfigPackage Name:Config and Version:1.0.0.20180312.1
in Service Manifest 'SampleWebPkg' has changed, but the version number
is the same.
I followed the below instruction
https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-tutorial-deploy-app-with-cicd-vsts
This happens because you have updated the service binaries and didn't update the manifests, the manifest points to the same version as before but the binaries are different.
An example how this might occur is when you rebuild your service and
deploy a new version without changing the version numbers in the
manifest files
Check:
If the service version in the servicesmanifest.xml has been updated compared to previous one, if not, upgrade it.
The service version in applicationmanifest.xml has been updated compared to previous one

Deploy Service Fabric services individually

From the documentation and examples I've seen it seems that the preferred way to deploy Service Fabric services is to package them all up into an application package.
If I have 30 services and I make a change to one of them I'm not interested in having my CI server pull down the entire repository, build the solution, package it and then have Service Fabric decide that only one service changed and so only one should be updated.
Is there a way to create an application package with just one service?
You want to perform a partial upgrade (Differential Packaging). See here. Differential packaging

Redeploy Service Fabric application without version change

I've read about partial upgrade, but it always requires to change some parts of the packages application. I'd like to know if there's a way to redeploy a package without version change. In a way, similar to what VS is doing when deploying to the dev cluster.
On your local dev cluster, VS simply deletes the application before it starts the re-deployment. You could do the same in your production cluster, however this results in downtime since the application is not accessible during that time.
What's the reason why you wouldn't want to use the regular monitored upgrade? It has many advantages, like automatic rollbacks and so on.

Manual rollback of an application / service

I have a Service Fabric application with a few services underneath it. They are all currently sitting at version 1.0.0.
I deploy an update out to the cluster for version 2.0.0. Everything is running fine and the deployment succeeds. I notice a very large but in the version. Is there a way to manually rollback to version 1.0.0? The only thing I have found is automatic rollback during an upgrade.
Matt's answer is correct, but I'll elaborate a bit on it here.
The key is in understanding the different steps during application deployment:
Copy
Register
Create
Upgrade
Visual Studio rolls these up into single "publish" and "upgrade" operations to make it easy and convenient. But these are actually individual commands in the Service Fabric management API (through PowerShell, C# or HTTP). Let's take a quick look at what these steps are:
Copy:
This just takes your compiled application package and copies it up to the cluster. No big deal.
Register:
This is the important step in your case. Register basically tells the cluster that it can now create instances of your application. Most importantly, you can register multiple versions of the same application. At this point, your applications aren't running yet.
Create:
This is where instances of your registered applications are created and start running.
Before we get to upgrade, let's look at what's on your cluster. The first time you go through this deployment process with version 1.0.0 of your application (call it FooType), you'll have just that one type registered:
FooType 1.0.0
Now you're ready to upgrade. You first copy your new application package with a new version (2.0.0) up to the cluster. Then, you register the new version of your application. Now you have two versions of that type registered:
FooType 1.0.0
FooType 2.0.0
Then when you run the upgrade command, Service Fabric takes your instance of 1.0.0 and upgrades it to 2.0.0. If you need to roll it back once the upgrade is complete, you simply use the same upgrade command to "upgrade" the application instance from 2.0.0 back to 1.0.0. You can do this because 1.0.0 is still registered in the cluster. Note that the version numbers are in fact not meaningful to Service Fabric other than that they are different strings. I can use "orange" and "banana" as my version strings if I want.
So the key here is that when you do a "publish" from Visual Studio to upgrade your application, it's doing all of these steps: it's copying, registering, and upgrading. In your case, you don't actually want to re-register 1.0.0 because it's already registered on the cluster. You just want to issue the upgrade command again.
For an even longer explanation, see: Blue/Green Deployments with Azure ServiceFabric
Just follow the same upgrade procedure, but targeting your 1.0.0 version instead. "Rollback" is just an "upgrade" to your older version.