Silo as IHostedService on Azure App Service
See original GitHub issueSummary
It works just fine when there is only one instance within the App Service Plan. Problems start when I scale out.
Background
I’m using an App Service Plan with 2x S3 instances inside of it. The silo is started as a singleton IHostedService that I’ve implemented. It is running within a .NET Core 2.0 API that translates the HTTP traffic into Grain calls. In this scenario GrainClient and Silo are both within the same application. First silo starts fine. Second silo gets stuck in “Joining” state, which then transitions to “Dead”.
Configuration
Orleans version: 2.0-beta3
SiloConfiguraton.xml
<OrleansConfiguration xmlns="urn:orleans">
<Globals>
<SystemStore SystemStoreType="AzureTable"
DeploymentId="MyDeployment"
DataConnectionString="removed-for-github" />
<Liveness LivenessType="AzureTable" />
</Globals>
<Defaults>
<Networking Address="" Port="11111" />
<ProxyingGateway Address="" Port="40000" />
</Defaults>
</OrleansConfiguration>
ClientConfiguration.xml
<ClientConfiguration xmlns="urn:orleans">
<SystemStore SystemStoreType="AzureTable"
DeploymentId="MyDeployment"
DataConnectionString="removed-for-github" />
</ClientConfiguration>
Questions
- Should I update to the recently released
2.0-rc1
Orleans? - Have I provided enough information?
CC @sergeybykov
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Run IHostedService on only one instance of a scaled out ...
This service will run twice a day at the same time when my App Service is scaled out to 2 instances, resulting in...
Read more >Orleans clients
Co-hosted clients In this case, the client communicates directly with the silo it is attached to and can take advantage of the extra...
Read more >Using an ASP.NET Core IHostedService to run Azure Service ...
This post shows how Azure Service bus subscription for topics or consumers for a queue, or can be used inside an ASP.NET Core...
Read more >Implement background tasks in microservices with ...
The basic idea is that you can register multiple background tasks (hosted services) that run in the background while your web host or...
Read more >Tutorial: Hello World with Microsoft Orleans - Nick's .NET Travels
... Orleans Silo (the backend), and can be hosted on an Azure App Service and uses Azure Table Storage (or Azure Cosmos DB)...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s what I’ll have to do then. It would be so nice if Orleans could work on App Service. I did try to make it work by detecting which port is the process listening on but even though port was open they couldn’t connect over the “internal” network - probably due to proxy that you mention.
No, I don’t think it is possible. As far as I know an App Service is proxied by a web server listening on port 80 and 443. Running one instance works fine because your process listens on the loopback adapter without any “real” network communication. However, if you scale out the instances are unable to communicate.
You can connect an App Service to a Virtual Network using VNET Integration. This allows you to host your Orleans cluster on VMs or some other “execution mechanism” and connect an Orleans client in the App Service to the cluster connected to the Virtual Network.