{"id":1100,"date":"2021-12-23T20:33:08","date_gmt":"2021-12-23T18:33:08","guid":{"rendered":"https:\/\/www.flip-design.de\/?p=1100"},"modified":"2021-12-23T20:33:08","modified_gmt":"2021-12-23T18:33:08","slug":"use-azure-keyvault-with-devops-to-secure-your-credentials","status":"publish","type":"post","link":"https:\/\/www.flip-design.de\/?p=1100","title":{"rendered":"Use Azure KeyVault with DevOps to secure your credentials"},"content":{"rendered":"\n<p>The most DevOps pipelines use variables to store credentials and other variables. With DevOps you have the possibility to hide\/encrypt data, but in an enterprise environment mostly KeyVaults are in use to store the sensitive data in a central store to provide better management. This post is to show you how you can use a KeyVault and use passwords in your pipeline. This post referrers to my last blog post and uses this pipeline.<\/p>\n\n\n\n<p>To start, I created an Azure KeyVault and I store inside a password which is able in combination with the username to start a Power BI deployment pipeline.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-14.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-14.png\" alt=\"\" class=\"wp-image-1101\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-14.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-14-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-14-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>Next, you need to create a service connection to your Azure tenant:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-15.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-15.png\" alt=\"\" class=\"wp-image-1102\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-15.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-15-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-15-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>Select Azure Resource Manager<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-16.png\"><img decoding=\"async\" loading=\"lazy\" width=\"772\" height=\"1011\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-16.png\" alt=\"\" class=\"wp-image-1103\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-16.png 772w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-16-229x300.png 229w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-16-768x1006.png 768w\" sizes=\"(max-width: 772px) 100vw, 772px\" \/><\/a><\/figure>\n\n\n\n<p>Select service principal<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-17.png\"><img decoding=\"async\" loading=\"lazy\" width=\"731\" height=\"516\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-17.png\" alt=\"\" class=\"wp-image-1104\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-17.png 731w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-17-300x212.png 300w\" sizes=\"(max-width: 731px) 100vw, 731px\" \/><\/a><\/figure>\n\n\n\n<p>Select your subscription and the Resource Group where the KeyVault is stored<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-18.png\"><img decoding=\"async\" loading=\"lazy\" width=\"735\" height=\"1004\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-18.png\" alt=\"\" class=\"wp-image-1105\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-18.png 735w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-18-220x300.png 220w\" sizes=\"(max-width: 735px) 100vw, 735px\" \/><\/a><\/figure>\n\n\n\n<p>After creating your Service Principal, you can get the name of it by clicking to the Manage link<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-19.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-19.png\" alt=\"\" class=\"wp-image-1106\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-19.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-19-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-19-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>After clicking at ServiePrincipal, you will get the name of it, and your can add the Access Policy:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-20.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-20.png\" alt=\"\" class=\"wp-image-1107\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-20.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-20-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-20-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>Select Get and List to get the Secrets and the content<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-21.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-21.png\" alt=\"\" class=\"wp-image-1108\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-21.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-21-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-21-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>Add your Service Principal which was created by DevOps<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-22.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-22.png\" alt=\"\" class=\"wp-image-1109\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-22.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-22-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-22-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>Don\u2019t forget to click Save. Next, back to Azure DevOps and refer to Library. Here you can add a new variable group which uses your KeyVault.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-23.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-23.png\" alt=\"\" class=\"wp-image-1110\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-23.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-23-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-23-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>You need click to Authorize to enable the connection. Next, you must go to your pipeline variables and add the newly created library<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-24.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-24.png\" alt=\"\" class=\"wp-image-1111\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-24.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-24-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-24-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>Inside your tasks you can use these variables. If your passwords contain some special characters, please put them into single quotes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-25.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-25.png\" alt=\"\" class=\"wp-image-1112\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-25.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-25-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-25-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-26.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-26.png\" alt=\"\" class=\"wp-image-1113\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-26.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-26-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-26-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-27.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-27.png\" alt=\"\" class=\"wp-image-1114\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-27.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-27-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-27-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p>By viewing the results, you can see the using of the KeyVault<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-28.png\"><img decoding=\"async\" loading=\"lazy\" width=\"945\" height=\"503\" src=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-28.png\" alt=\"\" class=\"wp-image-1115\" srcset=\"https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-28.png 945w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-28-300x160.png 300w, https:\/\/www.flip-design.de\/wp-content\/uploads\/2021\/12\/image-28-768x409.png 768w\" sizes=\"(max-width: 945px) 100vw, 945px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The most DevOps pipelines use variables to store credentials and other variables. With DevOps you have the possibility to hide\/encrypt data, but in an enterprise environment mostly KeyVaults are in use to store the sensitive data in a central store &hellip; <a href=\"https:\/\/www.flip-design.de\/?p=1100\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1100"}],"collection":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1100"}],"version-history":[{"count":1,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1100\/revisions"}],"predecessor-version":[{"id":1116,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=\/wp\/v2\/posts\/1100\/revisions\/1116"}],"wp:attachment":[{"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flip-design.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}