2
votes

I have developed a Azure Service Fabric service .Net core 2.2 which contains a controller and some API methods inside it. I deployed the service on local cluster and its working fine. I am able to access the api endpoints.

But now I need to deploy it on local IIS too. I published the service project that contains my controller, and when I try to deploy it on local IIS as we usually do while deployment of other apps, I get an error "HTTP Error 500.0 - ANCM In-Process Handler Load Failure". I am googling for this and trying to find solution but no success yet.

Is there any particular setting or process that needs to be followed to deploy Azure Service Fabric service on IIS ? I am unable to figure out what I am missing.

Any suggestions or ideas?

1
You cannot deploy (host) a service fabric cluster in IIS. i try to deploy it on local IIS as we ususally do -> this really makes no sensePeter Bons
There was a requirement to check if the service gets deployed on iis, so i was trying to do so. Thanks a lot for sharing this information.You saved my lot of time.Pwavel002

1 Answers

1
votes

When you create a Service Fabric service, the runtime need to talk to the Service Fabric System Services at startup. If you deploy it to IIS, it does not have a cluster to talk to.

If you want to make an API flexible to be hosted either on Service Fabric or IIS, you need to decouple the hosting logic from the API.

In this case, you can either create two different hosts, or: in the host entry point, check if you are running inside SF, if yes you start the Service Fabric Service otherwise you start a self-hosted or IIS version.

There are quite a few questions in SO with examples like this, worth a search to check which one fits your needs.