{"id":5877,"date":"2018-10-10T06:31:20","date_gmt":"2018-10-10T13:31:20","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=5877"},"modified":"2025-06-13T19:27:58","modified_gmt":"2025-06-14T02:27:58","slug":"azure-key-vault-credentials","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/","title":{"rendered":"Azure Key Vault for Credentials"},"content":{"rendered":"<div class=\"paragraph\">\n<p><span style=\"font-weight: 400\">Azure Key Vault can store username and password and manage sensitive information in Azure. Once Azure Key Vaults stores the information, Azure services that you specify (and ONLY Azure services that you specify) can access it<\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In this blog post, I\u2019m going to show you how to use Azure Key Vault to store Couchbase Server credentials and access them from an Azure Function.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>This blog post on how to store database credentials and passwords in Azure Key Vault will be building on earlier blog posts about Couchbase on Azure, so you may want to review them before proceeding:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/azure-getting-started-easy-free\/\">Azure: Getting Started is Easy and Free<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/azure-functions-lazy-initialization-couchbase-server\/\">Azure Functions and Lazy Initialization with Couchbase Server<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/azure-functions-couchbase-server-video\/\">Azure Functions with Couchbase Server (video)<\/a><\/li>\n<li>Those should be enough to get you up to speed, but there are many more <a href=\"https:\/\/www.couchbase.com\/blog\/tag\/azure\/\">blog posts involving Azure<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>As always, if you want to follow along, you can find the <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/114AzureKeyVault\/src\">completed source on GitHub<\/a>.<\/p>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_installation_and_setup_of_couchbase_server\">Installation and Setup of Couchbase Server<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The rest of this post assumes you have a Couchbase Server setup on Azure. You can follow the above links to learn about this process (it\u2019s easy!).<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In my setup for this blog post, I created a cluster (which required you to create administrator credentials) and a single bucket called &#8220;mybucket&#8221;.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I\u2019m using Couchbase Enterprise Edition 5.5.2 since that\u2019s the easiest to setup on Azure. The Community edition and older versions of Couchbase should work just fine as well.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_creating_an_azure_key_vault\">Creating an Azure Key Vault<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>An Azure Key Vault can be created with the Azure Portal UI, or you can create it <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/key-vault\/key-vault-manage-with-cli2\">with the command line<\/a>. In an earlier post on using the <a href=\"https:\/\/www.couchbase.com\/blog\/aks-couchbase-kubernetes-operator\/\">Couchbase Kubernetes Operator with Azure<\/a>, I also used the command line. You may want to review that if you\u2019ve not used the <a href=\"https:\/\/docs.microsoft.com\/en-us\/cli\/azure\/get-started-with-azure-cli\">Azure command line<\/a> utility before.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>The first step only needs executed once per Azure subscription. Assuming your command line is set to the subscription you want, register the Azure Key Vault with that subscription with this command:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-PowerShell\">PS C:\\&gt; az provider register -n Microsoft.KeyVault<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>The next step is to create a vault. With this command you need to specify a resource group. I created a resource group in advance called &#8220;KeyVaultDemo&#8221;. I also decided to use the North Central US region of Azure.<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-PowerShell\">PS C:\\&gt; az keyvault create --name 'MyCouchbaseKeyVault' --resource-group KeyVaultDemo --location 'North Central US'<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>Azure will take a few moments to finish (but the process is asynchronous, so the command line prompt will appear immediately). The command line will tell you how to check on the progress.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Now that you have created the store username and password in Azure Key Vault created, you can start putting your secrets in it. I\u2019m going to store 4 pieces of information in my vault with these 4 commands:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-PowerShell\">PS C:\\&gt; az keyvault secret set --vault-name 'MyCouchbaseKeyVault' --name 'cbUsername' --value 'cbAdminUsername'\r\nPS C:\\&gt; az keyvault secret set --vault-name 'MyCouchbaseKeyVault' --name 'cbPassword' --value 'r6#Y%2^XXXXX'\r\nPS C:\\&gt; az keyvault secret set --vault-name 'MyCouchbaseKeyVault' --name 'cbBucketName' --value 'mybucket'\r\nPS C:\\&gt; az keyvault secret set --vault-name 'MyCouchbaseKeyVault' --name 'cbClusterUri' --value 'https:\/\/52.162.XXX.XXX:8091'<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><em>(Note: I redacted some of the secret information using X\u2019s)<\/em><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>You can browse your secrets in the Azure Portal.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/10\/11401-azure-key-vault-ui.png\" alt=\"Azure Portal UI showing the Azure Key Vault\" \/><\/span><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_benefits_of_azure_key_vault\">Benefits of Azure Key Vault<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Before we go any further, let\u2019s talk about <em>why<\/em> you\u2019d want to use Azure Key Vault.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>In previous blog posts, I stored the Couchbase credentials as app settings. Compared to app settings, Azure Key Vault gives you the following credentials capabilities:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>App Settings stores values as plain text. Azure Key Vault stores them encrypted.<\/li>\n<li>Each application has its own app settings. With Azure Key Vault, each of your applications can share a single key vault.<\/li>\n<li>Azure Key Vault stores a version history of values, and each secret has an (optional) activation date and expiration date.<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Azure Key Vault doesn\u2019t <em>replace<\/em> app settings. Use of Azure Key Vault is best when you want to securely store sensitive information (like credentials\/passwords\/API keys) and\/or use them across multiple services.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_getting_azure_functions_ready_for_azure_key_vault\">Getting Azure Functions ready for Azure Key Vault<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>In a <a href=\"https:\/\/www.couchbase.com\/blog\/azure-functions-lazy-initialization-couchbase-server\/\">previous blog post on Azure Functions<\/a>, I stored the Couchbase credentials in app settings. Now that I have those credentials in an Azure Key Vault, I\u2019m going to change my Azure Functions code to use the Azure Key Vault instead.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>First, I created an Azure Functions service. You can create this from the Azure Portal UI, or from Visual Studio or Visual Studio Code directly. This time, I used Visual Studio Code (for more information, check out the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-azuretools.vscode-azurefunctions\">Azure Functions extension<\/a>). I happened to name my Azure Functions service <strong>cbkeyvaultdemo<\/strong>.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>Next, I made note of the URIs for each of the secrets that I created. I have 4 secrets, so I need 4 URIs (&#8220;Secret Identifier&#8221; as in this screenshot):<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/10\/11402-azure-key-vault-uris.png\" alt=\"Azure Key Vault URIs\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I created 4 constants and pasted these values into my code. (You may want to eventually store these in the app settings).<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">const string Vault_Bucketname_Uri = \"https:\/\/mycouchbasekeyvault.vault.azure.net\/secrets\/cbBucketName\/1bda709e1372465a8f03b6e8c3fb6014\";\r\nconst string Vault_Clusteruri_Uri = \"https:\/\/mycouchbasekeyvault.vault.azure.net\/secrets\/cbClusterUri\/48605e696b3645a6a7c396a15d636dc2\";\r\nconst string Vault_Username_Uri = \"https:\/\/mycouchbasekeyvault.vault.azure.net\/secrets\/cbUsername\/7d73ef5fa2174e5491d4a50a42bb0800\";\r\nconst string Vault_Password_Uri = \"https:\/\/mycouchbasekeyvault.vault.azure.net\/secrets\/cbPassword\/d6f61ff7e41a4fdcbe17de0b1fe1f115\";<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>The next step is to install a couple of packages with NuGet: <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.Azure.Services.AppAuthentication\">Microsoft.Azure.Services.AppAuthentication<\/a> and <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.Azure.KeyVault\/\">Microsoft.Azure.KeyVault<\/a>. Here\u2019s an example of installing those packages with the command line:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-PowerShell\">C:\\&gt; dotnet add package Microsoft.Azure.Services.AppAuthentication\r\nC:\\&gt; dotnet add package Microsoft.Azure.KeyVault<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_getting_secrets_from_azure_key_vault\">Getting Secrets from Azure Key Vault<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The next step is to write some code to fetch the secret values from the Azure Key Vault. I created a small helper function that I could reuse:<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">private static string GetSecret(string url)\r\n{\r\n    var azureServiceTokenProvider = new AzureServiceTokenProvider();\r\n    var kvClient = new KeyVaultClient(\r\n        new KeyVaultClient.AuthenticationCallback(\r\n            azureServiceTokenProvider.KeyVaultTokenCallback), client);\r\n    var secret = kvClient.GetSecretAsync(url).Result.Value;\r\n    return secret;\r\n}<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>As before, I\u2019ll be using <a href=\"https:\/\/www.couchbase.com\/blog\/azure-functions-lazy-initialization-couchbase-server\/\">Lazy initialization<\/a> in this Azure function. Here\u2019s what it looks like when using app settings (before):<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">private static readonly Lazy&lt;IBucket&gt; Bucket = new Lazy&lt;IBucket&gt;(() =&gt;\r\n{\r\n\tvar uri = Environment.GetEnvironmentVariable(\"couchbaseUri\");\r\n\tvar bucketName = Environment.GetEnvironmentVariable(\"couchbaseBucketName\");\r\n\tvar username = Environment.GetEnvironmentVariable(\"couchbaseUsername\");\r\n\tvar password = Environment.GetEnvironmentVariable(\"couchbasePassword\");\r\n\r\n\tvar cluster = new Cluster(new ClientConfiguration\r\n\t{\r\n\t\tServers = new List&lt;Uri&gt; { new Uri(uri) }\r\n\t});\r\n\tcluster.Authenticate(username, password);\r\n\treturn cluster.OpenBucket(bucketName);\r\n});<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>And here\u2019s how it looks when I switch it to use the <code>GetBucket<\/code> helper method (after):<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight decode:true\"><code class=\"language-C#\">private static readonly Lazy&lt;IBucket&gt; Bucket = new Lazy&lt;IBucket&gt;(() =&gt;\r\n{\r\n    var uri = GetSecret(Vault_Clusteruri_Uri);\r\n    var bucketName = GetSecret(Vault_Bucketname_Uri);\r\n    var username = GetSecret(Vault_Username_Uri);\r\n    var password = GetSecret(Vault_Password_Uri);\r\n    var cluster = new Cluster(new ClientConfiguration\r\n    {\r\n        Servers = new List&lt;Uri&gt; { new Uri(uri) }\r\n    });\r\n    cluster.Authenticate(username, password);\r\n    return cluster.OpenBucket(bucketName);\r\n});<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>One important thing to note about this helper function. Getting secrets from Azure Key Vault is an asynchronous operation. However, <code>Lazy<\/code> expects a synchronous lambda. One option is to use Stephen Cleary\u2019s <a href=\"https:\/\/github.com\/StephenCleary\/AsyncEx\/wiki\/AsyncLazy\">AsyncLazy<\/a>. Another option (which is what I did) is to call an asynchronous method synchronously by using <code>.Result<\/code>.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p><strong>Where did <code>client<\/code> come from?<\/strong> Easy, I added <code>private static HttpClient client = new HttpClient();<\/code> to the class. You can <a href=\"https:\/\/github.com\/couchbaselabs\/blog-source-code\/tree\/master\/Groves\/114AzureKeyVault\/src\">check out the full source code on GitHub<\/a>.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>I mainly followed this excellent blog post by Jeff Hollan called <a href=\"https:\/\/medium.com\/statuscode\/getting-key-vault-secrets-in-azure-functions-37620fd20a0b\">Getting Key Vault Secrets in Azure Functions<\/a> (except he stored an EventHub connection string and I\u2019m storing Couchbase credentials).<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_authorization\">Authorization<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>You might be asking: Matt, why did you publish the real URIs in your sample code?<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>It\u2019s because the URIs themselves are not sensitive secrets. Only services that are authorized by Azure can actually get useful information from these URIs.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>To authorize this Azure Function service, you need to do two things:<\/p>\n<\/div>\n<div class=\"olist arabic\">\n<ol class=\"arabic\">\n<li><strong>Enable a managed service identity<\/strong> for the Azure Functions service. This is as easy as clicking &#8220;Managed service identity&#8221; in the Azure portal and changing an &#8220;off&#8221; to an &#8220;on&#8221;.<\/li>\n<\/ol>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/10\/11403-managed-service-identity.png\" alt=\"Managed Service Identity\" \/><\/span><\/p>\n<\/div>\n<div class=\"olist arabic\">\n<ol class=\"arabic\" start=\"2\">\n<li><strong>Add an access policy to your Azure Key Vault<\/strong>. Simply find the Azure Key Vault in the Azure portal UI, click &#8220;Access policies&#8221; under settings, and add a new access policy. You can define fine-grained permissions for accessing Key, Secret, and Certificates (which Azure Key Vault can also store, by the way). I only needed &#8220;Get&#8221; permissions, so my access policy was very simple:<\/li>\n<\/ol>\n<\/div>\n<div class=\"paragraph\">\n<p><span class=\"image\"><img decoding=\"async\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2018\/10\/11404-access-policy.png\" alt=\"Access policy\" \/><\/span><\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>That\u2019s it. But without this important step, the key vault will allow no person or application to fetch a key.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_summary_and_next_steps\">Summary and Next Steps<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Instead of deploying Azure Functions (or other application services) with Couchbase credentials stored in the application settings, we can now put those credentials (and any other sensitive information) into an Azure Key Vault.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>We give application(s) permission to access the secrets in the vault, and Azure will prevent anyone else from getting those secrets.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>The application(s) pull the secrets from the Azure Key Vault.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If you have any questions about this blog post, feel free to leave a comment below or find me on <a href=\"https:\/\/twitter.com\/mgroves\">Twitter @mgroves<\/a>.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If you are using Couchbase with Azure, the entire <a href=\"https:\/\/community.couchbase.com\/\">Couchbase Community<\/a> would love to hear from your experience. Or, if you are just getting into Couchbase with Azure, you can also <a href=\"https:\/\/community.couchbase.com\/\">find and ask other community members<\/a> for their advice or high-level recommendations.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>If you have a specific technical question about Couchbase, please check out the <a href=\"https:\/\/www.couchbase.com\/forums\/\">Couchbase Forums<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Azure Key Vault can store username and password and manage sensitive information in Azure. Once Azure Key Vaults stores the information, Azure services that you specify (and ONLY Azure services that you specify) can access it In this blog post, [&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,2225,1816,1813],"tags":[1673],"ppma_author":[8937],"class_list":["post-5877","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-cloud","category-couchbase-server","category-security","tag-microsoft-azure"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Azure Key Vault for Credentials, Store Username and Password<\/title>\n<meta name=\"description\" content=\"This Couchbase blog post demonstrates how Azure Key Vault can be utilized to store Couchbase Server credentials and access them from an Azure Function.\" \/>\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-key-vault-credentials\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Azure Key Vault for Credentials\" \/>\n<meta property=\"og:description\" content=\"This Couchbase blog post demonstrates how Azure Key Vault can be utilized to store Couchbase Server credentials and access them from an Azure Function.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-10T13:31:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T02:27:58+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-key-vault-credentials\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/\"},\"author\":{\"name\":\"Matthew Groves\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58\"},\"headline\":\"Azure Key Vault for Credentials\",\"datePublished\":\"2018-10-10T13:31:20+00:00\",\"dateModified\":\"2025-06-14T02:27:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/\"},\"wordCount\":1280,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg\",\"keywords\":[\"Microsoft Azure\"],\"articleSection\":[\".NET\",\"Couchbase Capella\",\"Couchbase Server\",\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/\",\"name\":\"Azure Key Vault for Credentials, Store Username and Password\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg\",\"datePublished\":\"2018-10-10T13:31:20+00:00\",\"dateModified\":\"2025-06-14T02:27:58+00:00\",\"description\":\"This Couchbase blog post demonstrates how Azure Key Vault can be utilized to store Couchbase Server credentials and access them from an Azure Function.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#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-key-vault-credentials\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Azure Key Vault for Credentials\"}]},{\"@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 Key Vault for Credentials, Store Username and Password","description":"This Couchbase blog post demonstrates how Azure Key Vault can be utilized to store Couchbase Server credentials and access them from an Azure Function.","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-key-vault-credentials\/","og_locale":"en_US","og_type":"article","og_title":"Azure Key Vault for Credentials","og_description":"This Couchbase blog post demonstrates how Azure Key Vault can be utilized to store Couchbase Server credentials and access them from an Azure Function.","og_url":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/","og_site_name":"The Couchbase Blog","article_published_time":"2018-10-10T13:31:20+00:00","article_modified_time":"2025-06-14T02:27:58+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-key-vault-credentials\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/"},"author":{"name":"Matthew Groves","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/3929663e372020321b0152dc4fa65a58"},"headline":"Azure Key Vault for Credentials","datePublished":"2018-10-10T13:31:20+00:00","dateModified":"2025-06-14T02:27:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/"},"wordCount":1280,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg","keywords":["Microsoft Azure"],"articleSection":[".NET","Couchbase Capella","Couchbase Server","Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/","url":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/","name":"Azure Key Vault for Credentials, Store Username and Password","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/08\/074-hero-Azure-Clouds.jpg","datePublished":"2018-10-10T13:31:20+00:00","dateModified":"2025-06-14T02:27:58+00:00","description":"This Couchbase blog post demonstrates how Azure Key Vault can be utilized to store Couchbase Server credentials and access them from an Azure Function.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/azure-key-vault-credentials\/#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-key-vault-credentials\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Azure Key Vault for Credentials"}]},{"@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\/5877","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=5877"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/5877\/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=5877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=5877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=5877"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=5877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}