AzureFunctionAnalyzers 0.1.0-ci.23

This is a prerelease version of AzureFunctionAnalyzers.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package AzureFunctionAnalyzers --version 0.1.0-ci.23
                    
NuGet\Install-Package AzureFunctionAnalyzers -Version 0.1.0-ci.23
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AzureFunctionAnalyzers" Version="0.1.0-ci.23">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AzureFunctionAnalyzers" Version="0.1.0-ci.23" />
                    
Directory.Packages.props
<PackageReference Include="AzureFunctionAnalyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AzureFunctionAnalyzers --version 0.1.0-ci.23
                    
#r "nuget: AzureFunctionAnalyzers, 0.1.0-ci.23"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AzureFunctionAnalyzers@0.1.0-ci.23
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AzureFunctionAnalyzers&version=0.1.0-ci.23&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=AzureFunctionAnalyzers&version=0.1.0-ci.23&prerelease
                    
Install as a Cake Tool

AzureFunctionAnalyzers

NuGet NuGet Downloads Build and Test

Roslyn analyzers for common Azure Functions patterns.

Rules

Id Title
AZURE_FUNCTIONS_0001 Function class name should match the function name
AZURE_FUNCTIONS_0002 Prefer ILogger<T> over ILogger
AZURE_FUNCTIONS_0003 Prefer injecting ILogger<T> over FunctionContext.GetLogger()

Examples

<a id='snippet-FunctionClassNameAnalyzerExample'></a>

class UserGetter
{
    [{|#0:Function("GetUsers")|}] // warning: Class name 'UserGetter' does not match function name 'GetUsers', expected 'GetUsersFunction'
    public void Run() { }
}

<sup><a href='/test/AzureFunctionAnalyzers.Tests/FunctionClassNameAnalyzerTests.cs#L30-L36' title='Snippet source file'>snippet source</a> | <a href='#snippet-FunctionClassNameAnalyzerExample' title='Start of snippet'>anchor</a></sup>

<a id='snippet-PreferTypedLoggerAnalyzerExample'></a>

var logger = {|#0:context.GetLogger("GetUsersFunction")|};  // warning: 'logger' should be typed 'ILogger<GetUsersFunction>' instead of 'ILogger'

<sup><a href='/test/AzureFunctionAnalyzers.Tests/PreferTypedLoggerAnalyzerTests.cs#L76-L78' title='Snippet source file'>snippet source</a> | <a href='#snippet-PreferTypedLoggerAnalyzerExample' title='Start of snippet'>anchor</a></sup>

<a id='snippet-PreferLoggerDependencyInjectionAnalyzerExample'></a>

class GetUsersFunction
{
    [Function("GetUsers")]
    public void Run(FunctionContext context)
    {
        var logger = {|#0:context.GetLogger<GetUsersFunction>()|};  // warning: Use constructor-injected ILogger<GetUsersFunction> instead of calling 'GetLogger'
    }
}

<sup><a href='/test/AzureFunctionAnalyzers.Tests/PreferLoggerDependencyInjectionAnalyzerTests.cs#L72-L81' title='Snippet source file'>snippet source</a> | <a href='#snippet-PreferLoggerDependencyInjectionAnalyzerExample' title='Start of snippet'>anchor</a></sup>

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-ci.57 65 10/15/2026 0.1.0-ci.57 is deprecated because it is no longer maintained.
0.1.0-ci.56 54 10/15/2026
0.1.0-ci.55 60 10/15/2026
0.1.0-ci.54 49 10/15/2026
0.1.0-ci.33 149 10/6/2026
0.1.0-ci.29 60 10/3/2026
0.1.0-ci.28 70 10/3/2026
0.1.0-ci.27 62 10/3/2026
0.1.0-ci.26 54 10/3/2026
0.1.0-ci.25 67 10/3/2026
0.1.0-ci.24 55 10/3/2026
0.1.0-ci.23 56 10/3/2026
0.1.0-ci.16 64 10/3/2026
0.1.0-ci.11 111 10/2/2026
0.1.0-ci.10 55 10/2/2026