Skip to content

Conversation

MaddyDev
Copy link
Contributor

@MaddyDev MaddyDev commented Feb 8, 2022

Adding [AutoResolve] tag enables reading the %% values from app config during run time. This was already added to parameters but missed from CommandText. Adding it to enable reading stored procedure values from app config.
This fixes #200.

Copy link
Contributor

@Charles-Gagnon Charles-Gagnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a sample and test for this

Copy link
Contributor

@Charles-Gagnon Charles-Gagnon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more cleanup things, but overall looks good!

namespace Microsoft.Azure.WebJobs.Extensions.Sql.Samples.InputBindingSamples
{
/// <summary>
/// This shows an example of a SQL Input binding that uses a store procedure from app setting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shows an example of a SQL Input binding that uses a stored procedure from an app setting value to query for Products with a specific cost that is also defined as an app setting value.

this.StartFunctionHost(nameof(GetProductsStoredProcedureFromAppSetting));

// Generate T-SQL to insert n rows of data with cost
Product[] products = GetProductsWithSameCost(1, 100);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also insert some products with cost != 100 to make sure we're only grabbing the expected products

@MaddyDev MaddyDev merged commit e0a470d into main Feb 10, 2022
@MaddyDev MaddyDev deleted the maddy/attributesFromAppSetting branch February 10, 2022 07:00
MaddyDev added a commit that referenced this pull request Feb 11, 2022
* add [AutoResolve] for reading from app setting

* add sample

* add test

* update test

* fix test
PBBlox pushed a commit to PBBlox/azure-functions-sql-extension that referenced this pull request Apr 6, 2025
* add [AutoResolve] for reading from app setting

* add sample

* add test

* update test

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for app settings binding expressions

4 participants