{"id":195,"date":"2021-02-14T23:14:43","date_gmt":"2021-02-14T23:14:43","guid":{"rendered":"https:\/\/www.naveedulhaq.com\/?p=195"},"modified":"2021-02-14T23:16:50","modified_gmt":"2021-02-14T23:16:50","slug":"azure-function-apps-with-net-core-sql-server","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/azure\/azure-function-apps-with-net-core-sql-server\/","title":{"rendered":"Azure Function Apps with .NET Core &#038; SQL server"},"content":{"rendered":"\n<p>Azure function apps are the perfect example of the KISS principle (Keep it stupid simple). In very simplest terms Azure Function is a piece of code you run based on some trigger.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Azure Functions are triggered by an event such as HTTP request, file added, deleted in blob storage, database (record added, deleted or modified in a table), event hub, service bus or azure queue etc.<\/li><li>Azure functions are quick to build, easy to deploy and maintain and very powerful to run.<\/li><li>These functions are scalable and lightweight.<\/li><li>Function Apps are essentials in building serverless microservices on Azure.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Create Azure Functions<\/h2>\n\n\n\n<p>You can write &amp; manage Azure Function apps entirely on Azure portal but it is not recommended. The proper way to write Azure functions is through Code editors like Visual studio. Let&#8217;s create Function App from Azure portal and after that update it from Visual studio.<\/p>\n\n\n\n<p>First of all, you log in to Azure portal, Search for Function Apps and click on create.<\/p>\n\n\n\n<p>In the next screen, you need to specify the resource group that you want to use. It could be an existing resource group or a new resource group.<\/p>\n\n\n\n<p>After that, you need to name your function. If the given name is already in use then you can see validation message appears on the fly.<\/p>\n\n\n\n<p>The next option is where you are you going to be publishing to your function?  Are you wrapping it in a Docker container or you are deploying it as a piece of code. For now, lets select &#8220;code&#8221;.<\/p>\n\n\n\n<p>Azure Functions supports Docker containers and publishing code. For this blog let&#8217;s choose Code because it also gives us the option to choose runtime stack, which basically tells the runtime what is the code that you are going to be writing on? you can select<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>PowerShell<\/li><li>Java<\/li><li>Python<\/li><li>Node.js<\/li><li>.NET Core<\/li><\/ul>\n\n\n\n<p>In this example, I&#8217;m going to select the .NET Core. The next is; selecting your region. I have selected the UK South. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"821\" height=\"910\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/function-app-1.png\" loading=\"lazy\" alt=\"Azure function apps\" class=\"wp-image-317\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/function-app-1.png 821w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/function-app-1-271x300.png 271w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/function-app-1-768x851.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/figure>\n\n\n\n<p>Now at this point, you can &#8220;Review &amp; Create&#8221; and what this does is it defaults you to consumption pricing tier, which is also a serverless tier. So in this tier, you do not need to configure scaling; your app will scale up or scale down automatically depending on the number of requests or time that it gets triggered. You can change it by clicking the Hosting tab.<\/p>\n\n\n\n<p>Finally, we can go to &#8220;review and create&#8221; and this page going to give us a summary of all of the things that will be created. <\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Normally, you create a storage plan, monitoring resources (application insights) resource group etc once and use it for all Function Apps<\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"948\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/function-app-2.png\" loading=\"lazy\" alt=\"Azure function Apps\" class=\"wp-image-321\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/function-app-2.png 825w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/function-app-2-261x300.png 261w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/function-app-2-768x883.png 768w\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" \/><\/figure>\n\n\n\n<p>Azure functions App can be created and deployed from Visual studio.<\/p>\n\n\n\n<p>Let&#8217;s start a project with template &#8220;Azure Function&#8221; and default function trigger &#8220;HTTP Request&#8221;. The visual studio gives you a default function template<\/p>\n\n\n\n<pre><code>public static class Function1\n    {\n        &#91;FunctionName(\"Function1\")]\n        public static async Task&lt;IActionResult> Run(\n            &#91;HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)] HttpRequest req,\n            ILogger log)\n        {\n            log.LogInformation(\"C# HTTP trigger function processed a request.\");\n\n            string name = req.Query&#91;\"name\"];\n\n            string requestBody = await new StreamReader(req.Body).ReadToEndAsync();\n            dynamic data = JsonConvert.DeserializeObject(requestBody);\n            name = name ?? data?.name;\n\n            string responseMessage = string.IsNullOrEmpty(name)\n                ? \"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.\"\n                : $\"Hello, {name}. This HTTP triggered function executed successfully.\";\n\n            return new OkObjectResult(responseMessage);\n        }\n    }<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Integrate Azure Function with SQL Server<\/h2>\n\n\n\n<p>The easiest thing is; to install SqlClient Nuget package<\/p>\n\n\n\n<pre><code>Install-Package System.Data.SqlClient<\/code><\/pre>\n\n\n\n<p> The next step is to add your connection string. <\/p>\n\n\n\n<p>In the following example function, I create a connection with the database and get records based on a parameter from the database.<\/p>\n\n\n\n<pre><code>using System.Threading.Tasks;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.Azure.WebJobs;\nusing Microsoft.Azure.WebJobs.Extensions.Http;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.Extensions.Logging;\nusing System;\nusing System.Data.SqlClient;\nusing System.Collections.Generic;\n\nnamespace AzureFunction\n{\n    public static class GetCustomerInfoFunction\n    {\n        &#91;FunctionName(\"GetCustomerInfo\")]\n        public static async Task&lt;IActionResult> Run(\n            &#91;HttpTrigger(AuthorizationLevel.Function, \"get\", \"post\", Route = null)] HttpRequest req,\n            ILogger log)\n        {\n            log.LogInformation(\"C# HTTP trigger function processed a request.\");\n\n            string id = req.Query&#91;\"id\"];\n            var results = new List&lt;string>();\n            var str = Environment.GetEnvironmentVariable(\"DefaultConnection\");\n            using (SqlConnection conn = new SqlConnection(str))\n            {\n                conn.Open();\n                var text = \"SELECT id, Name, Email \" +\n                           \"FROM &#91;dbo].&#91;Customers] \" +\n                           $\"Where id={id}\";\n\n                using (SqlCommand cmd = new SqlCommand(text, conn))\n                {\n                    \/\/ Execute the command and log the # rows affected.\n                    var reader = await cmd.ExecuteReaderAsync();\n                    while (reader.Read())\n                    {\n                        results.Add(reader.GetString(1));\n                    }\n                }\n            }\n\n            return new OkObjectResult(results);\n        }\n    }\n}\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"> Test Azure Function App locally<\/h2>\n\n\n\n<p>If you run azure function in visual studio it will gives you a local url like below<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"977\" height=\"514\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/azure-function-local.png\" loading=\"lazy\" alt=\"Test azure function locally\" class=\"wp-image-373\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/azure-function-local.png 977w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/azure-function-local-300x158.png 300w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/azure-function-local-768x404.png 768w\" sizes=\"auto, (max-width: 977px) 100vw, 977px\" \/><\/figure>\n\n\n\n<p>Now you can use this URL to test Function through tools like the postman. see below<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"847\" height=\"549\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/azure-function-local-2.png\" loading=\"lazy\" alt=\"Test azure function in postman\" class=\"wp-image-374\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/azure-function-local-2.png 847w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/azure-function-local-2-300x194.png 300w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/azure-function-local-2-768x498.png 768w\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Deploy Azure Function App.<\/h2>\n\n\n\n<p>Ideal deployment of Function app should be through CI\/CD pipelines. However, the easiest way to deploy function app is by using the Publish profile in Visual studio.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"986\" height=\"1024\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/publish-profile-986x1024.png\" loading=\"lazy\" alt=\"Azure function app &amp; Sql\" class=\"wp-image-370\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/publish-profile-986x1024.png 986w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/publish-profile-289x300.png 289w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/publish-profile-768x798.png 768w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/publish-profile.png 1000w\" sizes=\"auto, (max-width: 986px) 100vw, 986px\" \/><\/figure>\n\n\n\n<p>Specify environment variables. You can configure connection string as environment variable as well.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"450\" src=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/env-variables.png\" loading=\"lazy\" alt=\"Azure function app &amp; Sql\" class=\"wp-image-371\" srcset=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/env-variables.png 600w, https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2021\/02\/env-variables-300x225.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Dos and Don&#8217;ts for Azure Functions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>FunctionApp<\/strong><\/h3>\n\n\n\n<p>When you write Azure Functions you are writing an App. The main unit of development and unit of scale is an App<strong> <\/strong>and an App can have many functions. When you scale, you will scale the whole app.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Triggers<\/h3>\n\n\n\n<p>All of your functions should have a trigger. A function can only have one trigger. The trigger is the function&#8217;s listening source and data would be passed-in through trigger to process. <\/p>\n\n\n\n<p>You are not get charged when function is listening to a trigger. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Bindings<\/h3>\n\n\n\n<p>Bindings are the data you Pull-in or push-out from your function without having to directly integrate with service inside your code. a few examples of binding are<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>HTTP<\/li><li>Storage Queues<\/li><li>Cosmos DB<\/li><li>Event Hubs<\/li><li>Blob Storage<\/li><li>Service Bus Queues\/Topics<\/li><li>Event Grid<\/li><li>IoT Hub<\/li><li>and more &#8230;.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Monitoring Solutions<\/h2>\n\n\n\n<p>Always hook your Azure function app to monitoring solutions like Application insight. These tools give you a lot of insight into how your function is performing and how you can optimize your functions. <\/p>\n\n\n\n<p>Please remember in micro services architecture you are paying for executing time and resources. So you need to make sure all your resources are optimize  &amp; efficient. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Instances &amp; Resources<\/h2>\n\n\n\n<p>Azure function apps scale up and down automatically, it depends on number of requests. <\/p>\n\n\n\n<p>Each instance can run multiple requests and on scale up multiple of instance run at same time. In code your should leverage this by sharing code resources on execution. <\/p>\n\n\n\n<p>Avoid instantiate a lot of single-use variables. Always use Singleton coding pattern. The prime example is SQL client connection.<\/p>\n\n\n\n<p>If you wish to restrict amount of load a instance can have, you can define it in hosts.json file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure function apps are the perfect example of the KISS principle (Keep it stupid simple). In very simplest terms Azure Function is a piece of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":181,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,18],"tags":[11,19,32,23,55,56],"class_list":["post-195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dot-net-core","category-azure","tag-dot-net-core","tag-azure-functions","tag-developer","tag-development","tag-microservices","tag-visual-studio"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Azure Function Apps with .NET Core &amp; SQL server - Naveed Ul-Haq&#039;s blog<\/title>\n<meta name=\"description\" content=\"Azure function apps are a perfect example of the KISS principle. These are piece of code that runs based on a trigger - Naveed Ul-Haq&#039;s blog\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Azure Function Apps with .NET Core &amp; SQL server - Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"Azure function apps are a perfect example of the KISS principle. These are piece of code that runs based on a trigger - Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-14T23:14:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-14T23:16:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/11\/Azure.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Naveed Ul-Haq\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Ul-Haq\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/\"},\"author\":{\"name\":\"Naveed Ul-Haq\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"headline\":\"Azure Function Apps with .NET Core &#038; SQL server\",\"datePublished\":\"2021-02-14T23:14:43+00:00\",\"dateModified\":\"2021-02-14T23:16:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/\"},\"wordCount\":905,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Azure.jpg\",\"keywords\":[\".net core\",\"azure-functions\",\"developer\",\"development\",\"microservices\",\"visual-studio\"],\"articleSection\":[\".NET\",\"Azure\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/\",\"name\":\"Azure Function Apps with .NET Core & SQL server - Naveed Ul-Haq&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Azure.jpg\",\"datePublished\":\"2021-02-14T23:14:43+00:00\",\"dateModified\":\"2021-02-14T23:16:50+00:00\",\"description\":\"Azure function apps are a perfect example of the KISS principle. These are piece of code that runs based on a trigger - Naveed Ul-Haq&#039;s blog\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Azure.jpg\",\"contentUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2020\\\/11\\\/Azure.jpg\",\"width\":400,\"height\":400,\"caption\":\"azure\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/dot-net-core\\\/azure-function-apps-with-net-core-sql-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Azure Function Apps with .NET Core &#038; SQL server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\",\"name\":\"Naveed Ul-Haq's blog\",\"description\":\"AI, Optimizely, Azure &amp; more\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.naveedulhaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\",\"name\":\"Naveed Ul-Haq\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"caption\":\"Naveed Ul-Haq\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\"},\"description\":\"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\\\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\\\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.\",\"sameAs\":[\"https:\\\/\\\/www.naveedulhaq.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedulhaq\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Azure Function Apps with .NET Core & SQL server - Naveed Ul-Haq&#039;s blog","description":"Azure function apps are a perfect example of the KISS principle. These are piece of code that runs based on a trigger - Naveed Ul-Haq&#039;s blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/","og_locale":"en_GB","og_type":"article","og_title":"Azure Function Apps with .NET Core & SQL server - Naveed Ul-Haq&#039;s blog","og_description":"Azure function apps are a perfect example of the KISS principle. These are piece of code that runs based on a trigger - Naveed Ul-Haq&#039;s blog","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"2021-02-14T23:14:43+00:00","article_modified_time":"2021-02-14T23:16:50+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/11\/Azure.jpg","type":"image\/jpeg"}],"author":"Naveed Ul-Haq","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Ul-Haq","Estimated reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/"},"author":{"name":"Naveed Ul-Haq","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"headline":"Azure Function Apps with .NET Core &#038; SQL server","datePublished":"2021-02-14T23:14:43+00:00","dateModified":"2021-02-14T23:16:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/"},"wordCount":905,"commentCount":1,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/11\/Azure.jpg","keywords":[".net core","azure-functions","developer","development","microservices","visual-studio"],"articleSection":[".NET","Azure"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/","name":"Azure Function Apps with .NET Core & SQL server - Naveed Ul-Haq&#039;s blog","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/11\/Azure.jpg","datePublished":"2021-02-14T23:14:43+00:00","dateModified":"2021-02-14T23:16:50+00:00","description":"Azure function apps are a perfect example of the KISS principle. These are piece of code that runs based on a trigger - Naveed Ul-Haq&#039;s blog","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/#primaryimage","url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/11\/Azure.jpg","contentUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2020\/11\/Azure.jpg","width":400,"height":400,"caption":"azure"},{"@type":"BreadcrumbList","@id":"https:\/\/www.naveedulhaq.com\/index.php\/dot-net-core\/azure-function-apps-with-net-core-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"Azure Function Apps with .NET Core &#038; SQL server"}]},{"@type":"WebSite","@id":"https:\/\/www.naveedulhaq.com\/#website","url":"https:\/\/www.naveedulhaq.com\/","name":"Naveed Ul-Haq's blog","description":"AI, Optimizely, Azure &amp; more","publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.naveedulhaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9","name":"Naveed Ul-Haq","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","caption":"Naveed Ul-Haq"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g"},"description":"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.","sameAs":["https:\/\/www.naveedulhaq.com","https:\/\/www.linkedin.com\/in\/naveedulhaq\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/comments?post=195"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/195\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media\/181"}],"wp:attachment":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media?parent=195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}