BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Google Cloud Functions Now Support .NET Core 3.1

Google Cloud Functions Now Support .NET Core 3.1

This item in japanese

Like other public cloud vendors, Google has a Function-as-a-Service (FaaS) offering with Cloud Functions. In a blog post last month, the public cloud vendor announced Cloud Functions would support .NET Core 3.1 – a free, cross-platform, and open-source platform for Windows, Mac, and Linux. 

With Cloud Functions, developers can write various functions such as HTTP functions to respond to HTTP events.  They can now also write functions using .NET Core 3.1 runtime with Google's Functions Framework for .NET, an open-source functions-as-a-service framework for writing portable .NET functions. Moreover, the runtime also supports Visual Basic (VB) and F#. And with code running on the Google Cloud Platform, the Cloud Functions written in .NET Core will scale automatically based on the load. 


Source: https://cloud.google.com/blog/products/application-development/introducing-net-google-cloud-functions

With the Functions framework for .NET, developers can author HTTP functions and CloudEvent functions, which respond to industry standard CNCF CloudEvents; events from Google Cloud services like Pub/Sub, Cloud Storage, and Firestore.

namespace HelloPubSub
{
    public class Function : ICloudEventFunction<MessagePublishedData>
    {
        private readonly ILogger _logger;

        public Function(ILogger<Function> logger) =>
            _logger = logger;

        public Task HandleAsync(CloudEvent cloudEvent, MessagePublishedData data, CancellationToken cancellationToken)
        {
            string nameFromMessage = data.Message?.TextData;
            string name = string.IsNullOrEmpty(nameFromMessage) ? "world" : nameFromMessage;
            _logger.LogInformation("Hello {name}", name);
            return Task.CompletedTask;
        }
    }
}

By supporting .NET for Cloud Functions, the public cloud vendor catches up with AWS, which already supports .NET in their FaaS offering Lambda for years. Moreover, AWS announced support for .NET Core 3.1 back in March.

The authors of the blog post, Jon Skeet, a staff developer relations engineer at Google, and Vinod Ramachandran, a product manager at Google, wrote:

With Cloud Functions for .NET, now in Preview, you can use .NET Core 3.1 to build business-critical applications and integration layers and deploy the function in a fully-managed environment, complete with access to resources in a private VPC network. .NET functions scale automatically based on your load.

Also, a respondent on a Reddit thread said:

The whole industry is moving away from big monolithic applications and customizations with code inside products, as it's not very compatible with the cloud business model.

Currently, developers can try Cloud Functions for .NET and find guidance through the quickstart guide or use a codelab.

Rate this Article

Adoption
Style

BT