0
votes

Is there a way to copy only modified files to Service Fabric. I have a Service Fabric application containing an ASP. Net 5 application as service. Whenever am doing a change to a JavaScript file inside my ASP. Net 5 service, every time I need to copy the entire service fabric application package. Is there a command which allows to copy only the modified file?

3
Possible duplicate of Differential packagingPanagiotis Kanavos
Copy where? To which of the cluster's machines? How will the rest get updated? The point of having a fabric is that an application can be deployed/upgraded/recalled automatically, just by copying the package. You can deploy just the differences with a differential package. Same goes for containersPanagiotis Kanavos
Thank you for the quick response. I was wondering whether there is an option to just copy the modified file inside code folder of a service alone.DevMJ
You misunderstand what Service Fabric is. It's not the managed alternative to IIS, it's the managed alternative eg to Docker. Which code folder would you deploy to? On Machine A, B or F in the cluster? How would you copy the changes to the rest of the machines? What you describe can't be done even in web farms - if you directly modify the files on one server, some of your users will get the old behaviour and some the newPanagiotis Kanavos

3 Answers

5
votes

The best way to accomplish this is to use diff packaging and app upgrade. See this link for more info: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-application-upgrade-advanced/. Diff packaging allows you to define an application package that only contains the package parts that you wish to upgrade. However, it only applies to a component of an application package, such as a Service or Code package for example. You can't create a diff package at the file level. So if you've only changed a single file in your code package, you must include that file along with every other file that belongs to the code package. You can't just include the single file that changed. But the benefit of diff packaging is that you'd only need to include that single code package. You wouldn't need to provide other Service's code packages, for example, assuming they haven't been changed.

0
votes

Service Fabric SDK 2.5 brings in a preview feature called "Refresh Application". Using this feature you can get quicker feedback of your code changes.

To enable that, set the following from project properties Application Debug mode = Refresh Application.

More details and limitations can be found here: https://sharepointforum.org/threads/speed-up-service-fabric-development-with-the-new-refresh-application-debug-mode.111162/

0
votes

In Fabric Explorer you need to find the node where you Web Application is running. I my case that is _Node_0

By SF SDK design, local SF published file is under C:\SfDevCluster\Data_App\ . In my environment, the website file path is C:\SfDevCluster\Data_App_Node_0\Application1Type_App1\Web1Pkg.Code.1.0.0\wwwroot\

So you can also find your HTML, CSS, JS and other static resources under below path: C:\SfDevCluster\Data_App[node_id][application_type_and_instance_name][service_type_and_version]\

You can just modify the files in this folder, then the change will immediately apply to your local test web browser. Please notice if your service is hosted by micro-service running in several nodes, you may need to modify all nodes files because load balancer may access any folder files randomly.