简体   繁体   中英

Stateful and serverless services on Azure

I am in the middle of a process, where I need to convert a bunch of old Windows services to a more cloud-friendly way of doing it. Right now, the only cloud in the solution, is that they are all hosted on a Azure Virtual Machine. And, of cause, you are not able to scale a specific service, without scaling the whole Virtual Machine.

A lot of the services can, almost, be directly converted to Azure Functions, but others are stateful and eg requires a login procedure to an external part, before it can do its thing.

What options do we have to create serverless services in Azure where state is required, or do I need to use technologies like Azure Worker Services or Azure Service Fabric?

Now I have a better understanding and I can provide some information.

Worker Services (former Cloud Services) are not deprecated. You can either use Service Fabric or Virtual Machines as replacements.

You can easy scale Virtual Machines, using Virtual Machines Scale Sets but you'll need to write stateless services, or use a dedicated service as the 'state server' (For example, web applications that need a state server, you can use Azure Redis Cache for that).

I usually rewrite my batch jobs as Azure Functions and I use Durable Functions whenever I can, as it simplify my functions code.

Be aware, You can't use Durable Functions with .NET 5 at this moment. It's not clear if it will be supported, or if they'll skip directly to .NET 6.

As another option, you can use a framework such as Hangfire and host on Azure App Service Plan (assuming you already have one). It works great for long running processes and has a great dashboard where you can monitor the status of your jobs.

You can also spinoff some Containers using Azure Container Instances and use it to process your jobs.

Now given all this information, the choice depends on your requirements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM