azure-functions-templates
azure-functions-templates copied to clipboard
Functions HttpTrigger template warning
REPRO STEPS
- File > New Project > Azure Function > Azure Function v2(.Net Core)
- Select "Http trigger" in the dialog, select "Browser" in the "Storage Account(AzureWebJobsStorage)"dropdown. Add your storage account and create.
Not repro with Azure Functions v1 (.NET Framework)
ACTUAL
Message IDE0067: Disposable object created by 'new StreamReader(req.Body)' is never disposed Use recommended dispose pattern to ensure that locally scoped disposable objects are disposed on all paths. If possible, wrap the creation within a 'using' statement or a 'using' declaration. Otherwise, use a try-finally pattern, with a dedicated local variable declared before the try region and an unconditional Dispose invocation on non-null value in the 'finally' region, say 'x?.Dispose()'. If the object is explicitly disposed within the try region or the dispose ownership is transfered to another object or method, assign 'null' to the local variable just after such an operation to prevent double dispose in 'finally'
@soninaren