azure-functions-host icon indicating copy to clipboard operation
azure-functions-host copied to clipboard

Create a Roslyn analyzer for missing properties and other conditions for a better development experience in VS

Open soninaren opened this issue 5 years ago • 7 comments

Currently we provide a warning in the build output for missing properties in the local.settings.json like the one below

warning : Function [Function1]: cannot find value named '' in local.settings.json that matches 'connection' property set on 'blobTrigger'

It would good to have a Roslyn analyzer that would direct towards the same.

soninaren avatar Feb 06 '20 19:02 soninaren

Summary

The majority of Functions apps still tend to be C#/.NET applications. As more customers are moving to pre-compiled this would help in the same manner as the Durable Functions Roslyn Analyser.

Suggestions of Items to cover

  1. Implement the suggestions for HttpClient, DocumentClient etc in https://docs.microsoft.com/en-us/azure/azure-functions/manage-connections
  2. Suggest not using Async void where possible.
  3. Suggest using IFunctionsConfigurationBuilder if customers are adding additional files in their startup class. https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection#customizing-configuration-sources
  4. Analyze existing analyzers and turn them on.

FinVamp1 avatar Jan 19 '21 12:01 FinVamp1

https://www.nuget.org/packages/Microsoft.VisualStudio.Threading.Analyzers/16.9.45-alpha that helps with ASync and Threading

FinVamp1 avatar Feb 03 '21 16:02 FinVamp1

Finbar to create separate work items that are actionable.

kulkarnisonia16 avatar Feb 03 '21 23:02 kulkarnisonia16

@kashimiz FYI

fabiocav avatar Feb 17 '21 23:02 fabiocav

@kashimiz is currently working on this. Leaving in sprint 97 as it is possible we'll have the changes in place before we cut the release.

fabiocav avatar Mar 17 '21 20:03 fabiocav

For awareness. This issue is still very vague and the changes in the linked PRs don't try to address everything outlined here, but this issue will be closed when the PR. If additional work is required once the PR is merged, we need to have the appropriate issues opened.

fabiocav avatar May 12 '21 20:05 fabiocav

Moving this to the Epics milestone. The async void analyzer has been merged and is currently on NuGet. SDK updates are pending.

fabiocav avatar May 26 '21 20:05 fabiocav