Error while upgrading Azure Service Fabric through VSTS CI/CD - azure-devops

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

Related

Web Deployment runs with error, but does nothing

I'm running a CI pipeline on Azure DevOps. Part of the release pipeline is deploying a website to our web server (running IIS).
We changed hardware recently and did a fresh install of Windows. Of course I also installed the WebDeploy handlers and everything. But since then, the deployment runs without error, but it doesn't actually update any files. If I publish the website from VS2019, everything is fine.
How would I troubleshoot this?
I forgot to include the new server into the deployment group. Only noticed it when we finally turned off the old server and got the error message that the target was offline.

Application and service(s) deployment in Azure Service Fabric

I am not clear enough yet how Service Fabric allows deployment.
From the applications being created in a single VS solution, let me try to ask with file formats for better understanding.
In a single Visual Studio solution, there are
a single .sln
a single .sfproj
multiple .csproj(s)
As I see these files, multiple services (.csproj files) are bound to a single Service Fabric application (.sfproj file), which is under single solution file (.sln file).
Can I individually deploy a .csproj project to the Service Fabric cluster, or are these now bound to a .sfproj so that I have to deploy multiple services (each created with .csproj and bound to .sfproj) together?
The answer to your question is yes and no at the same time. Let me explain it in detail.
Can I individually deploy .csproj project to the Service Fabric cluster
The answer is no you can't deploy a service - in term of Service Fabric the minimal unit of deployment is the application (the .sfproj one). So no matter what changes you have you still need to deploy the application.
But as we all understand performing a full deployment of all application services is very hard, consumes lots of time and causes lots of disturbance to the cluster. To avoid this massive update, all Service Fabric components have their own versions (you can take a closer look at ServiceManifest.xml and ApplicationManifest.xml). So each time application is deployed to the cluster, Service Fabric goes through all services included in the application and updates only components that have been changed (i.e. have different version).
This approach allows you to perform updates of very high granularity i.e. you can update only <Config /> package of the single service.

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

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.

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.

Is there a service for deploying application/program binaries (releases)?

Normally my code is stored on Bitbucket and built using some CI service like codeship. During build process new file is created for example "myapp-v1.2.3.zip" or "myapp-v0.0.1.exe" etc. From this point packages are deployed to FTP or directly to server or to S3 - generally to a place from which user can download them.
My question is if there exists service to store such code releases (specially dedicated for this purpose) - for example with public dashboard with all versions of myapp listed and available to download etc? And maybe simple API to check latest version, dev versions, stable version etc.
Bintray is the software distribution service provided by JFrog, the makers of Artifactory.
https://bintray.com/