Azure / Azure/azure-functions-host
Confusing error message when "WindowsAzure.Storage" package is referenced in project.json
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
According to the documentation there are packages that are included by default to Azure Functions runtime environment, one of those packages is WindowsAzure.Storage package.
When someone references the same package in project.json by mistake (or because of the lack of Functions knowledge) very confusing exceptions start to pop up.
#### Repro steps
Details of the error and repro steps can be found here: http://stackoverflow.com/questions/42763467/azure-function-table-storage-in-binding
#### Expected behavior
I believe users should be warned that they try to reference duplicate packages, and that there is no need to reference them.
Also error that shows up after this incorrect configuration should be more precise, e.g.:
"Multiple versions of 'WindowsAzure.Storage' has been deployed to Function. Please note there are packages that are referenced by default in every FunctionApp, for more details please refer to documentation: https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-csharp
The same behavior should be applied to all packages that are referenced by default.
#### Actual behavior
Following exception is thrown by Function:
'Microsoft.Azure.WebJobs.Host.Tables.TableAttributeBindingProvider+TableToIQueryableConverter1[TElement]'
violates the constraint of type 'TElement'. mscorlib:
GenericArguments[0], 'Submission#0+MetadataTable', on
'Microsoft.Azure.WebJobs.Host.Tables.TableAttributeBindingProvider+TableToIQueryableConverter1[TElement]' violates the constraint of type parameter 'TElement'.
#### Known workarounds
Remove redundant packages from project.json
#### Related information
N/A
Contributor guide
Research direction
Start with the project.json package reference and the linked Stack Overflow reproduction, then trace how WindowsAzure.Storage and other default packages are loaded by the Functions runtime. Done means duplicate default-package references produce a precise warning or error instead of the confusing generic exception, with the behavior applied to all default packages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100