2

I'm a front end developer about to join a project team working with Service Fabric to build a Web Front End to their microservice driven application.

One of the problems I've been having in my own research is that when working with local Service Fabric Clusters, I have to redeploy my Application to test if something does or doesn't work in my Web App. This slows down developer velocity massively, as the process will only take longer and longer as other Back End services are added. I largely work with the Web App communicating to an API Gateway Service (GraphQL.NET).

What I'd like to know is if there's a way to run a local Web Application out outside of a Service Fabric cluster, but still have it communicate to one. This would allow my front end developer tool chain to remain intact, and develop at a much faster pace with incremental building and live-reload tools.

Of course, if anyone's come up with any better solution to the problem, I'd love to hear about it! ;)

Kraig Walker
  • 812
  • 13
  • 25
  • How are you hosting your Web App in Service Fabric? OWIN, .net core or guest executable? – Mikkel Mørk Hegnhøj Nov 08 '16 at 16:49
  • I actually have free choice on that! Not started building - still designing. My gut instinct is .net core – Kraig Walker Nov 08 '16 at 16:59
  • 1
    For .net core we are releasing a new debug mode to support your scenario. Basically you will get a web dev experience on par with not hosting in SF, e.g. edit and refresh etc. This is scheduled for our upcoming release within the next month. – Mikkel Mørk Hegnhøj Nov 08 '16 at 17:39
  • @MikkelMørkHegnhøj What would you recommend for OWIN based web apps? – Tobias Nov 30 '16 at 09:19
  • You can use Service Fabric to host your OWIN app. OWIN was mainly supported in Service Fabric to give you a front-end / WebAPI option as part of Service Fabric clusters. If you don't need the cluster, you should go with App Services http://stackoverflow.com/questions/35031083/web-api-app-with-owin-systemweb-on-azure-app-service. – Mikkel Mørk Hegnhøj Dec 05 '16 at 19:26
  • Hi @MikkelMørkHegnhøj, what if you're using the built in `Microsoft.ServiceFabric.Services.Communication.AspNetCore.WebListenerCommunicationListener`? Will this support the new debug mode? And as of Feb 2017 has this new debug mode been released? – MtEdenCodeLab Feb 21 '17 at 03:58
  • 1
    Yes - it will release in the next tooling update – Mikkel Mørk Hegnhøj Mar 17 '17 at 19:27

1 Answers1

1

We have a javascript front end (so this may not be applicable to you)- which means that there's a ton of front end library files etc. This was a nightmare to copy across to the cluster for testing and took forever. Theres a couple of ways I've been able to speed things up.

One is by keeping all the front end files in a separate project and using a build step to copy them across into the asp.net core project. So only the bundled/minified files are copied into the cluster when deploying.

Another option is to host these front-end files with a local node http-server which watches for changes etc and keep a static environment file where you can set the ip/hostname of your local cluster thats running. I use fiddler to redirect the hostname to the local ip, this way you can use the urls that you will use in production, which is handy. You'll need to set up cors though, which wasn't a problem for us.

So yes, definitely possible.

Peter Lea
  • 1,731
  • 2
  • 15
  • 24