%3CLINGO-SUB%20id%3D%22lingo-sub-1891574%22%20slang%3D%22en-US%22%3ERe%3A%20In%20preview%3A%20Azure%20Key%20Vault%20extension%20for%20Arc%20enabled%20servers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1891574%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20for%20Sharing%20with%20the%20Community%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F57258%22%20target%3D%22_blank%22%3E%40Ryan%20Puffer%3C%2FA%3E%26nbsp%3B%26nbsp%3B%3CIMG%20class%3D%22lia-deferred-image%20lia-image-emoji%22%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fhtml%2Fimages%2Femoticons%2Fcool_40x40.gif%22%20alt%3D%22%3Acool%3A%22%20title%3D%22%3Acool%3A%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1888739%22%20slang%3D%22en-US%22%3EIn%20preview%3A%20Azure%20Key%20Vault%20extension%20for%20Arc%20enabled%20servers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1888739%22%20slang%3D%22en-US%22%3E%3CP%3ELove%20them%20or%20hate%20them%2C%20certificates%20are%20an%20integral%20part%20of%20running%20applications.%20Whether%20you're%20securing%20a%20website%20with%20HTTPS%20or%20authenticating%20to%20another%20server%2C%20you'll%20always%20need%20a%20way%20to%20securely%20deploy%20and%20renew%20certificates%20on%20your%20servers.%20This%20can%20be%20difficult%20to%20orchestrate%20at%20scale%2C%20especially%20if%20you%20need%20to%20share%20the%20same%20certificate%20across%20multiple%20servers.%20That's%20why%20we're%20excited%20to%20announce%20the%20public%20preview%20of%20the%20Azure%20Key%20Vault%20certificate%20sync%20extension%20for%20Arc%20enabled%20servers!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Azure%20Key%20Vault%20extension%20simplifies%20deployment%20across%20multiple%20machines%20by%20making%20Key%20Vault%20the%20central%20place%20to%20keep%20your%20certificate%20up%20to%20date.%20Instead%20of%20individually%20copying%20the%20certificate%20to%20each%20machine%2C%20the%20PKI%20admin%20just%20has%20to%20upload%20or%20generate%20certificates%20in%20a%20Key%20Vault%20and%20configure%20which%20servers%20are%20allowed%20to%20download%20them.%20Then%2C%20the%20server%20admin%20deploys%20the%20Azure%20Key%20Vault%20extension%20to%20their%20servers--the%20same%20extension%20works%20for%20both%20Azure%20and%20Arc%20enabled%20servers--and%20specifies%20which%20certificates%20should%20be%20installed%20on%20the%20server%2C%20and%20how%20frequently%20the%20server%20should%20check%20for%20updates.%20From%20there%2C%20the%20extension%20takes%20care%20of%20the%20rest.%20It%20uses%20the%20unique%20managed%20identity%20assigned%20to%20every%20Arc%20enabled%20server%20to%20authenticate%20to%20Azure%20Key%20Vault%20and%20download%20the%20certificates.%20When%20it%20comes%20time%20to%20renew%20a%20certificate%2C%20the%20PKI%20admin%20only%20needs%20to%20update%20the%20copy%20in%20Key%20Vault.%20The%20extension%20will%20take%20care%20of%20downloading%20it%20to%20each%20server%20automatically.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22akv_flow.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F233656i7121E4DD6D0EFC93%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22akv_flow.png%22%20alt%3D%22akv_flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1207717900%22%20id%3D%22toc-hId--1207717925%22%3ETry%20it%20out%3C%2FH2%3E%0A%3CP%3EReady%20to%20try%20the%20AKV%20extension%20on%20your%20servers%3F%20Here's%20what%20you'll%20need%20to%20get%20started%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EAn%20Arc%20enabled%20server%20running%20Windows%2C%20Ubuntu%2016.04%2F18.04%2C%20or%20SUSE%20Linux%20Enterprise%20Server%2015.%20Don't%20have%20an%20Arc%20enabled%20server%20yet%3F%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fazure-arc%2Fservers%2Fonboard-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ELearn%20how%20to%20onboard%20a%20machine%3C%2FA%3E%20running%20on-premises%20or%20in%20another%20cloud.%3C%2FLI%3E%0A%3CLI%3EAn%20Azure%20Key%20Vault%20with%20at%20least%20one%20certificate%20in%20it.%20The%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fkey-vault%2Fcertificates%2Fquick-create-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAKV%20certificate%20quickstart%20article%3C%2FA%3E%20can%20help%20you%20get%20this%20set%20up%20(you%20can%20skip%20the%20%22export%20certificate%22%20step).%3C%2FLI%3E%0A%3CLI%3EThe%20Azure%20Connected%20Machine%20PowerShell%20module%20(Az.ConnectedMachine)%2C%20which%20can%20be%20installed%20on%20your%20local%20machine%20or%20used%20in%20the%20Azure%20Portal%20with%20Cloud%20Shell.%20You%20can%20manage%20Azure%20Key%20Vault%20and%20the%20AKV%20Extension%20with%20the%20Azure%20CLI%20module%2C%20but%20in%20this%20blog%20post%20we'll%20focus%20on%20PowerShell%20only.%26nbsp%3B%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--517156426%22%20id%3D%22toc-hId--517156451%22%3EPermissions%3C%2FH3%3E%0A%3CP%3EWith%20those%20resources%20created%2C%20the%20next%20step%20is%20to%20grant%20the%20Arc%20enabled%20server%20access%20to%20the%20certificate.%20Every%20Arc%20enabled%20server%20has%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Factive-directory%2Fmanaged-identities-azure-resources%2Foverview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esystem-assigned%20managed%20identity%3C%2FA%3E%20associated%20with%20it.%20The%20Azure%20Key%20Vault%20extension%20uses%20this%20identity%20when%20it%20needs%20to%20authenticate%20with%20your%20vault%20and%20retrieve%20the%20certificate.%20Every%20Arc%20enabled%20server%20needs%20GET%20and%20LIST%20permissions%20on%20the%20secrets%20in%20your%20Key%20Vault.%20For%20larger%20deployments%2C%20you%20may%20want%20to%20put%20your%20Arc%20enabled%20server%20identities%20in%20an%20AAD%20security%20group%20and%20grant%20that%20security%20group%20access%20to%20the%20vault%20instead.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20configure%20permissions%20on%20your%20vault%20by%20going%20to%20it%20in%20the%20Azure%20Portal%2C%20clicking%26nbsp%3B%3CSTRONG%3EAccess%20policies%20%3C%2FSTRONG%3Ein%20the%20navigation%20pane%2C%20and%20then%26nbsp%3B%3CSTRONG%3EAdd%20Access%20Policy%3C%2FSTRONG%3E.%20In%20the%26nbsp%3B%3CSTRONG%3ESecret%20permissions%3C%2FSTRONG%3E%20drop%20down%2C%20tick%20the%20boxes%20for%26nbsp%3B%3CSTRONG%3EGet%3C%2FSTRONG%3E%20and%26nbsp%3B%3CSTRONG%3EList%3C%2FSTRONG%3E.%20Then%2C%20next%20to%20Select%20Principal%2C%20click%26nbsp%3B%3CSTRONG%3ENone%20selected%3C%2FSTRONG%3E%20to%20open%20the%20AAD%20object%20picker.%20Search%20for%20your%20Arc%20enabled%20server%20by%20its%20name%2C%20click%20it%2C%20then%20click%26nbsp%3B%3CSTRONG%3ESelect%3C%2FSTRONG%3E.%20Click%26nbsp%3B%3CSTRONG%3EAdd%3C%2FSTRONG%3E%20to%20finish%20configuring%20the%20Arc%20enabled%20server's%20permissions%20then%20click%26nbsp%3B%3CSTRONG%3ESave%3C%2FSTRONG%3E%20to%20commit%20the%20change.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you're%20using%20the%20Azure%20Key%20Vault%20RBAC%20preview%2C%20grant%20the%20Arc%20enabled%20server%20the%26nbsp%3B%3CSTRONG%3EKey%20Vault%20Secrets%20User%20(preview)%26nbsp%3B%3C%2FSTRONG%3Erole%20in%20Access%20control%20(IAM)%20for%20the%20vault.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1970356407%22%20id%3D%22toc-hId-1970356382%22%3EDeploy%20the%20extension%20(Windows)%3C%2FH3%3E%0A%3CP%3EFinally%2C%20we%20just%20need%20to%20deploy%20the%20AKV%20extension%20to%20the%20Arc%20enabled%20server%20to%20tell%20it%20which%20certificates%20to%20sync%2C%20how%20frequently%20to%20check%20for%20updates%2C%20and%20where%20to%20put%20them%20on%20the%20machine.%20You'll%20need%20to%20update%20the%20script%20below%20with%20your%20own%26nbsp%3B%3CSTRONG%3Eobserved%20certificate%20URIs%2C%20Arc%20server%20resource%20group%20name%2C%20location%2C%20and%20resource%20name.%3C%2FSTRONG%3E%20To%20deploy%20it%2C%20you'll%20need%20the%20Az.ConnectedMachine%20PowerShell%20module%2C%20which%20can%20be%20obtained%20by%20running%20Install-Module%20Az.ConnectedMachine.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24Settings%20%3D%20%40%7B%0A%20%20secretsManagementSettings%20%3D%20%40%7B%0A%20%20%20%20observedCertificates%20%3D%20%40(%0A%20%20%20%20%20%20%22https%3A%2F%2FYOURVAULTNAME.vault.azure.net%2Fsecrets%2FYOURCERTIFICATENAME%22%0A%20%20%20%20%20%20%23%20Add%20more%20here%20in%20a%20comma%20separated%20list%0A%20%20%20%20)%0A%20%20%20%20certificateStoreLocation%20%3D%20%22LocalMachine%22%0A%20%20%20%20certificateStoreName%20%3D%20%22My%22%0A%20%20%20%20pollingIntervalInS%20%3D%20%223600%22%20%23%20every%20hour%0A%20%20%7D%0A%20%20authenticationSettings%20%3D%20%40%7B%0A%20%20%20%20%23%20Don't%20change%20this%20line%2C%20it's%20required%20for%20Arc%20enabled%20servers%0A%20%20%20%20msiEndpoint%20%3D%20%22http%3A%2F%2Flocalhost%3A40342%2Fmetadata%2Fidentity%22%0A%20%20%7D%0A%7D%0A%0A%24ResourceGroup%20%3D%20%22ARC_SERVER_RG_NAME%22%0A%24ArcMachineName%20%3D%20%22ARC_SERVER_NAME%22%0A%24Location%20%3D%20%22ARC_SERVER_LOCATION%20(e.g.%20eastus2)%22%0A%0ANew-AzConnectedMachineExtension%20-ResourceGroupName%20%24ResourceGroup%20-MachineName%20%24ArcMachineName%20-Name%20%22KeyVaultForWindows%22%20-Location%20%24Location%20-Publisher%20%22Microsoft.Azure.KeyVault%22%20-ExtensionType%20%22KeyVaultForWindows%22%20-Setting%20(ConvertTo-Json%20%24Settings)%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWait%20for%20the%20extension%20to%20finish%20installing%2C%20then%20check%20the%20Local%20Machine%20certificate%20store.%20You%20should%20see%20your%20certificate!%20If%20the%20extension%20deployed%20successfully%20but%20you%20aren't%20seeing%20the%20certificate%2C%20double%20check%20that%20the%20server%20has%20GET%20and%20LIST%20access%20to%20secrets%20in%20the%20vault.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-162901944%22%20id%3D%22toc-hId-162901919%22%3EDeploy%20the%20extension%20(Linux)%3C%2FH3%3E%0A%3CP%3EThe%20extension%20works%20almost%20the%20same%20for%20Linux%2C%20except%20instead%20of%20putting%20the%20certificate%20in%20a%20certificate%20store%2C%20you'll%20pick%20a%20path%20on%20the%20filesystem%20to%20place%20it.%20You'll%20need%20to%20update%20the%20script%20below%20with%20your%20own%26nbsp%3B%3CSTRONG%3Eobserved%20certificate%20URIs%2C%20Arc%20server%20resource%20group%20name%2C%20location%2C%20and%20resource%20name.%3C%2FSTRONG%3E%20To%20deploy%20it%2C%20you'll%20need%20the%20Az.ConnectedMachine%20PowerShell%20module%2C%20which%20can%20be%20obtained%20by%20running%20Install-Module%20Az.ConnectedMachine.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24Settings%20%3D%20%40%7B%0A%20%20secretsManagementSettings%20%3D%20%40%7B%0A%20%20%20%20observedCertificates%20%3D%20%40(%0A%20%20%20%20%20%20%22https%3A%2F%2FYOURVAULTNAME.vault.azure.net%2Fsecrets%2FYOURCERTIFICATENAME%22%0A%20%20%20%20%20%20%23%20Add%20more%20here%2C%20don't%20forget%20a%20comma%20on%20the%20preceding%20line%0A%20%20%20%20)%0A%20%20%20%20%23%20The%20cert%20store%20location%20is%20optional%2C%20the%20default%20path%20is%20shown%20below%0A%20%20%20%20%23%20certificateStoreLocation%20%3D%20%22%2Fvar%2Flib%2Fwaagent%2FMicrosoft.Azure.KeyVault.Store%2F%22%0A%20%20%20%20pollingIntervalInS%20%3D%20%223600%22%20%23%20every%20hour%0A%20%20%7D%0A%20%20authenticationSettings%20%3D%20%40%7B%0A%20%20%20%20msiEndpoint%20%3D%20%22http%3A%2F%2Flocalhost%3A40342%2Fmetadata%2Fidentity%22%0A%20%20%7D%0A%7D%0A%0A%24ResourceGroup%20%3D%20%22ARC_SERVER_RESOURCE_GROUP_NAME%22%0A%24ArcMachineName%20%3D%20%22ARC_SERVER_NAME%22%0A%24Location%20%3D%20%22ARC_SERVER_LOCATION%20(e.g.%20eastus2)%22%0A%0ANew-AzConnectedMachineExtension%20-ResourceGroupName%20%24ResourceGroup%20-MachineName%20%24ArcMachineName%20-Name%20%22KeyVaultForLinux%22%20-Location%20%24Location%20-Publisher%20%22Microsoft.Azure.KeyVault%22%20-ExtensionType%20%22KeyVaultForLinux%22%20-Setting%20(ConvertTo-Json%20%24Settings)%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWait%20for%20the%20extension%20to%20finish%20installing%2C%20then%20check%20the%20%3CSTRONG%3E%2Fvar%2Flib%2Fwaagent%2FMicrosoft.Azure.KeyVault.Store%2F%3C%2FSTRONG%3E%20directory%20to%20find%20your%20certificate!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-152398840%22%20id%3D%22toc-hId-152398815%22%3ELearn%20more%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Key%20Vault%20Extension%20for%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fvirtual-machines%2Fextensions%2Fkey-vault-windows%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EWindows%3C%2FA%3E%20%2F%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fvirtual-machines%2Fextensions%2Fkey-vault-linux%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ELinux%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fkey-vault%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Key%20Vault%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Farc%2Fserver%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Arc%20enabled%20servers%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHave%20feedback%20on%20the%20AKV%20extension%3F%20Share%20it%20with%20us%20on%20%3CA%20href%3D%22https%3A%2F%2Ffeedback.azure.com%2Fforums%2F906355-azure-key-vault%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EUserVoice%3C%2FA%3E!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1888739%22%20slang%3D%22en-US%22%3E%3CP%3ESecurely%20deploy%20and%20update%20certificates%20with%20the%20Azure%20Key%20Vault%20extension%20for%20Arc%20enabled%20servers%2C%20now%20in%20public%20preview!%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1888739%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EServers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Love them or hate them, certificates are an integral part of running applications. Whether you're securing a website with HTTPS or authenticating to another server, you'll always need a way to securely deploy and renew certificates on your servers. This can be difficult to orchestrate at scale, especially if you need to share the same certificate across multiple servers. That's why we're excited to announce the public preview of the Azure Key Vault certificate sync extension for Arc enabled servers!

 

The Azure Key Vault extension simplifies deployment across multiple machines by making Key Vault the central place to keep your certificate up to date. Instead of individually copying the certificate to each machine, the PKI admin just has to upload or generate certificates in a Key Vault and configure which servers are allowed to download them. Then, the server admin deploys the Azure Key Vault extension to their servers--the same extension works for both Azure and Arc enabled servers--and specifies which certificates should be installed on the server, and how frequently the server should check for updates. From there, the extension takes care of the rest. It uses the unique managed identity assigned to every Arc enabled server to authenticate to Azure Key Vault and download the certificates. When it comes time to renew a certificate, the PKI admin only needs to update the copy in Key Vault. The extension will take care of downloading it to each server automatically.

 

akv_flow.png

 

 

Try it out

Ready to try the AKV extension on your servers? Here's what you'll need to get started:

  1. An Arc enabled server running Windows, Ubuntu 16.04/18.04, or SUSE Linux Enterprise Server 15. Don't have an Arc enabled server yet? Learn how to onboard a machine running on-premises or in another cloud.
  2. An Azure Key Vault with at least one certificate in it. The AKV certificate quickstart article can help you get this set up (you can skip the "export certificate" step).
  3. The Azure Connected Machine PowerShell module (Az.ConnectedMachine), which can be installed on your local machine or used in the Azure Portal with Cloud Shell. You can manage Azure Key Vault and the AKV Extension with the Azure CLI module, but in this blog post we'll focus on PowerShell only. 

 

Permissions

With those resources created, the next step is to grant the Arc enabled server access to the certificate. Every Arc enabled server has a system-assigned managed identity associated with it. The Azure Key Vault extension uses this identity when it needs to authenticate with your vault and retrieve the certificate. Every Arc enabled server needs GET and LIST permissions on the secrets in your Key Vault. For larger deployments, you may want to put your Arc enabled server identities in an AAD security group and grant that security group access to the vault instead.

 

You can configure permissions on your vault by going to it in the Azure Portal, clicking Access policies in the navigation pane, and then Add Access Policy. In the Secret permissions drop down, tick the boxes for Get and List. Then, next to Select Principal, click None selected to open the AAD object picker. Search for your Arc enabled server by its name, click it, then click Select. Click Add to finish configuring the Arc enabled server's permissions then click Save to commit the change.

 

If you're using the Azure Key Vault RBAC preview, grant the Arc enabled server the Key Vault Secrets User (preview) role in Access control (IAM) for the vault.

 

Deploy the extension (Windows)

Finally, we just need to deploy the AKV extension to the Arc enabled server to tell it which certificates to sync, how frequently to check for updates, and where to put them on the machine. You'll need to update the script below with your own observed certificate URIs, Arc server resource group name, location, and resource name. To deploy it, you'll need the Az.ConnectedMachine PowerShell module, which can be obtained by running Install-Module Az.ConnectedMachine.

 

 

 

$Settings = @{
  secretsManagementSettings = @{
    observedCertificates = @(
      "https://YOURVAULTNAME.vault.azure.net/secrets/YOURCERTIFICATENAME"
      # Add more here in a comma separated list
    )
    certificateStoreLocation = "LocalMachine"
    certificateStoreName = "My"
    pollingIntervalInS = "3600" # every hour
  }
  authenticationSettings = @{
    # Don't change this line, it's required for Arc enabled servers
    msiEndpoint = "http://localhost:40342/metadata/identity"
  }
}

$ResourceGroup = "ARC_SERVER_RG_NAME"
$ArcMachineName = "ARC_SERVER_NAME"
$Location = "ARC_SERVER_LOCATION (e.g. eastus2)"

New-AzConnectedMachineExtension -ResourceGroupName $ResourceGroup -MachineName $ArcMachineName -Name "KeyVaultForWindows" -Location $Location -Publisher "Microsoft.Azure.KeyVault" -ExtensionType "KeyVaultForWindows" -Setting (ConvertTo-Json $Settings)

 

 

 

Wait for the extension to finish installing, then check the Local Machine certificate store. You should see your certificate! If the extension deployed successfully but you aren't seeing the certificate, double check that the server has GET and LIST access to secrets in the vault.

 

Deploy the extension (Linux)

The extension works almost the same for Linux, except instead of putting the certificate in a certificate store, you'll pick a path on the filesystem to place it. You'll need to update the script below with your own observed certificate URIs, Arc server resource group name, location, and resource name. To deploy it, you'll need the Az.ConnectedMachine PowerShell module, which can be obtained by running Install-Module Az.ConnectedMachine.

 

 

 

$Settings = @{
  secretsManagementSettings = @{
    observedCertificates = @(
      "https://YOURVAULTNAME.vault.azure.net/secrets/YOURCERTIFICATENAME"
      # Add more here, don't forget a comma on the preceding line
    )
    # The cert store location is optional, the default path is shown below
    # certificateStoreLocation = "/var/lib/waagent/Microsoft.Azure.KeyVault.Store/"
    pollingIntervalInS = "3600" # every hour
  }
  authenticationSettings = @{
    msiEndpoint = "http://localhost:40342/metadata/identity"
  }
}

$ResourceGroup = "ARC_SERVER_RESOURCE_GROUP_NAME"
$ArcMachineName = "ARC_SERVER_NAME"
$Location = "ARC_SERVER_LOCATION (e.g. eastus2)"

New-AzConnectedMachineExtension -ResourceGroupName $ResourceGroup -MachineName $ArcMachineName -Name "KeyVaultForLinux" -Location $Location -Publisher "Microsoft.Azure.KeyVault" -ExtensionType "KeyVaultForLinux" -Setting (ConvertTo-Json $Settings)

 

 

 

Wait for the extension to finish installing, then check the /var/lib/waagent/Microsoft.Azure.KeyVault.Store/ directory to find your certificate!

 

Learn more

 

Have feedback on the AKV extension? Share it with us on UserVoice!

 

1 Comment

Thank you for Sharing with the Community @Ryan Puffer  :cool: