diff --git a/docs/analyzer-rules/AZFW0009.md b/docs/analyzer-rules/AZFW0009.md new file mode 100644 index 000000000..4faac9a1b --- /dev/null +++ b/docs/analyzer-rules/AZFW0009.md @@ -0,0 +1,26 @@ +# AZFW0009: Invalid use of SupportsDeferredBinding attribute + +| | Value | +|-|-| +| **Rule ID** |AZFW0009| +| **Category** |[Usage]| +| **Severity** |Error| + +## Cause + +This rule is triggered when the `SupportsDeferredBinding` attribute is used on any class other +than an input (`InputBindingAttribute`) or trigger (`TriggerBindingAttribute`) binding based class. + +## Rule description + +The `SupportsDeferredBinding` attribute is used to determine if a binding supports deferred binding. +Currently, this feature is only supported for input and trigger bindings. Output bindings are not supported +and this attribute should not be used on any other class type. + +## How to fix violations + +Remove the use of the `SupportsDeferredBinding` attribute from your class. + +## When to suppress warnings + +This rule should not be suppressed because this error may prevent your Azure Functions from running. diff --git a/sdk/Sdk.Analyzers/DiagnosticDescriptors.cs b/sdk/Sdk.Analyzers/DiagnosticDescriptors.cs index 2a094e367..70f156f7c 100644 --- a/sdk/Sdk.Analyzers/DiagnosticDescriptors.cs +++ b/sdk/Sdk.Analyzers/DiagnosticDescriptors.cs @@ -22,7 +22,7 @@ private static DiagnosticDescriptor Create(string id, string title,string messag category: Constants.DiagnosticsCategories.Usage, severity: DiagnosticSeverity.Error); public static DiagnosticDescriptor DeferredBindingAttributeNotSupported{ get; } - = Create(id: "AZFW0003", title: "Invalid class attribute", messageFormat: "The attribute '{0}' can only be used on trigger and input binding attributes.", + = Create(id: "AZFW0009", title: "Invalid class attribute", messageFormat: "The attribute '{0}' can only be used on trigger and input binding attributes.", category: Constants.DiagnosticsCategories.Usage, severity: DiagnosticSeverity.Error); }