Enhancing Azure functions expertise with https://github.com/marcduiker/azure-functions-university
Check the guide for isolated worker before creating a new function project (especially with isolated worker like .NET 8): . It saves a lot of time because Microsoft.Azure.Functions.Worker.Extensions is the packages you should install. VS does not suggest you to, just says that it does not know the HttpTriggerAttribute...
Check the guide for Durable functions (available for many programming languages). There are significant differences from the version used in Azure University course (at least for Azure Functions VSCode Extension).
- Issue: In .NET 8 isolated worker process HttpTrigger function does not allow the use of a Custom type with
[HttpTrigger(...)]
attribute. - Solution: It requires passing an HttpRequest or HttpRequestData parameter with the
[HttpTrigger]
attribute, and then a custom parameter with[FromBody]
attribute can be passed. - Note: In Azure Functions University guide for .Net Core 3.1 the parameters of HttpTrigger were slightly different, but it was an in-process function. Maybe that's what makes difference, but I didn't find anything in Microsoft documentation for HttpTrigger or Isolated Worker model about it.
- Issue: Dynamic Blob output bindings and CloudBlobContainer do not work for isolated worker model.
- Solution: It is recommended to register and use appropriate Sdk Clients (e.g., BlobServiceClient) explicitly instead.
- Resource: Reference examples for all kinds of Bindings using the isolation worker Extensions Sdk.
- Link: Azure Functions Worker Samples
- Note: This was a helpful discovery for me as I struggled with questions "Am I doing this in a right way? Are there any recommended or just different options?". Especially worth checking the Blob section for clearer examples. This one gave me a simple example which I was looking for the isolated worker model in Blob binding lesson.
- Issue: App Configuration Service registration for isolated worker no longer uses FunctionsStartup.
- Solution: Add configuration settings to Program.cs.
.ConfigureAppConfiguration(builder =>
{
var azureAppConfigConnection = Environment.GetEnvironmentVariable("AppConfigurationConnectionString");
builder.AddAzureAppConfiguration(azureAppConfigConnection);
})
- Note: Worth checking Documentation for adding these Configuration settings.
- Issue: Default example created with a new project does not work.
- Workaround: Add a specific configuration to Program.cs as a workaround.
services.Configure<KestrelServerOptions>(options =>
{
options.AllowSynchronousIO = true;
});
- Reference: For more options, check this issue.
- Note: The problem might be related to Azure Functions Dotnet worker and eventually can be fixed there. Relevant issues: