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

Allow wild cards to be used for referencing extension versions in dotnet templates

Open soninaren opened this issue 2 years ago • 1 comments

Dotnet precompiled templates right now are required to have static reference to an extension package. This basically means that every time there is an extension update, the extension authors are required to update the templates. This results in either customer using an old version of extension or an engineering cost on authors to constantly update the template.

The proposed solution here is to allow extension authors to use valid wild card character for NuGet version resolution. Here is a sample version reference "reference": "Microsoft.Azure.WebJobs.Extensions.Sql", "version": "0.1.*-*"

The version format mentioned above may work as is in the dotnet clients / hosts. However, using them as is can yield some unexcepted results and inconsistencies. Have highlighted some of the key issues below:

  1. The version resolution for the wild card characters is not done in a single library. Each dotnet host that consumes this template has its own custom code to resolve extension version from a wild card. To make sure if works as expected you would have to test each client individually. Even after they are tested there is a possibility of a bug being introduced or present after the fact.
    • Visual studio
    • Dotnet CLI
    • Vs Code
    • VS for Mac
  2. If there is bug that is introduced in any of the extension releases, customers would automatically run into it without updating any tools / environment. They would have no way to know what caused the issue. This would particularly cause issues in the automated test environments.
  3. Additionally that makes the tooling unreliable for the customers and the journey from a broken state to a fix would be very long and tedious for the customer, not to mention the servicing / debugging effort required by the team. In order to avoid the above highlighted issues and we can instead update the templates build to resolve the wild card version references at build time and update them in place. This way the extension authors would not need to spend constant engineering effort and still get the benefit of consistent working tools.

The following rules should be applied to the version resolution.

  1. Resolve up to max version of the extension that supports the Target Framework
  2. Throw an error when version matching required TargetFramwork is not found

soninaren avatar Dec 14 '21 21:12 soninaren

cc: @phil-allen-msft

soninaren avatar Dec 14 '21 21:12 soninaren