{"id":3923,"date":"2017-08-09T01:00:47","date_gmt":"2017-08-09T08:00:47","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=3923"},"modified":"2025-06-13T20:57:02","modified_gmt":"2025-06-14T03:57:02","slug":"azure-functions-couchbase-server","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/","title":{"rendered":"Azure Functions with Couchbase Server"},"content":{"rendered":"<div class=\"paragraph\">\n<p>Azure Functions are Microsoft\u2019s answer to Amazon\u2019s Lambdas or Google\u2019s Cloud Functions (aka &#8220;serverless&#8221; architecture). They give you a way to deploy small pieces of code, and let Azure handle the underlying server. I\u2019ve never used them before, so I thought I would give them a try beyond &#8220;Hello, World&#8221;, by getting them to work with Couchbase Server.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>There are <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/azure-functions\/\">more options<\/a> in Azure Functions beyond simple HTTP events (e.g. Blob triggers, GitHub webhooks, Azure Storage queue triggers, etc). But, for this blog post, I\u2019m going to focus on just HTTP events. I\u2019ll create simple &#8220;Get&#8221; and &#8220;Set&#8221; endpoints that interact with Couchbase Server.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Before beginning, you can follow along by getting the <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/074AzureFunctions\/src\/CouchbaseWithAzureFunctions\">source code for this blog post<\/a> on GitHub.<\/p>\n<p>Also, please read the <a href=\"https:\/\/www.couchbase.com\/blog\/azure-functions-lazy-initialization-couchbase-server\/\">Azure Functions and Lazy Initialization with Couchbase Server post<\/a>. It contains an important update about using Couchbase Server and Azure Functions.<\/p>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_getting_setup_to_develop_azure_functions\">Getting setup to develop Azure Functions<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>For this blog post, I decided to try <a href=\"https:\/\/www.visualstudio.com\/vs\/preview\/\">Visual Studio Preview<\/a>.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07404-Add-Azure-Function.png\" alt=\"Visual Studio Preview\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I did this because there is a <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=AndrewBHall-MSFT.AzureFunctionToolsforVisualStudio2017\">handy tool for creating<\/a> Azure Function projects in Visual Studio.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07402-Azure-Functions-tool-for-Visual-Studio.png\" alt=\"Azure Functions tool for Visual Studio\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>But it only works for the preview version at this time. You don\u2019t have to use these tools to develop Azure Functions, but it made the process simpler for me.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Once I had this tooling in place, all I had to was to File\u2192New\u2192Project. Then under &#8220;Cloud&#8221;, select &#8220;Azure Functions&#8221;.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07403-New-Azure-Functions.png\" alt=\"New Azure Functions in Visual Studio\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Once you do this, you\u2019ll have an empty looking project with a couple of JSON files. Right click on the project, add item, and select &#8220;Azure Function&#8221;.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07404-Add-Azure-Function.png\" alt=\"Add Azure Function\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Next, you\u2019ll need to select what kind of Azure Function you want to create. I chose &#8220;HttpTrigger&#8221;. I also chose &#8220;Anonymous&#8221; to keep this post simple, but depending on your use case, you may want to require an authentication token. After you do this, a very simple shell of a function will be generated (as a C# class). You can execute this function locally (indeed, that is what the local.settings.json file is for) so you can test it out without deploying to Azure yet.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_writing_a_get_function\">Writing a &#8220;Get&#8221; function<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>First, I decided that I wanted two Azure Functions: one to &#8220;get&#8221; a piece of data by ID, and one to &#8220;set&#8221; a new piece of given data. I started by defining the shape of my data with a simple C# POCO:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">public class MyDocument\r\n{\r\n    public string Name { get; set; }\r\n    public int ShoeSize { get; set; }\r\n    public decimal Balance { get; set; }\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>Here is the Azure function that I wrote to &#8220;get&#8221; that document from Couchbase Server:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">public static async Task&lt;HttpResponseMessage&gt; Get([HttpTrigger(AuthorizationLevel.Anonymous, \"get\", Route = null)]HttpRequestMessage req, TraceWriter log)\r\n{\r\n    \/\/ parse query parameter\r\n    var id = req.GetQueryNameValuePairs()\r\n        .FirstOrDefault(q =&gt; string.Compare(q.Key, \"id\", true) == 0)\r\n        .Value;\r\n\r\n    using (var cluster = GetCluster())\r\n    {\r\n        using (var bucket = GetBucket(cluster))\r\n        {\r\n            var doc = await bucket.GetAsync&lt;MyDocument&gt;(id);\r\n            return req.CreateResponse(HttpStatusCode.OK, doc.Value, new JsonMediaTypeFormatter());\r\n        }\r\n    }\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>Some things to note:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>I remove the <code>\"post\"<\/code> that was generated by the tooling, since I want this to only be a <code>\"get\"<\/code> function.<\/li>\n<li>Parsing the query parameter seems like a lot of extra code for this simple case. You can alternatively create a &#8220;function with parameters&#8221;<\/li>\n<li><code>GetCluster<\/code> and <code>GetBucket<\/code> will be discussed later in this post. But the short story is that I want this code to work both locally and deployed to Azure<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Next, run this function locally, and you\u2019ll get a console screen that looks similar to this:<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07405-Azure-Functions-running-locally.png\" alt=\"Azure Functions running locally\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>At the bottom, you\u2019ll notice that it tells you the Azure Function URL(s). Assuming I had a document in Couchbase (I don\u2019t yet), I could create an HTTP request with <a href=\"https:\/\/www.getpostman.com\/\">a tool like Postman<\/a> to: <code><a class=\"bare\" href=\"https:\/\/localhost:7071\/api\/HttpTriggerCsharpGet?id=123456\">https:\/\/localhost:7071\/api\/HttpTriggerCsharpGet?id=123456<\/a><\/code><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Currently, if I do that, I\u2019ll get &#8220;null&#8221; as a response (since I don\u2019t have any validation or error checking code). So let\u2019s move on and create a &#8220;Set&#8221; function.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_writing_a_set_function\">Writing a &#8220;Set&#8221; function<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The &#8220;Set&#8221; function will be slightly different. I want document information POSTed to it, and I want it to return a message like &#8220;New document inserted with ID 123456&#8221;.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">public static async Task&lt;HttpResponseMessage&gt; Set([HttpTrigger(AuthorizationLevel.Anonymous, \"post\", Route = null)] MyDocument req, TraceWriter log)\r\n{\r\n\r\n    var id = Guid.NewGuid().ToString();\r\n\r\n    using (var cluster = GetCluster())\r\n    {\r\n        using (var bucket = GetBucket(cluster))\r\n        {\r\n            await bucket.InsertAsync(id, req);\r\n        }\r\n    }\r\n\r\n    return new HttpResponseMessage\r\n    {\r\n        Content = new StringContent($\"New document inserted with ID {id}\"),\r\n        StatusCode = HttpStatusCode.OK\r\n    };\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>This function has a similar shape to the Get, but some important things to note:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>There is only <code>\"post\"<\/code> in the HttpTrigger attribute.<\/li>\n<li>Instead of <code>HttpRequestMessage<\/code> as the first parameter, I\u2019ve decided to use <code>MyDocument<\/code>, and let Azure Functions do the binding for me.<\/li>\n<li>Since I don\u2019t have <code>HttpRequestMessage<\/code>, I can\u2019t call its <code>CreateResponse<\/code> method, so instead I instantiate a new <code>HttpResponseMessage<\/code> directly to return the success message at the end.<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>To create a request in Postman, I\u2019ll use a URL of <code><a class=\"bare\" href=\"https:\/\/localhost:7071\/api\/HttpTriggerCsharpSet\">https:\/\/localhost:7071\/api\/HttpTriggerCsharpSet<\/a><\/code>. In the headers, I\u2019ll set <code>Content-Type<\/code> to &#8220;application\/json&#8221;. Finally, the body will be JSON:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-JavaScript\">{\r\n    \"Name\": \"matthew\",\r\n    \"Balance\": 107.18,\r\n    \"ShoeSize\": 14\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>Now, when I POST that to the endpoint, I\u2019ll get a response message of &#8220;New document inserted with ID f05ea97e-7c2f-4f88-b72d-19756f6a6f35&#8221;.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_connecting_to_couchbase_server\">Connecting to Couchbase Server<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>I have glossed over how these functions connect to Couchbase Server.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Previously, I mentioned two methods, <code>GetCluster<\/code> and <code>GetBucket<\/code> that will connect to the cluster and bucket, respectively.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">private static Cluster GetCluster()\r\n{\r\n    var uri = ConfigurationManager.AppSettings[\"couchbaseUri\"];\r\n    return new Cluster(new ClientConfiguration\r\n    {\r\n        Servers = new List&lt;Uri&gt; { new Uri(uri) }\r\n    });\r\n}\r\n\r\nprivate static IBucket GetBucket(Cluster cluster)\r\n{\r\n    var bucketName = ConfigurationManager.AppSettings[\"couchbaseBucketName\"];\r\n    var bucketPassword = ConfigurationManager.AppSettings[\"couchbaseBucketPassword\"];\r\n\r\n    return cluster.OpenBucket(bucketName, bucketPassword);\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>At this point, most of this code should be familiar if you\u2019ve used Couchbase Server and the Couchbase .NET SDK before. I\u2019m connecting to a single node cluster, and then connecting a bucket that has a password set (I\u2019m using Couchbase Server 4.6).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>But, the important thing to point out here is the use of <code>Configuration.AppSettings<\/code>. In the <code>local.settings.json<\/code> file, I\u2019ve added these Couchbase settings to the Value section:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-JavaScript\">{\r\n  \"IsEncrypted\": false,\r\n  \"Values\": {\r\n    \"AzureWebJobsStorage\": \"\",\r\n    \"AzureWebJobsDashboard\": \"\",\r\n    \"couchbaseUri\": \"https:\/\/localhost:8091\",\r\n    \"couchbaseBucketName\": \"azurefunctions\",\r\n    \"couchbaseBucketPassword\": \"Password88!\"\r\n  }\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>When running Azure Functions locally, this file is used for configuration. I have Couchbase Server running locally with a bucket called &#8220;azurefunctions&#8221;. Anything in &#8220;Values&#8221; can be accessed via <code>Configuration.AppSettings<\/code>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_deploying_to_azure\">Deploying to Azure<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Before deploying the Azure Functions, I\u2019ll need to create a Couchbase Cluster on Azure. This is very easy to do, thanks to Ben Lackey\u2019s great work on the Azure Marketplace. Once that\u2019s deployed, deploying the Azure Functions are also easy, thanks to Visual Studio.<\/p>\n<\/div>\n<div class=\"sect2\">\n<h3 id=\"_deploying_couchbase_server_to_azure\">Deploying Couchbase Server to Azure<\/h3>\n<div class=\"paragraph\">\n<p>Here is a short video walking you through the process of creating a Couchbase Server cluster on Azure.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>[youtube https:\/\/www.youtube.com\/watch?v=q9mBBu0YqJI&amp;w=560&amp;h=315]<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>For my example, I followed that video closely. Here is step 1, where I configure the username, password, and resource group.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07406-Create-Couchbase-cluster-step-1.png\" alt=\"Create Couchbase Cluster step 1\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>For the second step, I only created a single node cluster on the smallest, cheapest VM (DS1 v2). I created 0 Sync Gateway nodes, since I\u2019m not using Sync Gateway for this example.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07407-Create-Couchbase-cluster-step-2.png\" alt=\"Create Couchbase Cluster step 1\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Step 3 is just a summary, and step 4 is a confirmation. It will take 3-5 minutes for the Couchbase Cluster to start up in Azure.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Once the cluster is created, find the URL for the first node in the cluster (just as demonstrated in the above video). My URL looked something like: <code><a class=\"bare\" href=\"https:\/\/vm0.server-hsmkrefstzg2t.northcentralus.cloudapp.azure.com:8091\">https:\/\/vm0.server-hsmkrefstzg2t.northcentralus.cloudapp.azure.com:8091<\/a><\/code>. Go to this URL, login, and create a bucket (I called mine &#8220;azurefunctions&#8221;, just like I did locally).<\/p>\n<\/div>\n<\/div>\n<div class=\"sect2\">\n<h3 id=\"_deploying_azure_functions_to_azure\">Deploying Azure Functions to Azure<\/h3>\n<div class=\"paragraph\">\n<p>Now, Couchbase Server is running. So let\u2019s deploy the Azure Functions that will interact with it.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>To begin, right-click the project in Visual Studio and select &#8220;publish&#8221;. You\u2019ll need to create a new publish profile the first time you do this, but that\u2019s easy.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07408-Publish-Azure-Functions.png\" alt=\"Publish Azure functions\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Give your functions an app name, select a subscription, select a resource group (you can create a new one, or use the same group that you created above for Couchbase), select a service plan, and finally a storage account. You can create new ones when necessary.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07409-Create-Publish-Profile.png\" alt=\"Create Publish Profile\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Click &#8220;create&#8221; and these items will start to be created in Azure (it may take a minute or two).<\/p>\n<\/div>\n<\/div>\n<div class=\"sect2\">\n<h3 id=\"_trying_out_the_azure_functions\">Trying out the Azure Functions<\/h3>\n<div class=\"paragraph\">\n<p>Finally, remember that the Azure Functions need to know the URI, bucket name, and password in order to connect to Couchbase Server. That information is in local.settings.json, but that file is not used for actual Azure deployments.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In the Azure portal, navigate to the Azure function (I called mine cbazurefunctions), and then select &#8220;Application Settings&#8221;. Under &#8220;App settings&#8221;, enter those three settings: couchbaseUri, couchbaseBucketName, and couchbaseBucketPassword.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/08\/07410-Azure-Functions-App-settings.png\" alt=\"Azure Functions App settings\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Now, repeat the Postman process mentioned above to try out the Azure functions and make sure they work. Your URL will vary, but mine was <a class=\"bare\" href=\"https:\/\/cbazurefunctions.azurewebsites.net\/\">https:\/\/cbazurefunctions.azurewebsites.net\/<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_summary\">Summary<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>This is my first time trying out Azure Functions. This blog post shows a simple demo, but there are other factors to consider before you start using this in production:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>Authentication &#8211; I used anonymous Azure Functions to keep it simple. Azure Functions can also provide authentication tokens to use that prevent access except to authorized users.<\/li>\n<li>App settings &#8211; Setting them manually in the portal may not be the best solution. There is probably a way to automate that portion.<\/li>\n<li>HTTPS\/TLS &#8211; You will likely want to have some level of encryption as you are getting and posting data to your Azure Functions. The above example transmits everything in clear text.<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Anything I missed? Any more tips or suggestions to share to make this process easier or better? Please leave a comment below or ping me on <a href=\"https:\/\/twitter.com\/mgroves\">Twitter @mgroves<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Azure Functions are Microsoft\u2019s answer to Amazon\u2019s Lambdas or Google\u2019s Cloud Functions (aka &#8220;serverless&#8221; architecture). They give you a way to deploy small pieces of code, and let Azure handle the underlying server. I\u2019ve never used them before, so I [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":3934,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1811,10127,1816],"tags":[1245,1673,1772],"ppma_author":[8937],"class_list":["post-3923","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-c-sharp","category-couchbase-server","tag-cloud","tag-microsoft-azure","tag-visual-studio"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Azure Functions with Couchbase Server - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Azure Functions are Microsoft&#039;s answer to &quot;serverless&quot;. With this post, you&#039;ll develop, deploy, and interact with Couchbase with Azure Functions.\" \/>\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.couchbase.com\/blog\/azure-functions-couchbase-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Azure Functions with Couchbase Server\" \/>\n<meta property=\"og:description\" content=\"Azure Functions are Microsoft&#039;s answer to &quot;serverless&quot;. With this post, you&#039;ll develop, deploy, and interact with Couchbase with Azure Functions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-09T08:00:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T03:57:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"922\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Matthew Groves\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mgroves\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Matthew Groves\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/\"},\"author\":{\"name\":\"Matthew Groves\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\"},\"headline\":\"Azure Functions with Couchbase Server\",\"datePublished\":\"2017-08-09T08:00:47+00:00\",\"dateModified\":\"2025-06-14T03:57:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/\"},\"wordCount\":1437,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg\",\"keywords\":[\"cloud\",\"Microsoft Azure\",\"Visual Studio\"],\"articleSection\":[\".NET\",\"C#\",\"Couchbase Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/\",\"name\":\"Azure Functions with Couchbase Server - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg\",\"datePublished\":\"2017-08-09T08:00:47+00:00\",\"dateModified\":\"2025-06-14T03:57:02+00:00\",\"description\":\"Azure Functions are Microsoft's answer to \\\"serverless\\\". With this post, you'll develop, deploy, and interact with Couchbase with Azure Functions.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg\",\"width\":1920,\"height\":922,\"caption\":\"National Cloud Database Day\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Azure Functions with Couchbase Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\",\"name\":\"Matthew Groves\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g\",\"caption\":\"Matthew Groves\"},\"description\":\"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.\",\"sameAs\":[\"https:\/\/crosscuttingconcerns.com\",\"https:\/\/x.com\/mgroves\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Azure Functions with Couchbase Server - The Couchbase Blog","description":"Azure Functions are Microsoft's answer to \"serverless\". With this post, you'll develop, deploy, and interact with Couchbase with Azure Functions.","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.couchbase.com\/blog\/azure-functions-couchbase-server\/","og_locale":"en_US","og_type":"article","og_title":"Azure Functions with Couchbase Server","og_description":"Azure Functions are Microsoft's answer to \"serverless\". With this post, you'll develop, deploy, and interact with Couchbase with Azure Functions.","og_url":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-08-09T08:00:47+00:00","article_modified_time":"2025-06-14T03:57:02+00:00","og_image":[{"width":1920,"height":922,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg","type":"image\/jpeg"}],"author":"Matthew Groves","twitter_card":"summary_large_image","twitter_creator":"@mgroves","twitter_misc":{"Written by":"Matthew Groves","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/"},"author":{"name":"Matthew Groves","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58"},"headline":"Azure Functions with Couchbase Server","datePublished":"2017-08-09T08:00:47+00:00","dateModified":"2025-06-14T03:57:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/"},"wordCount":1437,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg","keywords":["cloud","Microsoft Azure","Visual Studio"],"articleSection":[".NET","C#","Couchbase Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/","url":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/","name":"Azure Functions with Couchbase Server - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg","datePublished":"2017-08-09T08:00:47+00:00","dateModified":"2025-06-14T03:57:02+00:00","description":"Azure Functions are Microsoft's answer to \"serverless\". With this post, you'll develop, deploy, and interact with Couchbase with Azure Functions.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg","width":1920,"height":922,"caption":"National Cloud Database Day"},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Azure Functions with Couchbase Server"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58","name":"Matthew Groves","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/ba51e6aacc53995c323a634e4502ef54","url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","caption":"Matthew Groves"},"description":"Matthew D. Groves is a guy who loves to code. It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything. He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s. He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community. He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP.","sameAs":["https:\/\/crosscuttingconcerns.com","https:\/\/x.com\/mgroves"],"url":"https:\/\/www.couchbase.com\/blog\/author\/matthew-groves\/"}]}},"authors":[{"term_id":8937,"user_id":71,"is_guest":0,"slug":"matthew-groves","display_name":"Matthew Groves","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/70feb1b28a099ad0112b8d21fe1e81e1a4524beed3e20b7f107d5370e85a07ab?s=96&d=mm&r=g","author_category":"","last_name":"Groves","first_name":"Matthew","job_title":"","user_url":"https:\/\/crosscuttingconcerns.com","description":"Matthew D. Groves is a guy who loves to code.  It doesn't matter if it's C#, jQuery, or PHP: he'll submit pull requests for anything.  He has been coding professionally ever since he wrote a QuickBASIC point-of-sale app for his parent's pizza shop back in the 90s.  He currently works as a Senior Product Marketing Manager for Couchbase. His free time is spent with his family, watching the Reds, and getting involved in the developer community.  He is the author of AOP in .NET, Pro Microservices in .NET, a Pluralsight author, and a Microsoft MVP."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=3923"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/3923\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/3934"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=3923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=3923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=3923"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=3923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}