From the course: Azure Functions for Developers

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Query

Query

- [Instructor] Since we want users to retrieve the latest website updates, let's implement a new Azure function that exposes an endpoint and, to do this, we're going to use an HTTP trigger with a SqlInput binding. So let's begin by adding the function, and the name is going to be query based on the HTTP trigger with anonymous. So let's get rid of this. Let's inject ILogger of query. Let's fix the namespace syntax and the function name and of course we only need the get method, so let's remove the post method, and now we're ready to implement the SqlInput binding. You might remember that it has two parameters. The first one is the query and the second one is the connection string setting, so WebsiteWatcher, as always. In this video I'm going to use IReadOnlyList of dynamic, since I want to return the results from the database as they come, so there's no need for us to create a new model class and let's name this websites and that's actually the object that we're going to return inside…

Contents