Use Application Insights for Worker Service applications in .NET Core console apps, containers, and any non-HTTP apps

Use Application Insights for Worker Service applications in .NET Core console apps, containers, and any non-HTTP apps

Relying on Application Insights to provide great data has always been a core component of anything I create. Recently, I upgraded my projects to .NET Core 3.1, and in few cases I also upgraded to .NET 5 (Preview). A lot of my code is executed in containers, or other background processes that may not have a native Application Insight integration. With the upgrade to .NET Core 3.1, we noticed after a while that no logs were persisted to the cloud anymore. I could see telemetry being created when debugging, and from that perspective all the unit tests were…

Read More

Solving ASP.NET Core running on Azure App Service causing 500.30 ANCM In-Process Start Failure

Solving ASP.NET Core running on Azure App Service causing 500.30 ANCM In-Process Start Failure

Recently I attempted to re-deploy and replicate some of the infrastructure I have running and deploy the same version of the source to a new Slot in an Azure App Service. I hit the error message below: Azure App Service presenting the 500.30 error message on ASP.NET Core 3Following the link (here), gives us an indication of what the error is about: The worker process fails. The app doesn't start. The ASP.NET Core Module attempts to start the .NET Core CLR in-process, but it fails to start. The cause of a process startup failure can usually be…

Read More

Running .NET 5 on Azure App Services

Running .NET 5 on Azure App Services

I recently had a few discussions about some heavily-loaded Blazor apps I've built. They are all running on .NET Core 3.1, but I am attempting to get them up to .NET 5 (Preview). In these discussions, it came up that it wasn't at the time of our dialogs, possible to publish to Azure App Services with success. However, it seems that it works now - but again, it is a preview. Expect changes, perhaps even breaking changes, and don't ship to production just yet - at least that's what I'd recommend. I have successfully upgraded two out of eight…

Read More

Code analysis tools for Azure developers coding in .NET Core

Code analysis tools for Azure developers coding in .NET Core

I love automation. Part of the glory of seeing a green build is to also know that it has passed some type of quality gates. In this post I'll talk a bit about some of my favorite Code Analysis tools for .NET Core. I use them in both personal as well as work projects, in a varietal mix depending on project. It's not an exhaustive list, and by no means the only tools that can be used. These are a select part of my arsenal to ensure I stay on the right path when developing software. Someone asked me recently…

Read More

Re-use service instances by Implementing Dependency Injection in Azure Functions

Re-use service instances by Implementing Dependency Injection in Azure Functions

Imagine you have a Function App that has multiple Functions deployed. It's a common scenario, and depending on how you've built the architecture for the solution, it can come in handy to use Dependency Injection to instantiate a service once when the Function App (host) starts up, and re-use that object across all executions of your Functions inside this Function App. To paint a picture of what this means, I can refer to one of my spare-time project scenarios. I have a Function App on a premium tier with 8 Functions that are a mix between Timer Triggers and Queue…

Read More

Issues with "Cannot bind parameter 'log' to type ILogger." after upgrading Azure Functions to v3

Issues with "Cannot bind parameter 'log' to type ILogger." after upgrading Azure Functions to v3

I have a lot of Azure Functions. Most of them are running on v2 with support for .NET Core 2.2 and netstandard2.0. During the upgrade process of my projects, I stumbled onto this several times across different projects: Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'log' to type ILogger. The full message: [2019-12-17 8:10:32 PM] Error indexing method 'ControlApp' [2019-12-17 8:10:32 PM] Microsoft.Azure.WebJobs.Host: Error indexing method 'ControlApp'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'log' to type ILogger. Make sure the parameter Type is supported by the binding. If you're using…

Read More