Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
a8ed46b
add overload of ConfigureFunctionsWebApplication allowing to pass Hos…
vmcbaptista Sep 23, 2023
7f4e1a1
add unit tests for ConfigureFunctionsWebApplication
vmcbaptista Oct 10, 2023
254da2e
Adding Schema Regsistry attributes for kafka trigger and ouput (#1850)
jainharsh98 Oct 18, 2023
9ca39bf
Updating ASP.NET Core integration CI to include tests
fabiocav Oct 17, 2023
7bdd49c
Skipping flaky test to improve CI reliability (#1966)
surgupta-msft Oct 18, 2023
dbd6569
Update eventhubs to 6.0.1 (#1965)
liliankasem Oct 19, 2023
12e8699
Service Bus settlement support (#1945)
JoshLove-msft Oct 19, 2023
f936386
Update version and notes (#1970)
liliankasem Oct 19, 2023
04f5b2c
Bump dependency on webjobs extension
JoshLove-msft Oct 20, 2023
382bf88
Fixing broken tests after package updates
fabiocav Oct 20, 2023
aef2b87
Updating method used to retrieve a blob stream
fabiocav Oct 21, 2023
e1ba413
Reset release notes (#1971)
liliankasem Oct 23, 2023
f6a0151
Close hostfxr handle, skip creating unnecessary parameters (#1982)
elinor-fung Oct 23, 2023
304c5f4
Revert "Updating method used to retrieve a blob stream"
fabiocav Oct 23, 2023
e4f4b4d
Updating method used to retrieve a blob stream
fabiocav Oct 24, 2023
54dbe73
Analyzer to detect missing ASP.NET Core integration registration (#1917)
surgupta-msft Oct 25, 2023
8238eda
Code fix suggestion for correct registration in ASP.NET core integrat…
surgupta-msft Oct 26, 2023
bf56b37
Support for HttpRequestData and HttpResponseData in ASP.NET Core inte…
fabiocav Oct 12, 2023
4e8849e
[ApplicationInsights] removing env var reads from hot path (#1996)
brettsam Oct 31, 2023
8144ded
Include .pdb files for FunctionsNetHost (#2002)
kshyju Nov 1, 2023
a4a3508
fix service bus sample (#2007)
karstenjMSFT Nov 1, 2023
c0de8a9
fix cosmos connection name in local.settings.json (#2006)
karstenjMSFT Nov 1, 2023
fc7e090
Defaulting to source-generation (#1968)
satvu Nov 1, 2023
b39a841
Worker.Sdk release prep for 1.16.0 version (#2010)
kshyju Nov 2, 2023
9fc9341
Default to optimized function executor. (#2012)
kshyju Nov 2, 2023
f7606fc
Setting text encoding to fix the newline char issue when using Stream…
surgupta-msft Nov 3, 2023
a3405ec
Change binding type name to camel case in source-gen (#2022)
satvu Nov 6, 2023
d9ba59b
[AppInsights] removing preview for 1.1.0 (#2025)
brettsam Nov 6, 2023
5afdc0e
Update AspNetCore pipeline to include building analyzer package (#2026)
surgupta-msft Nov 7, 2023
1085475
Fix default value of parameter for Extension pipeline (#2032)
surgupta-msft Nov 7, 2023
68b972f
Adding "global::" namespace prefix to avoid compiler misintepretation…
DL444 Nov 7, 2023
b528b47
Make NativeHostIntegration p/invokes blittable (#1989)
elinor-fung Nov 8, 2023
0dab4ab
Updating generated metadata provider to ensure public types and membe…
fabiocav Nov 8, 2023
81b2a01
Updating generated function executor to ensure public types and membe…
fabiocav Nov 8, 2023
cc4b9ac
Updating ExtensionStartupRunnerGenerator to ensure public types and m…
fabiocav Nov 8, 2023
384ef0d
Added default encoding in case it is not specified by the client
endizhupani Oct 24, 2023
a4a95a6
Preparing ASP.NET Core packages for release
fabiocav Nov 8, 2023
e853ae5
Reverted: Default to optimized function executor (#2012) (#2037)
kshyju Nov 8, 2023
6b2e257
Handle self-contained application load (#2036)
kshyju Nov 8, 2023
af03e09
bump timer, prep release notes
satvu Nov 8, 2023
4edd4d3
Run worker pipeline on extension changes
liliankasem Oct 25, 2023
5dca0f1
Fix incorrect invocation of functions with names only differ in casin…
DL444 Nov 8, 2023
6cd0ea1
1.16.1 SDK release prep (#2043)
kshyju Nov 8, 2023
95d3b05
Fixing the new test added in #2033 to handle changes added in #2035 (…
kshyju Nov 9, 2023
d66f0cb
Merge branch 'main' into merge-main
jviau Nov 9, 2023
15f520f
Linux test fix
kshyju Nov 9, 2023
bef3609
Release prep for Worker (Core, Grpc) and ASP.NET Core
fabiocav Nov 9, 2023
3835262
Update sln
jviau Nov 9, 2023
ae2ad67
Fix properties
jviau Nov 9, 2023
d5c017b
Merge branch 'main' into merge-main
jviau Nov 9, 2023
172ddf5
Adding support for locating functions within nested types and nested …
kshyju Nov 10, 2023
7f13e41
Revert "Setting text encoding to fix the newline char issue when usin…
fabiocav Nov 9, 2023
01b1b79
Using a SymbolVisitor implementation to locate function methods from …
kshyju Nov 13, 2023
31f3a8b
Generate correct value for defaultWorkerPath in worker.config when AO…
kshyju Nov 16, 2023
2f4e4a9
[SignalR] Update extension version to 1.12.0
Y-Sindo Nov 22, 2023
c319c6c
Update samples to net8 (#2074)
kshyju Nov 22, 2023
a5fc063
Updating Event Grid WebJobs extension reference
fabiocav Nov 22, 2023
5ee6e55
[SourceGen] Bug fix for scenarios with $return output binding (#2098)
satvu Nov 28, 2023
1808ec7
Replace - with _ when generating namespace for generated types (#2097)
kshyju Nov 28, 2023
0733bbd
Generate correct ScriptFile value when generating metadata. (#2103)
kshyju Nov 29, 2023
207c195
Adding support for executing functions from referenced assemblies, to…
kshyju Nov 29, 2023
014190d
[SourceGen] Add GeneratedCode Attribute (#2104)
satvu Nov 30, 2023
5ff83ce
Remove new language features from generated type (#2108)
kshyju Nov 30, 2023
3ee21ed
Merge branch 'main' into merge-main
jviau Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions DotNetWorker.sln
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Tests", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetIntegration", "samples\AspNetIntegration\AspNetIntegration.csproj", "{D2F67410-9933-42E8-B04A-E17634D83A30}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net7Worker", "samples\Net7Worker\Net7Worker.csproj", "{EC1A321B-70F6-420B-85D4-56C7869BB71B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependentAssemblyWithFunctions", "test\DependentAssemblyWithFunctions\DependentAssemblyWithFunctions.csproj", "{AB6E1E7A-0D2C-4086-9487-566887C1E753}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependentAssemblyWithFunctions", "test\DependentAssemblyWithFunctions\DependentAssemblyWithFunctions.csproj", "{AB6E1E7A-0D2C-4086-9487-566887C1E753}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Http.AspNetCore.Tests", "test\extensions\Worker.Extensions.Http.AspNetCore.Tests\Worker.Extensions.Http.AspNetCore.Tests.csproj", "{D8E79B53-9A44-46CC-9D7A-E9494FC8CAF4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Http.AspNetCore.Analyzers", "extensions\Worker.Extensions.Http.AspNetCore.Analyzers\Worker.Extensions.Http.AspNetCore.Analyzers.csproj", "{7B6C2920-7A02-43B2-8DA0-7B76B9FAFC6B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net7Worker", "samples\Net7Worker\Net7Worker.csproj", "{BE1F79C3-24FA-4BC8-BAB2-C1AD321B13FF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependentAssemblyWithFunctions.NetStandard", "test\DependentAssemblyWithFunctions.NetStandard\DependentAssemblyWithFunctions.NetStandard.csproj", "{198DA072-F94F-4585-A744-97B3DAC21686}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -329,14 +336,26 @@ Global
{D2F67410-9933-42E8-B04A-E17634D83A30}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2F67410-9933-42E8-B04A-E17634D83A30}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2F67410-9933-42E8-B04A-E17634D83A30}.Release|Any CPU.Build.0 = Release|Any CPU
{EC1A321B-70F6-420B-85D4-56C7869BB71B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC1A321B-70F6-420B-85D4-56C7869BB71B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC1A321B-70F6-420B-85D4-56C7869BB71B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EC1A321B-70F6-420B-85D4-56C7869BB71B}.Release|Any CPU.Build.0 = Release|Any CPU
{AB6E1E7A-0D2C-4086-9487-566887C1E753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB6E1E7A-0D2C-4086-9487-566887C1E753}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB6E1E7A-0D2C-4086-9487-566887C1E753}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB6E1E7A-0D2C-4086-9487-566887C1E753}.Release|Any CPU.Build.0 = Release|Any CPU
{D8E79B53-9A44-46CC-9D7A-E9494FC8CAF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D8E79B53-9A44-46CC-9D7A-E9494FC8CAF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D8E79B53-9A44-46CC-9D7A-E9494FC8CAF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D8E79B53-9A44-46CC-9D7A-E9494FC8CAF4}.Release|Any CPU.Build.0 = Release|Any CPU
{BE1F79C3-24FA-4BC8-BAB2-C1AD321B13FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE1F79C3-24FA-4BC8-BAB2-C1AD321B13FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE1F79C3-24FA-4BC8-BAB2-C1AD321B13FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE1F79C3-24FA-4BC8-BAB2-C1AD321B13FF}.Release|Any CPU.Build.0 = Release|Any CPU
{7B6C2920-7A02-43B2-8DA0-7B76B9FAFC6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B6C2920-7A02-43B2-8DA0-7B76B9FAFC6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B6C2920-7A02-43B2-8DA0-7B76B9FAFC6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B6C2920-7A02-43B2-8DA0-7B76B9FAFC6B}.Release|Any CPU.Build.0 = Release|Any CPU
{198DA072-F94F-4585-A744-97B3DAC21686}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{198DA072-F94F-4585-A744-97B3DAC21686}.Debug|Any CPU.Build.0 = Debug|Any CPU
{198DA072-F94F-4585-A744-97B3DAC21686}.Release|Any CPU.ActiveCfg = Release|Any CPU
{198DA072-F94F-4585-A744-97B3DAC21686}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -394,8 +413,11 @@ Global
{286F9EE3-00AE-4EFA-BFD8-A2E58BC809D2} = {FD7243E4-BF18-43F8-8744-BA1D17ACF378}
{17BDCE12-6964-4B87-B2AC-68CE270A3E9A} = {FD7243E4-BF18-43F8-8744-BA1D17ACF378}
{D2F67410-9933-42E8-B04A-E17634D83A30} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
{EC1A321B-70F6-420B-85D4-56C7869BB71B} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
{AB6E1E7A-0D2C-4086-9487-566887C1E753} = {B5821230-6E0A-4535-88A9-ED31B6F07596}
{D8E79B53-9A44-46CC-9D7A-E9494FC8CAF4} = {AA4D318D-101B-49E7-A4EC-B34165AEDB33}
{7B6C2920-7A02-43B2-8DA0-7B76B9FAFC6B} = {A7B4FF1E-3DF7-4F28-9333-D0961CDDF702}
{BE1F79C3-24FA-4BC8-BAB2-C1AD321B13FF} = {9D6603BD-7EA2-4D11-A69C-0D9E01317FD6}
{198DA072-F94F-4585-A744-97B3DAC21686} = {B5821230-6E0A-4535-88A9-ED31B6F07596}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {497D2ED4-A13E-4BCA-8D29-F30CA7D0EA4A}
Expand Down
9 changes: 9 additions & 0 deletions build/AspNetCore.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"solution": {
"path": "..\\DotNetWorker.sln",
"projects": [
"extensions\\Worker.Extensions.Http.AspNetCore\\src\\Worker.Extensions.Http.AspNetCore.csproj",
"extensions\\Worker.Extensions.Http.AspNetCore.Analyzers\\Worker.Extensions.Http.AspNetCore.Analyzers.csproj"
]
}
}
8 changes: 7 additions & 1 deletion build/install-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ steps:
displayName: 'Install .NET6 SDK'
inputs:
packageType: 'sdk'
version: "6.0.412"
version: "6.x"

- task: UseDotNet@2
displayName: 'Install .NET7 SDK'
inputs:
packageType: 'sdk'
version: "7.x"

# The SDK we use to build
- task: UseDotNet@2
Expand Down
29 changes: 20 additions & 9 deletions build/pipelines/templates/extensions-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ parameters:
- name: ExtensionDirectory
type: string
default: not-specified
- name: RunExtensionTests
displayName: Run Extension Tests?
type: boolean
default: false
- name: Solution
type: string
default:

jobs:
- job: "Build_And_Test_Windows"
Expand All @@ -23,14 +30,14 @@ jobs:
arguments: '-c Release -p:BuildNumber=$(buildNumber) -p:IsLocalBuild=False'
projects: ${{ parameters.ExtensionDirectory }}/src/*.csproj

# Extensions test structure must be defined
# - task: DotNetCoreCLI@2
# displayName: 'Run tests'
# inputs:
# command: 'test'
# arguments: '--no-build -c Release'
# projects: |
# test/**/*Tests.csproj
- ${{ if eq(parameters.RunExtensionTests, true) }}:
- task: DotNetCoreCLI@2
displayName: 'Run tests'
inputs:
command: 'test'
arguments: '-c Release'
projects: |
test/${{ parameters.ExtensionDirectory }}.Tests/**/*Tests.csproj

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
displayName: 'ESRP CodeSigning - Authenticode'
Expand Down Expand Up @@ -76,7 +83,11 @@ jobs:
command: 'custom'
custom: 'pack'
arguments: '--no-build -c Release -o packages -p:BuildNumber=$(buildNumber) -p:IsLocalBuild=False'
projects: ${{ parameters.ExtensionDirectory }}/src/*.csproj
${{if parameters.Solution}}:
projects: |
**\${{ parameters.Solution }}
${{ else }}:
projects: ${{ parameters.ExtensionDirectory }}/src/*.csproj

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@2
displayName: 'ESRP CodeSigning: Nupkg'
Expand Down
25 changes: 25 additions & 0 deletions docs/analyzer-rules/AZFW0014.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# AZFW0011: Missing Registration for ASP.NET Core Integration

| | Value |
|-|-|
| **Rule ID** |AZFW00014|
| **Category** |[Usage]|
| **Severity** |Error|

## Cause

This rule is triggered when worker using the ASP.NET Core Integration uses `ConfigureFunctionsWorkerDefaults()`.

## Rule description

When using the ASP.NET Core Integration, the worker must configure the worker using the `ConfigureFunctionsWebApplication()` method. This rule will be violated when the worker uses `ConfigureFunctionsWorkerDefaults()`.


## How to fix violations

Replace usage of `ConfigureFunctionsWorkerDefaults` with `ConfigureFunctionsWebApplication` method in the Function App. Refer to [public documentation](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide#aspnet-core-integration) for guidance on ASP.NET Core Integration.


## When to suppress

It is okay to suppress this if `ConfigureFunctionsWebApplication` is called indirectly through a different API.
4 changes: 2 additions & 2 deletions extensions/Worker.Extensions.EventGrid/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
- My change description (#PR/#issue)
-->

### Microsoft.Azure.Functions.Worker.Extensions.EventGrid <version>
### Microsoft.Azure.Functions.Worker.Extensions.EventGrid 3.4.1

- <entry>
- Updated `Microsoft.Azure.WebJobs.Extensions.EventGrid` reference to 3.3.1
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
using System.Runtime.CompilerServices;
using Microsoft.Azure.Functions.Worker.Extensions.Abstractions;

[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.EventGrid", "3.3.0")]
[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.EventGrid", "3.3.1")]
[assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Extensions.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Description>Azure Event Grid extensions for .NET isolated functions</Description>

<!--Version information-->
<VersionPrefix>3.4.0</VersionPrefix>
<VersionPrefix>3.4.1</VersionPrefix>

<!--Temporarily opting out of documentation. Pending documentation-->
<GenerateDocumentationFile>false</GenerateDocumentationFile>
Expand Down
2 changes: 1 addition & 1 deletion extensions/Worker.Extensions.EventHubs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

### Microsoft.Azure.Functions.Worker.Extensions.EventHubs <version>

- <entry>
- <entry>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
using System.Runtime.CompilerServices;
using Microsoft.Azure.Functions.Worker.Extensions.Abstractions;

[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.EventHubs", "5.5.0")]
[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.EventHubs", "6.0.1")]
[assembly: InternalsVisibleTo("Microsoft.Azure.Functions.Worker.Extensions.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001005148be37ac1d9f58bd40a2e472c9d380d635b6048278f7d47480b08c928858f0f7fe17a6e4ce98da0e7a7f0b8c308aecd9e9b02d7e9680a5b5b75ac7773cec096fbbc64aebd429e77cb5f89a569a79b28e9c76426783f624b6b70327eb37341eb498a2c3918af97c4860db6cdca4732787150841e395a29cfacb959c1fd971c1")]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Description>Azure Event Hubs extensions for .NET isolated functions</Description>

<!--Version information-->
<VersionPrefix>5.6.0</VersionPrefix>
<VersionPrefix>6.0.1</VersionPrefix>

</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
using System.Collections.Immutable;
using System.Threading.Tasks;
using System.Composition;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System.Threading;
using System.Linq;

namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore
{
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(CodeFixForRegistrationInASPNetCoreIntegration)), Shared]
public sealed class CodeFixForRegistrationInASPNetCoreIntegration : CodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds =>
ImmutableArray.Create(DiagnosticDescriptors.CorrectRegistrationExpectedInAspNetIntegration.Id);

public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;

private const string ExpectedRegistrationMethod = "ConfigureFunctionsWebApplication";

public override Task RegisterCodeFixesAsync(CodeFixContext context)
{
Diagnostic diagnostic = context.Diagnostics.First();
context.RegisterCodeFix(new ChangeConfigurationForASPNetIntegration(context.Document, diagnostic), diagnostic);

return Task.CompletedTask;
}

/// <summary>
/// CodeAction implementation which fixes the method configuration for ASP.NET Core Integration.
/// </summary>
private sealed class ChangeConfigurationForASPNetIntegration : CodeAction
{
private readonly Document _document;
private readonly Diagnostic _diagnostic;

internal ChangeConfigurationForASPNetIntegration(Document document, Diagnostic diagnostic)
{
this._document = document;
this._diagnostic = diagnostic;
}

public override string Title => "Change configuration for ASP.NET Core Integration";

public override string EquivalenceKey => null;

/// <summary>
/// Returns an updated Document with correct method configuration for ASP.NET Core Integration.
/// </summary>
protected override async Task<Document> GetChangedDocumentAsync(CancellationToken cancellationToken)
{
SyntaxNode root = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);

var currentNode = root.FindNode(this._diagnostic.Location.SourceSpan).FirstAncestorOrSelf<IdentifierNameSyntax>();

var newNode = currentNode.ReplaceNode(currentNode, SyntaxFactory.IdentifierName(ExpectedRegistrationMethod));

SyntaxNode newSyntaxRoot = root.ReplaceNode(currentNode, newNode);

return _document.WithSyntaxRoot(newSyntaxRoot);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.CodeAnalysis;

namespace Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore
{
internal class DiagnosticDescriptors
{
public const string Usage = "Usage";

private static DiagnosticDescriptor Create(string id, string title, string messageFormat, string category, DiagnosticSeverity severity)
{
var helpLink = $"https://aka.ms/azfw-rules?ruleid={id}";
return new DiagnosticDescriptor(id, title, messageFormat, category, severity, isEnabledByDefault: true, helpLinkUri: helpLink);
}

public static DiagnosticDescriptor CorrectRegistrationExpectedInAspNetIntegration { get; }
= Create(id: "AZFW0014", title: "Missing expected registration of ASP.NET Core Integration services", messageFormat: "The registration for method '{0}' is expected for ASP.NET Core Integration.",
category: Usage, severity: DiagnosticSeverity.Error);
}
}
Loading