Creating Azure Functions with C# Script (.csx)
And deploying it from Azure DevOps to an Azure Function
Azure Functions is a serverless technology that allows you to process events. It allows you to act on a blob being added, for example, or a message being published on a queue or an HTTP request. You can write an Azure function in Python, PowerShell, C#, Node, or Java.
When building a project in C#, you need to create a .csproj. To create an Azure Function, you’ll need to introduce a class, add bindings, and so forth. Then you need to compile the project and deploy the manifest to Azure.
But sometimes a full-blown C# solution is overkill. In those cases, maybe an Azure Function with C# Script (.csx) will suffice. In this article, you can read how to create a C# script Azure function, add a trigger, and deploy it to Azure.
Creating a C# script Azure Function
To get started, you need the Azure Functions Core Tools. Install them by running the following command on Mac:
brew install azure/functions/azure-functions-core-tools
On Windows, use Chocolatey to install the Azure Functions Core Tools:
choco install azure-functions-core-tools
This introduces a new command-line tool called “func”.