<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>The Official Azure Key Vault Team Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/kv/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/kv/feed.xml</link>
    <description>Your official source for all the latest news and tech tips for Microsoft Azure Key Vault and enlightened workloads.</description>
    <lastBuildDate>Thu, 25 Oct 2018 07:52:39 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Announcing Virtual Network Service Endpoints for Key Vault (preview)</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/announcing-virtual-network-service-endpoints-for-key-vault-preview</link>
      <pubDate>Fri, 31 Aug 2018 00:00:30 GMT</pubDate>
      <dc:creator><![CDATA[Amit Bapat [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=805</guid>
      <description><![CDATA[[Update: August 31, 2018 - This feature is now generally available. Refer to documentation for most...]]></description>
      <content:encoded><![CDATA[<span style="color: #ff0000">[Update: August 31, 2018 - This feature is now generally available. Refer to <a href="https://docs.microsoft.com/azure/key-vault/key-vault-overview-vnet-service-endpoints">documentation</a> for most up-to-date details. This post is maintained here for posterity.]</span>

[This blog is co-authored with Sumeet Mittal, Program Manager, Azure Networking]

Hello again!

We are excited to announce the public preview of a long requested feature for Key Vault.
So you are using Key Vault to store encryption keys, application secrets, certificates and you worry about the Key Vault service endpoint being accessible from public internet. There are a few scenarios here:
<ul>
 	<li>You want to lock down access to your key vault so that only your application or a short list of designated hosts can connect to your key vault</li>
 	<li>You have an application running in your Azure virtual network (VNET) and this VNET is completely locked down for all inbound and outbound traffic. Your application still needs to connect to key vault to either fetch secrets or certificates or use cryptographic keys.</li>
 	<li>You are using a key vault to store encryption keys used by Storage or Data Lake Store for service side encryption and you want to lock down access to this key vault from public internet.</li>
</ul>
If any of these scenarios applies to you, we have a new solution in preview. Please go ahead and give it a try and give us feedback.
<blockquote><i>As usual, we value your input so please take a moment to </i><a href="mailto:azurekeyvault@microsoft.com?subject=KVBlog"><b><i>send us private feedback</i></b></a> <i>and/or visit our </i><a href="https://social.msdn.microsoft.com/Forums/en-US/AzureKeyVault"><b><i>forum.</i></b></a></blockquote>
<b>Quick overview:</b>

So here's a quick summary of how it works.

The Virtual Network Service Endpoints for Key Vault allow customers to restrict access to key vault to specified Virtual Network and/or a list of IPv4 (Internet Protocol version 4) address ranges. Any caller connecting to that key vault from outside those sources will be denied access to this key vault. If customer has opted-in to allow "Trusted Microsoft services" such as Office 365 Exchange Online, Office 365 SharePoint Online, Azure compute, Azure Resource Manager, Azure Backup etc., connections from those services will be let through the firewall. Of course such callers still need to present a valid AAD token and must have the permissions to perform the requested operation. Read more technical details about <a href="https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview">Virtual Network Service Endpoints</a>.

<b>Note:</b> Key Vault firewalls and virtual network rules ONLY apply to key vault data plane (<a href="https://docs.microsoft.com/en-us/azure/key-vault/key-vault-secure-your-key-vault">read more</a> about control plane and data plane). Key Vault control plane operations (such as key vault create, delete, modify operations, setting access policies, setting firewalls and virtual network rules) are not affected by firewalls and virtual network rules.

<b>Note:</b> This feature is still in preview. It is strongly recommended to not use this feature for any production scenarios. APIs, command line tools, Azure Portal user interface may change as we incorporate customer feedback, fix bugs and make improvements.

So follow along to get started quickly.

<b>Setting up firewalls and virtual network rules:</b>

Here's quick overview of steps required to set firewalls and virtual network rules. These steps remain same irrespective of what interface you'll use to setup the firewalls and virtual network rules.
<ul>
 	<li><em>Optional but highly recommended</em>: Enable <a href="https://docs.microsoft.com/en-us/azure/key-vault/key-vault-logging">key vault logging</a> to see detailed access logs. This will help you in diagnostics when firewalls and virtual network rules prevent access to a key vault.</li>
 	<li>Enable 'service endpoints for key vault' for target virtual network(s) and subnet(s)</li>
 	<li>Set firewalls and virtual network rules for a key vault to restrict access to that key vault from specific virtual network(s), subnet(s) and IPv4 address ranges.</li>
 	<li>A maximum 127 VNET rules and 127 IPv4 rules are allowed.</li>
</ul>
<b>Using Azure Portal</b>
<ul>
 	<li>Visit <a href="https://portal.azure.com/">Azure Portal</a></li>
 	<li>Use existing key vault or create new key vault as necessary.</li>
 	<li>Visit the key vault blade for which you want to set firewalls and virtual network rules.
<ul>
 	<li>Azure Portal dashboard -&gt; All Services -&gt; click on 'Key vaults' under 'Security' section (you need to scroll down) -&gt; Click on the key vault name.</li>
</ul>
</li>
 	<li>Click on 'Firewalls and virtual networks'. <b>Note: </b>You'll only see this item listed if you use the above Azure Portal URI.</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/06/Key-Vault-Blade.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/06/Key-Vault-Blade.png" alt="" width="782" height="749" class="alignnone size-full wp-image-835" /></a></p>

<ul>
 	<li>Click on 'Selected networks' under 'Allow access from:'</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/06/Select-Networks.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/06/Select-Networks.png" alt="" width="689" height="616" class="alignnone size-full wp-image-825" /></a></p>

<ul>
 	<li>To add existing virtual networks to firewalls and virtual network rules, click '+ Add existing virtual networks'.</li>
 	<li>In the new blade that pops up, select the subscription, virtual network(s), and subnet(s) that you want to allow access to this key vault. If the virtual network(s) and subnet(s) you select do not have service endpoints enabled you'll a message as shown below. Click 'Enable' after confirming that you want to enable service endpoints for the listed the virtual network(s) and subnet(s). It may take up to 15 minutes to take effect.</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/06/Add-Virtual-Networks-and-Subnets.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/06/Add-Virtual-Networks-and-Subnets.png" alt="" width="527" height="694" class="alignnone size-full wp-image-815" /></a></p>

<ul>
 	<li>You can also add new virtual network(s) and subnet(s) and then enable service endpoints for the newly created virtual network(s) and subnet(s), by clicking '+ Add new virtual network' and following prompts.</li>
 	<li>Under 'IP Networks' you can add IPv4 address ranges by typing IPv4 address ranges in <a href="https://tools.ietf.org/html/rfc4632">CIDR (Classless Inter-domain Routing) notation</a> or individual IP addresses.</li>
</ul>
<b>Note:</b> Small address ranges using "/31" or "/32" prefix sizes are not supported. These ranges should be configured using individual IP address rules.
<ul>
 	<li>IP network rules are only allowed for public IP addresses. IP address ranges reserved for private networks (as defined in RFC 1918) are not allowed in IP rules. Private networks include addresses that start with *10.**, *172.16.**, and *192.168.**. <b>Note: </b>Only IPv4 addresses are supported at this time.</li>
 	<li>If this key vault needs to be accessible by any trusted Microsoft services, click 'Yes' in the 'Exception' section. Following trusted Microsoft services are covered with this option.</li>
 	<li></li>
</ul>
<strong>Using Azure CLI 2.0</strong>
<ul>
 	<li><a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli">Install Azure CLI 2.0</a> and <a href="https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli">Login</a>.</li>
 	<li>Install <a href="https://docs.microsoft.com/en-us/cli/azure/ext/keyvault-preview/keyvault?view=azure-cli-latest">keyvault-preview</a> extension. You must install the keyvault-preview extension to use the VNET Service Endpoints for Key Vault.</li>
</ul>
<blockquote>
<pre><span class="hljs-keyword">az</span><span> </span><span class="hljs-keyword">extension</span><span> </span><span class="hljs-keyword">add</span><span class="hljs-parameter"> --name keyvault-preview</span><span></span></pre>
</blockquote>
<ul>
 	<li>List available virtual network rules, if you have not set any rules for this key vault, the list will be empty.</li>
</ul>
<blockquote>
<pre>az keyvault network-rule list --resource-group myresourcegroup --name mykeyvault</pre>
</blockquote>
<ul>
 	<li>Enable Service Endpoint for Key Vault on an existing Virtual Network and subnet</li>
</ul>
<blockquote>
<pre>az network vnet subnet update --resource-group "myresourcegroup" --vnet-name "myvnet" --name "mysubnet" --service-endpoints "Microsoft.KeyVault"</pre>
</blockquote>
<ul>
 	<li>Add a network rule for a virtual network and subnet</li>
</ul>
<blockquote>
<pre>subnetid=$(az network vnet subnet show --resource-group "myresourcegroup" --vnet-name "myvnet" --name "mysubnet" --query id --output tsv)
az keyvault network-rule add --resource-group "demo9311" --name "demo9311premium" --subnet $subnetid</pre>
</blockquote>
<ul>
 	<li>Add IP address range to allow traffic from</li>
</ul>
<blockquote>
<pre>az keyvault network-rule add --resource-group "myresourcegroup" --name "mykeyvault" --ip-address "191.10.18.0/24"</pre>
</blockquote>
<ul>
 	<li>If this key vault needs to be accessible by any trusted services, set 'bypass' to AzureServices</li>
</ul>
<blockquote>
<pre>az keyvault update --resource-group "myresourcegroup" --name "mykeyvault" --bypass AzureServices</pre>
</blockquote>
<ul>
 	<li>Now the final and important step, turn the network rules ON by setting the default action to 'Deny'</li>
</ul>
<blockquote>
<pre>az keyvault update --resource-group "myresourcegroup" --name "mekeyvault" --default-action Deny</pre>
</blockquote>
<strong>Using Azure PowerShell</strong>
<ul>
 	<li>Install the latest<span> </span><a href="https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps">Azure PowerShell</a><span> </span>and<span> </span><a href="https://docs.microsoft.com/en-us/powershell/azure/authenticate-azureps">Login</a>.</li>
 	<li>Install preview version of AzureRM.KeyVault module</li>
 	<li>List available virtual network rules, if you have not set any rules for this key vault, the list will be empty.</li>
</ul>
<blockquote>
<pre>(Get-AzureRmKeyVault -VaultName "mykeyvault").NetworkAcls</pre>
</blockquote>
<ul>
 	<li>Enable Service Endpoint for Key Vault on an existing Virtual Network and subnet</li>
</ul>
<blockquote>
<pre>Get-AzureRmVirtualNetwork -ResourceGroupName "myresourcegroup" -Name "myvnet" | Set-AzureRmVirtualNetworkSubnetConfig -Name "mysubnet" -AddressPrefix "10.1.1.0/24" -ServiceEndpoint "Microsoft.KeyVault" | Set-AzureRmVirtualNetwork</pre>
</blockquote>
<ul>
 	<li>Add a network rule for a virtual network and subnet</li>
</ul>
<blockquote>
<pre>$subnet = Get-AzureRmVirtualNetwork -ResourceGroupName "myresourcegroup" -Name "myvnet" | Get-AzureRmVirtualNetworkSubnetConfig -Name "mysubnet"
Add-AzureRmKeyVaultNetworkRule -VaultName "mykeyvault" -VirtualNetworkResourceId $subnet.Id</pre>
</blockquote>
<ul>
 	<li>Add IP address range to allow traffic from</li>
</ul>
<blockquote>
<pre>Add-AzureRmKeyVaultNetworkRule -VaultName "mykeyvault" -IpAddressRange "16.17.18.0/24"</pre>
</blockquote>
<ul>
 	<li>If this key vault needs to be accessible by any trusted services, set 'bypass' to AzureServices</li>
</ul>
<blockquote>
<pre>Update-AzureRmKeyVaultNetworkRuleSet -VaultName "mykeyvault" -Bypass AzureServices</pre>
</blockquote>
<ul>
 	<li>Now the final and important step, turn the network rules ON by setting the default action to 'Deny'</li>
</ul>
<blockquote>
<pre>Update-AzureRmKeyVaultNetworkRuleSet -VaultName "mykeyvault" -DefaultAction Deny</pre>
</blockquote>
&nbsp;

Here is a list of trusted services that are allowed to access a key vault if the 'Allow trusted services' is checked, or equivalent '-bypass' option is used via CLI or PowerShell.
<table border="1">
<tbody>
<tr>
<td><b>Trusted services</b></td>
<td><b>Usage scenarios</b></td>
</tr>
<tr>
<td>Azure Virtual Machines deployment service</td>
<td><a href="https://blogs.technet.microsoft.com/kv/2016/09/14/updated-deploy-certificates-to-vms-from-customer-managed-key-vault/">Deploy Certificates to VMs from customer-managed Key Vault</a></td>
</tr>
<tr>
<td>Azure Resource Manager (ARM) template deployment service</td>
<td><a href="https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-keyvault-parameter">Pass secure values during deployment</a></td>
</tr>
<tr>
<td>Azure Disk Encryption volume encryption service</td>
<td>Allow access to BitLocker Key (Windows VM) or DM Passphrase (Linux VM) and Key Encryption Key during VM deployment to enable <a href="https://docs.microsoft.com/en-us/azure/security/azure-security-disk-encryption">Azure Disk Encryption</a></td>
</tr>
<tr>
<td>Azure Backup</td>
<td>Allow backup and restore of relevant keys and secrets during Azure VM backup, using <a href="https://docs.microsoft.com/en-us/azure/backup/backup-introduction-to-azure-backup">Azure Backup</a></td>
</tr>
<tr>
<td>Exchange Online &amp; SharePoint Online</td>
<td>Allow access to customer key for Service Encryption with <a href="https://support.office.com/en-us/article/Controlling-your-data-in-Office-365-using-Customer-Key-f2cd475a-e592-46cf-80a3-1bfb0fa17697">Customer Key</a>.</td>
</tr>
<tr>
<td>Azure Information Protection</td>
<td>Allow access to tenant key for Azure Information Protection.</td>
</tr>
<tr>
<td>App Services (coming soon)</td>
<td><a href="https://blogs.msdn.microsoft.com/appserviceteam/2016/05/24/deploying-azure-web-app-certificate-through-key-vault/">Deploying Azure Web App Certificate through Key Vault</a></td>
</tr>
</tbody>
</table>
<blockquote><b>Note: </b>The relevant key vault access policies must be set to allow the corresponding services to get access to key vault.

<b>IMPORTANT:</b> Once firewall rules are in effect, all Key Vault data plane operations can ONLY be performed when caller  requests originate from allowed virtual network(s) or IPV4 address ranges. This also applies to accessing key vault from Azure portal. While a user can browser to a key vault from Azure portal, they may not be able to list keys/secrets/certificates if their client machine is not in the allowed list. This also affects the 'Key Vault Picker' by other Azure services. Users may be able to see list of key vaults but not list keys, if firewall rules prevent their client machine.</blockquote>
<b>Known issues and limitations:</b>
<ul>
 	<li>Managed Service Identity (MSI) enabled Azure services that use Key Vault in the context of service side encryption at rest with customer managed key do not work when firewall rules are in effect. E.g. <a href="https://docs.microsoft.com/en-us/azure/storage/common/storage-service-encryption-customer-managed-keys">Azure Storage encryption with customer managed key</a>, <a href="https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-encryption">Azure Data Lake Store encryption with customer managed key</a>, <a href="https://docs.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption-byok-azure-sql?view=azuresqldb-current">Azure SQL TDE with bring your own key</a>. <strong>This limitation will be removed in a future release.</strong></li>
 	<li>For App Services only ASE (App Service Environment) instances are supported. <strong>This limitation will be addressed in a future release.</strong></li>
</ul>
That's all folks!

We are eager to hear from you about virtual network service endpoints for Key Vault. So please reach out to us and let us know what you think.
Comments are disabled, head over to the <a href="https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=AzureKeyVault">Azure Key Vault forum</a> to discuss about this blog.

References and links:
<ul>
 	<li><a href="https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview">Azure Virtual Network Service Endpoints</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/cli/azure/ext/keyvault-preview/keyvault?view=azure-cli-latest">Azure CLI 2.0 keyvault-preview extension documentation</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/rest/api/keyvault/keyvaultpreview/vaults">Azure Key Vault REST API preview Reference Documentation </a></li>
</ul>
&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Announcing Backup and Restore of Keys, Secrets and Certificates</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/announcing-backup-and-restore-of-keys-secrets-and-certificates</link>
      <pubDate>Fri, 20 Jul 2018 21:35:05 GMT</pubDate>
      <dc:creator><![CDATA[Prashanth Yerramilli (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=855</guid>
      <description><![CDATA[Hello Folks,

Today we're very excited to announce the General Availability of a feature where in...]]></description>
      <content:encoded><![CDATA[Hello Folks,

Today we're very excited to announce the General Availability of a feature where in you could backup and restore a Key, Certificate, Secret or a Managed Storage account key in Azure Key Vault.

By default, Azure Key Vault has multiple layers of redundancy within the region where it is hosted, and it is replicated to another region within the same geographic region. In the unlikely event of a region failure in Microsoft Azure, the remaining region will take over the Azure Key Vault after a few minutes, but the Azure Key Vault will be in read-only mode. All that high availability and resiliency of the service is built-in — customers wouldn't have to configure anything.

In some scenarios, the enterprise or the developer wants to control the disaster recovery capabilities and create a replica of a Key Vault to another region without relying on Microsoft Azure to perform the failover.

Azure Key Vault allows the process to export Keys, Secrets, Certificates and Storage Account Keys from Key Vault in a protected form as long as they are in the same subscription and same geography.

<strong>Note - </strong>This operation does <strong>NOT</strong> return the key or secret material in a form that can be used outside the Azure Key Vault system.

The returned key or secret material is protected either to a Azure Key Vault HSM or to Azure Key Vault itself.

The intent of this operation is to allow a client to GENERATE a secret in one Azure Key Vault instance, BACKUP the secret, and then RESTORE it in another Azure Key Vault instance.

Another important point to note is individual versions of a key/secret CANNOT be backed up, instead all versions of the key/secret will be downloaded

Now without any further ado let's see how this works
<ul>
 	<li style="list-style-type: none">
<ul>
 	<li>In <strong>Azure CLI</strong> you would use
<code>
az keyvault key backup --file &lt;FileName&gt; --name &lt;NameOfTheKeyStoredInKeyVault&gt; --vault-name &lt;VaultName&gt;
</code>
The parameters --file, --name and --vault-name are required.
--file is the local file path in which to store the key backup
--name is the Name of the key stored in Azure Key Vault
--vault-name is the Name of the Key Vault the key is stored in
For more about this command please read <a>documentation</a>Now to restore the key you would use
<code>
az keyvault key restore --file &lt;FileName&gt; --vault-name &lt;VaultName&gt;
</code>
--file is the local backup from which to restore the key
--vault-name is the name of the vault you would want to restore to.
Similarly the command for Secret backup is
<code>
az keyvault key backup --file &lt;FileName&gt; --name &lt;NameOfTheKeyStoredInKeyVault&gt; --vault-name &lt;VaultName&gt;
</code></li>
 	<li>In <strong>Powershell</strong> to Back up a key with an automatically generated file name you would use
<strong>Example 1:</strong>
<code>
PS C:\Users\username\&gt; Backup-AzureKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyKey'
</code>
This command retrieves the key named MyKey from the key vault named MyKeyVault and saves a backup of that key to a file that is automatically named for you, and displays the file name.<strong>Example 2:</strong> Back up a key to a specified file name
<code>
PS C:\&gt; Backup-AzureKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyKey' -OutputFile 'C:\Backup.blob'
</code>
This command retrieves the key named MyKey from the key vaultnamed MyKeyVault and saves a backup of that key to a file named Backup.blob.

<strong>Example 3:</strong> Back up a previously retrieved key to a specified file name, overwriting the destination file without prompting.
<code>
PS C:\&gt; $key = Get-AzureKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyKey'</code>

PS C:\&gt; Backup-AzureKeyVaultKey -Key $key -OutputFile 'C:\Backup.blob' -Force

This command creates a backup of the key named $key.Name in the vault named $key.VaultName to a file named Backup.blob, silently overwriting the file if it exists already.

To learn more about how to back up a certificate using Powershell please take a look at these <a href="https://docs.microsoft.com/en-us/powershell/module/azurerm.keyvault/Backup-AzureKeyVaultCertificate?view=azurermps-6.5.0"> AzureKeyVaultCertificate </a>
For backing up a secret visit - <a href="https://docs.microsoft.com/en-us/powershell/module/azurerm.keyvault/backup-azurekeyvaultsecret?view=azurermps-6.5.0">BackupAzureKeyVaultSecret</a>
For backing up a Managed Storage Account key visit - <a href="https://docs.microsoft.com/en-us/powershell/module/azurerm.keyvault/backup-azurekeyvaultmanagedstorageaccount?view=azurermps-6.5.0">BackupManagedStorageAccount</a></li>
 	<li>If you want to use the <a href="https://docs.microsoft.com/en-us/rest/api/keyvault/">REST API</a> then you would use this HTTP command
<code>
POST {vaultBaseUrl}/keys/{key-name}/backup?api-version=2016-10-01
</code>
where the vaultBaseUrl is the full URI of the vault. For example https://myvault.vault.azure.netkey-name is the name of the key and api-version is the Client API version.

And to backup a secret you would use
<code>
POST {vaultBaseUrl}/secrets/{secret-name}/backup?api-version=2016-10-01
</code></li>
</ul>
</li>
</ul>
&nbsp;
<ul>
 	<li>You could also download a backup using <a href="https://portal.azure.com">Azure Portal</a>

<a href="https://msdnshared.blob.core.windows.net/media/2018/07/Screen-Shot-2018-07-18-at-11.08.59-PM.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/07/Screen-Shot-2018-07-18-at-11.08.59-PM-300x120.png" alt="" width="300" height="120" class="alignnone size-medium wp-image-865" /></a></li>
</ul>
To learn more about how to back up a secret refer our REST API documentation <a href="https://docs.microsoft.com/en-us/rest/api/keyvault/backupsecret">here</a> for secrets

That's all folks!
We are very excited about this feature and would love to hear feedback about the same. Please post your comments on our <a href="https://feedback.azure.com/forums/906355-azure-key-vault">feedback forum</a>]]></content:encoded>
    </item>
    <item>
      <title>Announcing New Advanced Keys</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/announcing-new-advanced-keys</link>
      <pubDate>Thu, 19 Jul 2018 05:18:38 GMT</pubDate>
      <dc:creator><![CDATA[Prashanth Yerramilli (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=795</guid>
      <description><![CDATA[Hello Folks,

Today we're very excited to announce new Advanced key length's that Azure Key Vault...]]></description>
      <content:encoded><![CDATA[Hello Folks,

Today we're very excited to announce new Advanced key length's that Azure Key Vault supports.
Before we delve deeper into this post, let's review a few basics about cryptographic keys

In cryptography, key size or key length is the number of bits used by a cryptographic algorithm.
A key should be large enough that a brute force attack (possible against any encryption algorithm) is infeasible – i.e., would take too long to execute. Elliptic-curve cryptography (ECC) is an approach to public-key cryptography based on the algebraic structure of elliptic curves over finite fields. ECC requires smaller keys compared to RSA to provide equivalent security.

Oftentimes standards by government regulations (such as NIST) stipulate the key size that must be used in order to remain compliant. For more information on NIST security standards, please see <a href="https://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf">this</a>.

Today Azure Key Vault is delighted to announce the support of RSA Key sizes of  3072, and 4096 bit <a href="https://docs.microsoft.com/en-us/rest/api/keyvault/createkey/createkey#request-body">Keys</a> and <strong>ECC Keys of type <a href="https://docs.microsoft.com/en-us/rest/api/keyvault/createkey/createkey#jsonwebkeycurvename">P-256, P-384, P-521 and P-256K</a></strong>. Please find the Reference documentation for the <a href="https://docs.microsoft.com/en-us/rest/api/keyvault/keyvaultpreview/vaults">REST API</a>, <a href="https://aka.ms/akvdotnetpublicpreview">.NET</a> and <a href="https://aka.ms/akvnodepublicpreview">Node, </a><a href="https://docs.microsoft.com/en-us/python/api/azure-mgmt-keyvault/azure.mgmt.keyvault.operations.vaultsoperations?view=azure-python#create-or-update">Python, </a><a href="https://docs.microsoft.com/en-us/java/api/overview/azure/keyvault?view=azure-java-stable">Java</a>

ECC Keys is a often asked feature on our <a href="https://feedback.azure.com/forums/216840-security-and-compliance/suggestions/10877748-ecc-support-for-azure-key-vault">feedback forum</a>.
The foremost benefit of ECC is that it’s simply stronger than RSA for same key size. The typical ECC key size of 256 bits is equivalent to a 3072-bit RSA key and 10,000 times stronger than a 2048-bit RSA key! To stay ahead of an attacker’s computing power, RSA keys must get longer.
ECC Keys allow Azure Key Vault to create digital signatures which are far smaller to transmit and faster to verify than their RSA counterparts. Moreover, as you can see in the table below, future RSA key sizes quickly expand while ECC key lengths increase linearly with strength.

<a href="https://msdnshared.blob.core.windows.net/media/2018/07/Table.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/07/Table.png" alt="" width="951" height="214" class="alignnone size-full wp-image-885" /></a>
Source: NIST 800-57, Table 2 (https://csrc.nist.gov/publications/nistpubs/800-57/sp800-57_part1_rev3_general.pdf)

ECC is also faster for a number of reasons. First off, smaller keys means less data that must be transmitted from the server to the client during an SSL handshake. In addition, ECC requires less processing power (CPU) and memory, resulting in significantly faster response times and throughput on Web servers when it is in use.

The following algorithm identifiers are supported with EC and EC-HSM keys in Azure Key Vault.

ES256 - ECDSA for SHA-256 digests and keys created with curve P-256. This algorithm is described at [RFC7518].
ES256K - ECDSA for SHA-256 digests and keys created with curve P-256K. This algorithm is pending standardization.
ES384 - ECDSA for SHA-384 digests and keys created with curve P-384. This algorithm is described at [RFC7518].
ES512 - ECDSA for SHA-512 digests and keys created with curve P-521. This algorithm is described at [RFC7518].

<b><i><span style="color: #7030a0">Note: In this release, we are not introducing support to ECC encryption and decryption algorithms.</span></i></b>

To read more about our EC Algorithm identifiers please read <a href="https://docs.microsoft.com/en-us/azure/key-vault/about-keys-secrets-and-certificates#BKMK_ECAlgorithms">here</a>

To read more about the Key Types please visit our documentation <a href="https://docs.microsoft.com/en-us/azure/key-vault/about-keys-secrets-and-certificates#BKMK_KeyTypes">here</a>

Establish Announcement, Currently we are in preview, on this date the price will change

That's all folks!
We're very eager to learn how this feature would help you and are always open to hearing suggestions or feedback.
We value your input so please take a moment to send us feedback on our <a href="https://feedback.azure.com/forums/906355-azure-key-vault">forum</a>.

Reference Links
<ol>
 	<li><a href="https://docs.microsoft.com/en-us/azure/key-vault/about-keys-secrets-and-certificates">Keys and Certificates</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/rest/api/keyvault/">Key Vault REST API Reference</a></li>
 	<li><a href="https://docs.microsoft.com/dotnet/api/overview/azure/key-vault?view=azure-dotnet">.NET SDK Documentation</a></li>
 	<li><a href="https://docs.microsoft.com/java/api/overview/azure/keyvault?view=azure-java-stable">Java SDK Documentation</a></li>
 	<li><a href="https://docs.microsoft.com/python/api/overview/azure/key-vault?view=azure-python">Python SDK Documentation</a></li>
 	<li><a href="https://docs.microsoft.com/javascript/api/overview/azure/key-vault?view=azure-node-latest">Node.JS SDK Documentation</a></li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>Azure Key Vault Recovery Options</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/azure-key-vault-recovery-options</link>
      <pubDate>Wed, 10 May 2017 17:29:50 GMT</pubDate>
      <dc:creator><![CDATA[Amit Bapat [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=735</guid>
      <description><![CDATA[[Updated on November 22, 2017]

Hello again!

It's been a while since our last update. Today we...]]></description>
      <content:encoded><![CDATA[[Updated on November 22, 2017]

Hello again!

It's been a while since our last update. Today we are very excited to announce public preview of a new feature that our customers have often requested.

Have you ever faced a situation where you found out that an important key vault or a key or a secret was inadvertently deleted? Either as a result of you or another team member deleting it by mistake or you issuing a wrong command? What if the key was in use for encrypting large amounts of data? Surely you could restore such key via a backup if it is available. But what if no such key backup is available? This could be a major disaster scenario. If you worry about such disaster scenarios, read on!
<blockquote><i>As usual, we value your input so please take a moment to join our </i><a href="https://eepurl.com/3zw6z"><b><i>advisory board</i></b></a><i>, </i><a href="mailto:azurekeyvault@microsoft.com?subject=KVBlog"><b><i>send us private feedback</i></b></a><i>,and/or visit our </i><a href="https://social.msdn.microsoft.com/Forums/en-US/AzureKeyVault"><b><i>forum.</i></b></a></blockquote>
Key Vault now offers recovery options such that you can recover deleted keys for up to 90 days. We call this feature soft-delete. Soft-delete enables you to recover deleted objects (vaults, keys, secrets).

<b>Important: </b>To be able to recover deleted objects, you must opt-in each key vault to enable soft-delete feature for the vault. A vault level attribute indicates if the vault has soft-delete enabled.

Today this feature is available for vaults, keys and secrets. We'll soon enable soft-delete for certificates too. [Update: soft-delete support for certificates was released on September 25, 2017]

So here's a quick bite on soft-delete for the impatient:
<ul>
 	<li>You can create new vaults with soft-delete enabled. You can also turn on soft-delete for existing vaults.</li>
 	<li>For vaults with soft-delete enabled, when a vault/key/secret is deleted, it simply goes into a ‘deleted state’ and remains in that state unless user takes an action.</li>
 	<li>Two actions are possible:
<ul>
 	<li>You can ‘recover’ the vault/key/secret. In that case the vault/key/secret will be recovered and will appear exactly as it was before deletion, including all versions, tags and other metadata.</li>
 	<li>You can 'purge' the vault/key/secret, such that it will be permanently deleted with no recovery possible.</li>
</ul>
</li>
 	<li>If none of the above action is taken while the vault/key/secret is in deleted state for 90 days, it will be permanently deleted at the end of 90 day window.</li>
</ul>
<strong>Note:</strong> This preview enables soft-delete opt-in using Azure PowerShell commands only. So you won't find any way to turn-on soft-delete from Azure Portal or Azure CLI just yet. But rest assured that they're coming soon.

Now let's get into the nitty-gritty details.

First things first - you'll need the latest <a href="https://github.com/Azure/azure-powershell/releases">Azure PowerShell </a>(4.0.0 or later) to run below cmdlets.

Let's first talk about key vaults. As mentioned in the summary, to be able to recover a deleted vault or deleted keys/secrets inside a vault you must first enable soft-delete for that vault. Here's how.

Say you have a key vault named 'ContosoVault', here's how you would enable soft-delete for this vault:
<pre style="color: #ffffff;background-color: #003366">($resource = Get-AzureRmResource -ResourceId (Get-AzureRmKeyVault -VaultName ContosoVault).ResourceId).Properties | Add-Member -MemberType NoteProperty -Name enableSoftDelete -Value 'True'
Set-AzureRmResource -resourceid $resource.ResourceId -Properties $resource.Properties
</pre>
And if you're creating a new vault, simply add '-EnableSoftDelete' parameter when running 'New-AzureRmKeyVault' cmdlet, like this:
<pre style="color: #ffffff;background-color: #003366">New-AzureRmKeyVault -VaultName ContosoVault -ResourceGroupName ContosoRG -Location westus -EnableSoftDelete
</pre>
To check whether a vault has soft-delete enabled, run the 'Get-AzureRmKeyVault' cmdlet and look for the 'Soft Delete Enabled?' attribute. If it is set to 'True', soft-delete is enabled for this vault. If set to empty or 'False' soft-delete is disabled.

Now that we have enabled soft-delete for our vault, let's see what happens when this vault is deleted.

The cmdlet to delete (or remove) a vault remains same, but it's behavior changes depending on whether you have enabled soft-delete or not.
<pre style="color: #ffffff;background-color: #003366">Remove-AzureRmKeyVault -VaultName ContosoVault
</pre>
<b>Important</b>: If you run the above cmdlet for a vault that does not have soft-delete enabled, you will permanently lose this vault and all its content without any options for recovery. So beware!

With soft-delete turned on, when a vault is deleted, it is removed from the resource group and placed in a different name space that is only associated with the location where it was created. All the keys/secrets in a deleted vault also become inaccessible. The DNS name for a vault in deleted state is still reserved, so a new vault with same name cannot be created.  To see all the vaults in your subscription in deleted state, run this cmdlet:
<pre style="color: #ffffff;background-color: #003366">PS C:\&gt; Get-AzureRmKeyVault -InRemovedState
Vault Name           : ContosoVault
Location             : westus
Id                   : /subscriptions/xxx/providers/Microsoft.KeyVault/locations/westus/deletedVaults/ContosoVault
Resource ID          : /subscriptions/xxx/resourceGroups/ContosoVault/providers/Microsoft.KeyVault/vaults/ContosoVault
Deletion Date        : 5/9/2017 12:14:14 AM
Scheduled Purge Date : 8/7/2017 12:14:14 AM
Tags                 :
</pre>
Get-AzureRmKeyVault cmdlet will only show deleted vault if you use '-InRemovedState' parameter. In other words, if you do not use '-InRemovedState' parameter, you will not see deleted vaults listed.

The 'Resource ID' in the above output simply refers to the original resource ID of this vault. Since this vault is now in deleted state, no such resource exists with that resource ID. That's where the 'Id' field above comes in, which can be used to identify the resource when recovering, or purging. The 'Scheduled Purge Date' field indicates when the vault will be permanently deleted (purged) if no action is taken for this deleted vault.

So now let's see what we need to do to recover a vault. To recover a vault, you need to specify the vault name, resource group and location. Note down the location and the resource group of the deleted vault. You'll need it when recovering.
<pre style="color: #ffffff;background-color: #003366">Undo-AzureRmKeyVaultRemoval -VaultName ContosoVault -ResourceGroupName ContosoRG-Location westus</pre>
When a vault is recovered, all the keys/secrets in the vault will also become accessible again.

When a vault is recovered, it results in a new resource being created with the its original resource ID. If the resource group where the vault existed has been removed, a new resource group with same name will need to be recreated before the vault can be recovered. To purge (that is permanently delete) a vault run 'Remove-AzureRmKeyVault' with '-InRemovedState' and specify the location of the deleted vault.
<pre style="color: #ffffff;background-color: #003366">Remove-AzureRmKeyVault -VaultName ContosoVault -InRemovedState -Location westus</pre>
Remember, when a vault is purged all its contents (such as keys and secrets) are also permanently deleted.

To recover a vault, a user needs to have RBAC permission to perform ‘Microsoft.KeyVault/vaults/write’ operation. Similarly to purge a deleted vault so that the vault and all its contents are permanently removed the user needs RBAC permission to perform ‘Microsoft.KeyVault/locations/deletedVaults/purge/action’ operation. To list the deleted vault a user needs RBAC permission to perform ‘Microsoft.KeyVault/deletedVaults/read’ permission.

Now that we have seen the complete life cycle of a vault with soft-delete enabled, let's turn our attention to keys and secrets in a vault with soft-delete enabled. I'm assuming here that you already know how to create keys and secrets in a vault. If not check out <a href="https://docs.microsoft.com/en-us/azure/key-vault/key-vault-get-started"><b>Get started with Azure Key Vault</b></a>.

Let's say you have a key 'ContosoFirstKey' in your vault 'ContosoVault' with soft-delete enabled. Here's how you would delete that key.
<pre style="color: #ffffff;background-color: #003366">Remove-AzureKeyVaultKey -VaultName ContosoVault -Name ContosoFirstKey</pre>
<b>Important: </b>If a key vault does not have soft-delete enabled, a deleted key cannot be recovered from such a vault. So beware!

With your key vault enabled for soft-delete, a deleted key still appears like it's deleted for the most part, except, when you explicitly list/retrieve deleted keys. Most operations on a key in deleted state will fail except for specifically listing deleted key, recovering it or purging it. For example, if you request to list keys in a key vault with 'Get-AzureKeyVaultKey -VaultName ContosoVault', the deleted key will not show up. To see deleted keys in a vault, you must use the '-InRemovedState' parameter.

<b>Note</b>: When you delete a key in a vault with soft-delete enabled it may take a while (a few seconds, usually) for the transition to complete; during this interval, it may appear that the key is in neither the active state, nor the deleted one – i.e. listing the key, with or without the -InRemovedState parameter, will return an empty list.

This command will list all deleted keys in 'ContosoVault'.
<pre style="color: #ffffff;background-color: #003366">Get-AzureKeyVaultKey -VaultName ContosoVault -InRemovedState
Vault Name           : ContosoVault
Name                 : ContosoFirstKey
Id                   : https://ContosoVault.vault.azure.net:443/keys/ContosoFirstKey
Deleted Date         : 2/14/2017 8:20:52 PM
Scheduled Purge Date : 5/15/2017 8:20:52 PM
Enabled              : True
Expires              :
Not Before           :
Created              : 2/14/2017 8:16:07 PM
Updated              : 2/14/2017 8:16:07 PM
Tags                 :
</pre>
Just like vaults, a deleted key or secret will remain in deleted state for up to 90 days unless you recover it or purge it. 'Scheduled Purge Date' field indicates when a key will be permanently deleted, if no action is taken.

Here is how you would recover a deleted key:
<pre style="color: #ffffff;background-color: #003366">Undo-AzureKeyVaultKeyRemoval -VaultName ContosoVault -Name ContosoFirstKey</pre>
To permanently delete a key, run the following cmdlet:
<pre style="color: #ffffff;background-color: #003366">Remove-AzureKeyVaultKey -VaultName ContosoVault -Name ContosoFirstKey -InRemovedState</pre>
The 'recover' and 'purge' actions have their own permissions associated in key vault access policy. For a user or service principal to be able to execute a 'recover' or 'purge' action they must have the respective permission for that object (key or secret) in the key vault access policy. By default, 'purge' permission is not added to a vault's access policy when 'all' shortcut is used to grant all permissions to a user. You must explicitly grant 'purge' permission. For example, following command grants user@contoso.com permission to perform several operations on keys in 'ContosoVault' including 'purge'.
<pre style="color: #ffffff;background-color: #003366">Set-AzureRmKeyVaultAccessPolicy -VaultName ContosoVault -UserPrincipalName user@contoso.com -PermissionsToKeys get,create,delete,list,update,import,backup,restore,recover,purge</pre>
<b>Note: </b>If you have an existing vault, that you just enabled soft-delete, you may not have 'recover' and 'purge' permissions.

Similarly here are related commands for deleting, listing, recovering and purging secrets respectively.

Delete a secret named SQLPassword
<pre style="color: #ffffff;background-color: #003366">Remove-AzureKeyVaultSecret -VaultName ContosoVault -name SQLPassword</pre>
List all deleted secrets in a key vault
<pre style="color: #ffffff;background-color: #003366">Get-AzureKeyVaultSecret -VaultName ContosoVault -InRemovedState</pre>
Recover a secret in deleted state
<pre style="color: #ffffff;background-color: #003366">Undo-AzureKeyVaultSecretRemoval -VaultName ContosoVault -Name SQLPAssword</pre>
Purge a secret in deleted state
<pre style="color: #ffffff;background-color: #003366">Remove-AzureKeyVaultSecret -VaultName ContosoVault -InRemovedState -name SQLPassword</pre>
That's all folks!

We are eager to hear from you about soft-delete. So reach out to us and let us know what you think.
Comments are disabled, head over to the <a href="https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=AzureKeyVault">Azure Key Vault forum</a> to discuss about this blog.]]></content:encoded>
    </item>
    <item>
      <title>Azure TLS Certificates changes</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/azure-tls-certificates-changes</link>
      <pubDate>Thu, 20 Apr 2017 00:43:34 GMT</pubDate>
      <dc:creator><![CDATA[Rashmi Jha [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=695</guid>
      <description><![CDATA[We know security is a top priority for you, and so is uptime of your applications.

To give you...]]></description>
      <content:encoded><![CDATA[We know security is a top priority for you, and so is uptime of your applications.

To give you additional assurance of the authenticity of Azure services, most Azure services get their SSL/TLS certificates from a known set of intermediate certificate authorities (CAs) that Microsoft operates. Microsoft publishes details of these CAs in its <a href="https://www.microsoft.com/pki/mscorp/cps/">Certificate Practice Statement</a> (CPS).

Some organizations configure their applications with specific CAs, using a security practice called <a href="https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning">certificate pinning</a>. Since CAs expire and get replaced, this practice requires that the applications be updated periodically to use the latest CAs. If this is not done in time, the application may get interrupted. To make this process easy for you, Microsoft publishes new CAs well in advance of using them.

The current intermediate CAs used by Azure are due to expire in May 2018. Microsoft published a new set of CAs last year in the July 2016 revision of the CPS. Azure services will begin using these new CAs from July 27, 2017. If your organization configures your application with specific CAs, then you must ensure your applications are updated by July 27, 2017 to prevent interruption.
<h1>What is changing</h1>
This information can also be found in Microsoft’s <a href="https://www.microsoft.com/pki/mscorp/cps/">Certificate Practice Statement</a> (CPS). It is duplicated here for convenience.

Today TLS certificates for Azure services are issued from the following intermediate CAs:
<table style="width: 590px;border-collapse: collapse" cellpadding="10">
<thead style="padding: 1px">
<tr>
<td style="border: 1px solid #dddddd">CN</td>
<td style="border: 1px solid #dddddd">Thumbprint</td>
</tr>
</thead>
<tbody>
<tr>
<td style="border: 1px solid #dddddd">Microsoft IT SSL SHA2</td>
<td style="border: 1px solid #dddddd">97 ef f3 02 86 77 89 4b dd 4f 9a c5 3f 78 9b ee 5d f4 ad 86</td>
</tr>
<tr>
<td style="border: 1px solid #dddddd">Microsoft IT SSL SHA2</td>
<td style="border: 1px solid #dddddd">94 8e 16 52 58 62 40 d4 53 28 7a b6 9c ae b8 f2 f4 f0 21 17</td>
</tr>
</tbody>
</table>
&nbsp;

Beginning July 27th 2017, TLS certificates for Azure services will be issued either from the above CAs or from the following four additional intermediate CAs.
<table style="width: 590px;border-collapse: collapse" cellpadding="10">
<thead style="padding: 1px">
<tr>
<td style="border: 1px solid #dddddd">CN</td>
<td style="border: 1px solid #dddddd">Thumbprint</td>
</tr>
</thead>
<tbody>
<tr>
<td style="border: 1px solid #dddddd">Microsoft IT TLS CA 1</td>
<td style="border: 1px solid #dddddd">41 7e 22 50 37 fb fa a4 f9 57 61 d5 ae 72 9e 1a ea 7e 3a 42</td>
</tr>
<tr>
<td style="border: 1px solid #dddddd">Microsoft IT TLS CA 2</td>
<td style="border: 1px solid #dddddd">54 d9 d2 02 39 08 0c 32 31 6e d9 ff 98 0a 48 98 8f 4a df 2d</td>
</tr>
<tr>
<td style="border: 1px solid #dddddd">Microsoft IT TLS CA 4</td>
<td style="border: 1px solid #dddddd">8a 38 75 5d 09 96 82 3f e8 fa 31 16 a2 77 ce 44 6e ac 4e 99</td>
</tr>
<tr>
<td style="border: 1px solid #dddddd">Microsoft IT TLS CA 5 ‎</td>
<td style="border: 1px solid #dddddd">ad 89 8a c7 3d f3 33 eb 60 ac 1f 5f c6 c4 b2 21 9d db 79 b7</td>
</tr>
</tbody>
</table>
<br>
Note: The new CA numbering system skips #3. Please ignore this.

<br>

Additional Details
<ul>
 	<li>CN = Microsoft IT TLS CA 1 [2,4,5]</li>
 	<li>OU = Microsoft IT</li>
 	<li>O = Microsoft Corporation</li>
 	<li>L = Redmond</li>
 	<li>S = Washington</li>
 	<li>C = US</li>
</ul>
&nbsp;

Endpoint changes are
<table style="width: 590px;border-collapse: collapse" cellpadding="10">
<tbody>
<tr>
<td style="border: 1px solid #dddddd">Original CRL distribution point</td>
<td style="border: 1px solid #dddddd">https://cdp1.public-trust.com/CRL/Omniroot2025.crl</td>
</tr>
<tr>
<td style="border: 1px solid #dddddd">New CRL distribution point</td>
<td style="border: 1px solid #dddddd">https://crl3.digicert.com/Omniroot2025.crl</td>
</tr>
<tr>
<td style="border: 1px solid #dddddd">OCSP</td>
<td style="border: 1px solid #dddddd">https://ocsp.digicert.com</td>
</tr>
</tbody>
</table>
You must ensure your app can connect to all of the above.
<h1>Will this affect me</h1>
We expect that the majority of Azure customers will *not* be impacted. You will be impacted in the following scenarios:
<ol>
 	<li>If you have an application, browser or service that calls one or more Azure services and your application explicitly verifies who issued the TLS certificates for those Azure services. This is called static certificate pinning.</li>
 	<li>If you have set firewall rules to allow outbound calls to only specific CRL download and/or OCSP verification locations.</li>
</ol>
Do the following to detect if an application you are using does static certificate pinning:
<ol>
 	<li>If you have the source code of the application in question then search for thumbprint with this value “‎97 ef f3 02 86 77 89 4b dd 4f 9a c5 3f 78 9b ee 5d f4 ad 86” or “94 8e 16 52 58 62 40 d4 53 28 7a b6 9c ae b8 f2 f4 f0 21 17”. If there is a match your application will be impacted.</li>
 	<li>If you purchased the application, then check with the application vendor.</li>
</ol>
What will I need to do if I am impacted?

If your application meets the criteria listed in the sections above, then you must update the certificate pinning code in your application to accept any of the four new CAs, in addition to the current CAs.

Similarly if your environment locks down outbound network access then you must ensure your application can reach the new CRL distribution points and OCSP endpoint.
<h1>FAQ</h1>
<strong>When can I retire the old intermediate thumbprint? </strong>

All certificates issued by the current intermediate CAs will expire by May 7, 2018. After that date you can remove the old thumbprints from your code.
<strong>Will all Azure services present certificates from the new issuers from July 27, 2017?</strong>

No. You will see the change gradually. Services will continue to present their existing TLS certificates. When each service renews its TLS certificate, you may see that service present a certificate issued by one of the new CAs. Each Azure service renews their certificate at a different time.

&nbsp;

If you have any questions, please contact us through <a href="https://azure.microsoft.com/en-us/support/options/">support</a>. Please, open the ticket under Azure Active Directory\Azure Resource Access. ]]></content:encoded>
    </item>
    <item>
      <title>Manage certificates via Azure Key Vault</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/manage-certificates-via-azure-key-vault</link>
      <pubDate>Mon, 26 Sep 2016 05:48:02 GMT</pubDate>
      <dc:creator><![CDATA[Rashmi Jha [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=575</guid>
      <description><![CDATA[Hello Friends!

I am excited to announce built-in support to create and auto-renew certificates...]]></description>
      <content:encoded><![CDATA[Hello Friends!

I am excited to announce built-in support to create and auto-renew certificates for your cloud apps in Azure Key Vault.
<h2>Stay ahead of this very common problem</h2>
Every cloud app has app secrets – certificates, connection strings, encryption keys, etc. Unfortunately, managing these secrets effectively isn’t always easy and prone to mistakes if done improperly. Such a mistake has potential to cause a service outage, or credential leak, or process violation that shutter the business.

If you are a cloud developer, you must design your app to stay ahead of this. Azure Key Vault provides you the tools to do so.
<h2>How does Azure Key Vault help?</h2>
The goal of Azure Key Vault’s secret management features is to eliminate manual steps in the flow of cloud app secrets. The <a href="https://azure.microsoft.com/en-us/documentation/articles/web-sites-purchase-ssl-web-site/">Azure App Service Certificates</a> feature announced earlier this year was a big step towards that goal. It gives you a domain-validated TLS certificate, keeps it renewed automatically to avoid outages, and stores it in your key vault, so that you can then distribute it to applications that integrate with Azure Key Vault.

Our customers’ scenarios however come in all shapes and sizes. So today we are announcing even more enhancements, built right into Azure Key Vault:
<ol>
 	<li>You can now create your certificate and key in your key vault. So you get access logs from the get-go.</li>
 	<li>As with earlier solutions, Azure Key Vault will renew your certificate automatically where possible. It will also notify you, in case there are manual follow-ups required to complete the renewal. This reduces the chances of an outage in your cloud app.</li>
 	<li>There is no restriction on how you use the certificates. You can use them anywhere, even outside Azure.</li>
 	<li>You now have a choice of certificate authorities to get your certificate from. We have started with <a href="https://www.digicert.com/azure-key-vault/">DigiCert</a>, and <a href="https://www.globalsign.com/en/lp/certificates-for-azure-key-vault/"> GlobalSign</a>, and will add D-Trust shortly. We will continue to add other CAs; please check back again in a few months. This enables our international customers to get certificates from the CA required by their local regulations, and enables enterprises to get certificates from the CA that they already have an account with.</li>
 	<li>Through these certificate authorities, you can get Organization Validation (OV) or Extended Validation (EV) certificates, which provide higher level of trust compared to domain validated certificates that prove just the ownership of the domain.</li>
 	<li>Some organizations, especially enterprises, have a central team that manages domains for the organization, and/or a central billing account with CAs. This team is often separate from the teams that deploy apps with TLS certificates. Both parties must participate in getting a TLS certificate. Our API accommodates this workflow.</li>
 	<li>For higher assurance you can ask Azure Key Vault to generate your key in HSMs. (This choice involves trade-offs. See the FAQ below to decide if this is the right choice for your scenario.)</li>
 	<li>You get to manage all your application secrets – these certificates as well as connection strings, passwords, storage keys etc – in one place, your key vault(s). The first step in reducing mistakes in handling secrets is to know what secrets you have. Centralizing their management helps with that.</li>
 	<li>And finally, because your certificate are in a key vault, you inherit all the other benefits Azure Key Vault offers, covered in earlier posts on this blog -- distribute certificates using the built-in support in <a href="https://blogs.technet.microsoft.com/kv/2016/09/14/updated-deploy-certificates-to-vms-from-customer-managed-key-vault/">Azure VMs</a>, VM scale sets, Web Apps (App Services), Service Fabric clusters/apps; <a href="https://azure.microsoft.com/en-us/documentation/articles/key-vault-logging/">get usage logs</a>, analytics, and alerts via Azure Application Insights and <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-azure-key-vault/">Operations Management Suite</a> etc</li>
</ol>
Three common scenarios where this feature really helps
<ol>
 	<li>You have a web app built on the Azure App Services platform. Your app needs an OV/EV TLS server certificate, and you need to keep it refreshed before it expires. You generate your certificate in a key vault and connect your web app with it. Azure Key Vault automatically renews it. The App Services platform automatically picks up new certificates to keep your web app up at all times.</li>
 	<li>You have an app that runs across hundreds of Azure VMs and needs a client authentication certificate. If you embed the certificate into your VM image you not only run the risk of theft at rest, but also every time you need to update the certificate you need to update the image and redeploy hundreds of VMs. Instead you generate your client authentication certificate (perhaps a self-signed certificate) in a single key vault, register it wherever you need to, and then push the certificate into your 500 VMs at runtime.</li>
 	<li>You decide to take your cloud app through SOC / PCI / FedRAMP / ISO certification. The auditor asks you to show evidence that you roll your TLS certificates (and other app secrets) regularly, evidence that you know where that certificate goes, and evidence that you know who has access. You generate all this evidence from your key vault.</li>
</ol>
The following are examples of when NOT to use this feature:
<ul>
 	<li>Your cloud app stores data provided by your customers, and that includes certificates. You are on the hook to just store them securely, not to manage them. In this case store them with the rest of your customer data in Azure Storage/SQL or other general purpose storage, with encryption turned on. Let your customer manage the lifecycle of their certificates as they may have their own requirements for secrets management.</li>
 	<li>Your cloud app has several thousand users, and your cloud app generates and distributes Wi-Fi certificates to those users’ devices. Such certificates are not part of your app configuration and aren’t “app secrets”. Issue them from a CA designated for that use, and store them in a general purpose store with encryption turned on. Key Vault is for “app secrets”.</li>
</ul>
<h2>Let’s look at one of these use cases end-to-end:</h2>
Let’s dive the first common scenario listed above (#1): <strong>Contoso builds an Azure Web app with a vanity domain and SSL certificate</strong>
<h5>Quick overview of the steps required</h5>
<ol>
<ol>
 	<li>Create an app with Azure App Service and configure it with a vanity domain.</li>
 	<li>Create a key vault and a certificate object in it.</li>
</ol>
</ol>
Here you have the following options:
<ol>
<ul>
 	<li>Import an existing valid certificate into your key vault.</li>
 	<li>Create a self-signed certificate for testing purposes.</li>
 	<li>Create a key pair and certificate signing request (CSR) within your key vault and manually take this CSR to any public CA of your choice and get it signed.</li>
 	<li>Create a key pair and certificate signing request (CSR) within your key vault, and have Azure Key Vault request a certificate from a supported public CA
Few things to note and take an action before selecting the last option:.
<ul>
 	<li>Create an account with the public CA that supports programmatic enrollment via Azure Key Vault. Skip this step if you already have an account.</li>
 	<li>Submit the domains for which you or your organization will request certificates. The CA validates this ahead of time so that when it is time for you to request a certificate the turnaround is quick (2-3 seconds). Periodically ensure you keep this up-to-date.</li>
 	<li>Your CA bills you per your account plan. The operations you do with Azure Key Vault are billed with your Azure subscription bill.</li>
</ul>
</li>
</ul>
 	<li>Configure your app to the certificate URI in Azure Key Vault and perform the SSL binding.</li>
 	<li>As long as your information with the public CA is up-to-date renewal requires no action from you. Azure Key Vault fetches the new certificate before your old one expires. The Azure App service platform picks up the renewed certificate automatically and does the SSL re-binding.</li>
</ol>
<h5>Here are more details on each step:</h5>
<ol>
 	<li><b><i>Create an app with Azure App Service and configure it with a vanity domain</i></b> You can create and deploy Web Apps using ARM templates or through UI. The following links describe how to do this:
<ul>
 	<li>https://azure.microsoft.com/en-us/documentation/services/app-service/web/</li>
 	<li>https://blogs.msdn.microsoft.com/appserviceteam/2016/05/24/deploying-azure-web-app-certificate-through-key-vault/</li>
</ul>
</li>
 	<li><b><i>Create a key vault and a certificate in that key vault</i></b>
There are four options available here as mentioned above. Look at the next blog post <a href="https://blogs.technet.microsoft.com/kv/2016/09/26/get-started-with-azure-key-vault-certificates/">‘Getting Started with Azure Key Vault Certificate’</a> on how to do each of these four options. We will look at the most interesting one which is to request a certificate programmatically from one of the supported public CA’s. In this option you need an account with one of the supported CAs, and you need a credential from that account for the domains for which you will request a certificate. In some organizations a central team manages domains and billing, so we made our flow generic to accommodate this.We will cover a flow with PowerShell; but similar functionality is also available via the cross-platform command line interface or our SDKs and REST API.

Go to PowerShell, login to Azure account, set the correct subscription context, and create a key vault. If you have never created a key vault with PowerShell please follow <a href="https://azure.microsoft.com/en-us/documentation/articles/key-vault-get-started/">‘Get started with Azure Key Vault tutorial’.</a>
<pre>#Set this to the name of the key vault that you just created
$vaultName = "contosoKV"</pre>
Azure Key Vault goes on behalf of the user to enroll for certificates from one of the above issuers. In this process Issuer needs to authenticate the entity requesting the certificate and also authorize to issue the requested certificate. Each Issuer requires different set of information to do so and this needs to be set once in the key vault.

If you select DigiCert to be your certificate authority or Issuer to issue certificates then go through these one-time setup steps to configure DigiCert as one of the Issuer in your vault.

<strong>Note:</strong> Customer will need to have an existing account or go <a href="https://www.digicert.com/azure-key-vault/connect-to-certcentral-quick-start-guide.htm">here</a> to create one with DigiCert and get domains pre-vetted
<pre>#Create an organization for the issuer
$orgIdentifier = "111111"   
$org = New-AzureKeyVaultCertificateOrganizationDetails -Id $orgIdentifier

$apiKey = "111111111" 
$secureApiKey = ConvertTo-SecureString $apiKey -AsPlainText -Force
$accountId = "1111111"
$issuerName = "digiCert01"
 
#Set the relation with the Public CA (DigiCert) for cert issuance
Set-AzureKeyVaultCertificateIssuer -VaultName $vaultName -IssuerName $issuerName -IssuerProvider DigiCert -AccountId $accountId -ApiKey $secureApiKey -OrganizationDetails $org
</pre>
If you select GlobalSign to be your Issuer then go through these one-time setup steps to configure GlobalSign as one of the Issuer in your vault.

<strong>Note:</strong> Customer will need to have an existing account or go <a href="https://www.globalsign.com/files/6814/7492/2758/globalsign-integration-guide-azure-key-vault.pdf">here</a> to create one with GlobalSign and get your domains pre-vetted
<pre>#Create an administrator for the issuer (GlobalSign needs to receive Administrator details in the certificate request)
$firstName = "Patti"
$lastName = "Fuller"
$phoneNumber = "4250000000"
$emailAddress = "patti. fuller@contoso.com"
$admin = New-AzureKeyVaultCertificateAdministratorDetails -FirstName $firstName -LastName $lastName -PhoneNumber $phoneNumber -EmailAddress $emailAddress

#Create an organization for the issuer
$org = New-AzureKeyVaultCertificateOrganizationDetails -AdministratorDetails $admin

#Set the relation with the Public CA (GlobalSign) for cert issuance
$apiKey = "Passw0rd!"
$secureApiKey = ConvertTo-SecureString $apiKey -AsPlainText -Force
$accountId = "PAR1000_kvissuer"
$issuerName = "globalsign01"

Set-AzureKeyVaultCertificateIssuer -VaultName $vaultName -IssuerName $issuerName -IssuerProvider GlobalSign -AccountId $accountId -ApiKey $secureApiKey -OrganizationDetails $org
</pre>
Create a certificate policy. This is a template that defines what needs to be in the certificate (SubjectName, SAN etc.), when to renew the certificate, and which CA to get it issued from.
<pre>$policy = New-AzureKeyVaultCertificatePolicy -SecretContentType application/x-pkcs12 -SubjectName "CN=contoso.com" -ValidityInMonths 12 -IssuerName $issuerName -RenewAtNumberOfDaysBeforeExpiry 60
</pre>
Kick off the enrollment process
<pre>$certificateName = "CertTrial" #Name of the certificate object in your key vault; not related to subject name
Add-AzureKeyVaultCertificate -VaultName $vaultName -CertificateName $certificateName -CertificatePolicy $policy
</pre>
Since this is a remote call, it may take time. Check the enrollment process status periodically.
<pre>Get-AzureKeyVaultCertificateOperation $vaultName $certificateName</pre>
Status will be completed once certificate enrollment has completed
<pre>Get-AzureKeyVaultCertificateOperation $vaultName $certificateName</pre>
Retrieve the certificate details
<pre>Get-AzureKeyVaultCertificate $vaultName $certificateName</pre>
</li>
 	<li><b><i>Configure your app to use the certificate from your key vault for SSL</i></b>
Once the certificate is enrolled and stored within your key vault, the developer uses the steps on the following page to deploy the certificate to your web app and perform SSL binding.
https://azure.microsoft.com/en-us/documentation/templates/201-web-app-certificate-from-key-vault/
Observe that all you can continue to use the same deployment scripts you had earlier with Azure Key Vault. That is because for every Azure Key Vault Certificate, there is a corresponding secret and a key is created. Hence, if you delete the secret and create a certificate with the same name which will create a corresponding secret of the same name. The scripts would work as intended.
Certificate endpoint only returns the public portion of the certificate. Secret endpoint provides the access to private key of the certificate. This also enables Contoso to give only the application to have private key access i.e. the secret endpoint and the developer/operators could have access to the public information i.e. certificates endpoint which also just the management endpoint to add and remove certificates.</li>
 	<li><b><i>Certificate renewal </i></b>
When it is close to the expiry time of the certificate, Azure Key Vault attempts to renew the certificate from the public CA. It also sends an email to the contacts listed in the certificate object before and after the renewal.
The Azure App Services platform periodically polls your key vault to check if there is an updated certificate. If it finds one it reads the new one and rebinds SSL/TLS for your app.
Voila! You didn’t have to do anything to roll over the web app to use the renewed certificate.</li>
 	<li>
<h2>Wrapping Up:</h2>
The certificates feature of Azure Key Vault provides lifetime monitoring of strongly validated SSL certificates along with private key protection in an enterprise environment where domain owner and app developer are different entities. It is a win-win approach from security as well as ease perspective.
The Azure Key Vault SDKs in C#, Java, Node.JS as well as Azure CLI and Azure PowerShell have been updated with APIs/commands for the new certificates feature. The new .Net SDK is in preview. The CLI and PowerShell are generally available.
<h2>FAQs</h2>
<strong>Where is my favorite CA?</strong>
We do understand that every enterprise has slightly different requirements which leads them to select a Certificate Authority. Azure Key Vault is working to get the popular CAs added. Drop us a note if you have any specific CA in mind.
You can create the CSR (certificate signing request) within Azure Key Vault and then manually take it to their choice of CA, get it signed and then merge it back into your key vault. Azure Key Vault will still monitor the lifetime of your certificates and send an email reminder before expiry of your certificate to avoid disruption of service. Auto-renewal will be skipped until we natively integrate the CA into our workflow.
Keep checking our blog as we may announce your favorite CAs in near future.

<strong>How is this different from Apps Service Certificate support for GoDaddy?</strong>
In the App Service Certificate scenario the focus is very similar to common industry wide solution of solving enrolling for SSL certificates in minutes based on the assumption that the domain owner and app developer are the same entities and Domain Validated certificates are good enough for the web apps.
This release complements it. Our initial focus is on OV and EV SSL certificates. We will merge these into one workflow in the future.

<strong>Will there be any charge for Key Vault certificates?</strong>
Please check with your Certificate Authority regarding what they charge for certificates. In addition Azure Key Vault charges a transaction fee as listed <a href="https://azure.microsoft.com/en-us/pricing/details/key-vault/">here</a>.

<strong>How soon are certificates issued via Azure Key Vault?</strong>
The certificates are generally issued within 2 to 3 seconds of the certificate request as long as your information with the CA is up-to-date. The domains which are included in the certificates have to be pre-vetted by the Public CAs which takes 2 to 3days, so we recommend you do this ahead of time.

<strong>Can I request certificates other than SSL?</strong>
Azure Key Vault certificate policy can be used to set the relevant EKUs and accordingly create a certificate signing request and get it signed by a CA or self-sign it. Currently the scenario has been mainly optimized for SSL certificates.

<strong>Can I get certificates for multiple domain names (SAN certificates)?</strong>
Azure Key Vault certificate policy can be set to include SAN (DNS names) and accordingly send it to the CA.
Is the key that backs my certificate bound to HSMs in the Key Vault service?
When generating your CSR, you have the option to specify that the key pair be generated as non-exportable and generated inside an HSM. If you do this then you cannot distribute your certificate and private key to your app nodes as illustrated in the end-to-end flow example above. Instead you must use software that can terminate TLS with a remote key in a key vault, such as Brocade’s Virtual Traffic Manager. Your app will be subject to throttling limits on Azure Key Vault. Use this option when isolation of your key is more important than scalability of your application or the latency of your TLS transactions.
<h2>Terminology</h2>
<strong>Public CA (Certificate Authority)</strong>
Certificate authority or certification authority (CA) is a trusted entity that issues digital certificates. Major browsers and devices include the CAs that they trust.
<strong>Domain Validated Certificate </strong>
These are SSL/TLS certificates contain domain names which are confirmed via email sent to the domain owner listed in the domain registration database (WHOIS). There are also other ways to confirm the domain ownership. e.g. owner can prove ownership by uploading a file on the website. Either method confirms that the party requesting the certificate is in control of the domain.
<strong>Organization Validation certificates (OV):</strong>
CA will rigorously verify the actual organization that is attempting to get the certificate and also that the organization rightfully owns the domain. The organization’s name is also listed in the certificate, giving added trust that both the website and the company are reputable. OV certificates are used by enterprises, governments, and other entities to provide an extra layer of confidence to their online visitors.
<strong>Extended Validation certificates (EV)</strong>
Extended validation certificates are the certificates where highest level of validation was conducted by a Certificate Authority to ensure the domains in the certificates are owned by the organization requesting the certificate. It uses the highest standards of assurance to establish the legitimacy of online entities and confirm their authenticity and ownership of the domains in question. High visibility consumer websites use EV certificates. Browsers show trust in these using indicators such as a green bar.

Comments are disabled, head over to the <a href="https://social.msdn.microsoft.com/forums/azure/en-US/home?forum=AzureKeyVault">Azure Key Vault forum</a> to discuss about this blog</li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>Get started with Azure Key Vault certificates</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/get-started-with-azure-key-vault-certificates</link>
      <pubDate>Mon, 26 Sep 2016 02:30:47 GMT</pubDate>
      <dc:creator><![CDATA[Rashmi Jha [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=545</guid>
      <description><![CDATA[Introduction
Use this tutorial to help you get started with Azure Key Vault Certificates to store...]]></description>
      <content:encoded><![CDATA[<h1>Introduction</h1>
<p>Use this tutorial to help you get started with Azure Key Vault Certificates to store and manage x.509 certificates in Azure. It walks you through the process of using Azure PowerShell to create a certificate self-signed or signed by supported certificate authority, import a certificate and retrieve the certificate with or without private key to use it with an Azure application.  </p>

<strong>Estimated time to complete</strong>: 30 minutes
<strong>Note:</strong>This tutorial does not include instructions for how to write the Azure application that will consume the certificate and how to authorize this application to use certificate in the key vault.

<blockquote>
<p style="margin-left: 30px"><em>As usual, we value your input so please take a moment to join our <a href="https://eepurl.com/3zw6z"><b>advisory board</b></a>, <a href="mailto:azurekeyvault@microsoft.com?subject=KVBlog"><b>send us private feedback</b></a>,and/or visit our <a href="https://social.msdn.microsoft.com/Forums/en-US/AzureKeyVault"><b>forum.</b></a></em></p>
</blockquote>

For overview information about Azure Key Vault, see <a href="../key-vault-whatis/">What is Azure Key Vault?</a> and <a href="https://azure.microsoft.com/en-us/documentation/articles/key-vault-get-started/">Get started with Azure Key Vault</a>
<h2>Prerequisites</h2>
<p>To complete this tutorial, you must have the following:</p>
<ul>
<li>	An existing key vault that you have been using.</li>
<li>	A pfx file stored on your hard drive.</li>
<li>	Azure PowerShell, minimum version of 2.1.0. 
<p>To install Azure PowerShell and associate it with your Azure subscription, see <a href="https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/">How to install and configure Azure PowerShell</a>. If you have already installed Azure PowerShell and do not know the version, from the Azure PowerShell console, type (<code>Get-Module azure -ListAvailable).Version</code>.</p></li>
</ul>	
<p>This tutorial is designed for Azure PowerShell beginners who understand the basic concepts, such as modules, cmdlets, and sessions but it also assumes that you are familiar with Azure Key Vault and have gone through  <a href="https://azure.microsoft.com/en-us/documentation/articles/key-vault-get-started/">Get started with Azure Key Vault</a>.</p>

<h1>Connect to your subscriptions</h1>
<p>Start an Azure PowerShell session and sign in to your Azure account with the following command: </p>
<pre>Login-AzureRmAccount</pre>
<p>In the pop-up browser window, enter your Azure account user name and password. Azure PowerShell will get all the subscriptions that are associated with this account and by default, uses the first one. If you have multiple subscriptions, you might have to specify a specific one that was used to create your Azure Key Vault. Type the following to see the subscriptions for your account:</p>
<pre>
Get-AzureRmSubscription</pre>
Then, to specify the subscription that's associated with your key vault, type:
<pre>Set-AzureRmContext -SubscriptionId &lt;subscription ID&gt;
</pre>
<p>For more information about configuring Azure PowerShell, see <a href="https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/">How to install and configure Azure PowerShell.</a></p>

<h1>Set the key vault</h1>    
<p>In our first getting started tutorial, our key vault name was ContosoKeyVault, so we'll continue to use that name and store the details into a variable named vaultName and also set the name for certificate created in the end as ContosoFirstCertificate</p>
<pre>
$vaultName = 'ContosoKeyVault'
$certificateName = 'ContosoFirstCertificate'
</pre>
<h1>Permission to certificates</h1>
<p>A newly created Key Vault by default has following permissions set for the creator of the vault:</p>
Keys:  get, create, delete, list, update, import, backup,
Secrets: 'all' 
Certificates: ‘all’

<p>A vault which was created before the introduction of certificates won’t have any permissions. And in this exercise we are using a previously created key vault and hence, the user would need to set explicit permissions. Type following to give permissions for all operations:</p>
 
<pre>
Set-AzureRmKeyVaultAccessPolicy -VaultName $vaultName -UserPrincipalName ‘patti.fuller@contoso.com' -PermissionsToCertificates all
</pre> 
<p>PermissionsToCertificates can also be set selectively by allowing only certain operations on the certificates.  The list of operations on which permissions can be set are ‘Get, Delete, List, Create, Import, ManageContacts, GetIssuers, ListIssuers, SetIssuers and ‘all’. </p>
 
<h1>Create certificate</h1>   
<h2>Import an existing certificate to key vault</h2>
<p>To import an existing certificate, you must have the certificate in a .PFX or PEM file format. If necessary, export an installed certificate with the private key (.PFX format) and a strong password, and save your certificate to your C:\ drive in a file named clientcert.pfx that you want to upload to Azure Key Vault. Type the following to set the variable securepfxpwd for a password of 123 for the .PFX file:</p>
<pre>
$securepfxpwd = ConvertTo-SecureString –String '123' –AsPlainText –Force</pre>
<p>Then type the following to import the certificate from the .PFX file, which imports the certificate and monitors the lifetime of the certificate in the Key Vault service:</p>
<pre>
$cer = Import-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName -FilePath 'c:\clientcert.pfx' -Password $securepfxpwd</pre>
<p>You can now reference this certificate that you created or uploaded to Azure Key Vault, by using its URI. Use <b>https://ContosoKeyVault.vault.azure.net/certificates/ContosoFirstCertificate</b> to always get the current version, and use https://ContosoKeyVault.vault.azure.net/certificates/ContosoFirstCertificate/24bb21dacfad4f178e3d00e9dd54c034 to get this specific version.  
If you want to retrieve the pfx back i.e. the private key of the certificate then you use <strong>https://ContosoKeyVault.vault.azure.net/secrets/ContosoFirstCertificate</strong> to get the current version and use
https://ContosoKeyVault.vault.azure.net/secrets/ContosoFirstCertificate/24bb21dacfad4f178e3d00e9dd54c034</p>

<h2>Create a self-signed certificate in key vault</h2>
To create certificates in key vault you will first create the certificate policy. 
<pre>
$policy = New-AzureKeyVaultCertificatePolicy   -SubjectName "CN=www.contoso.com"   -IssuerName Self   -ValidityInMonths 12
</pre> 
Type following to add a Self-Signed Certificate and use the above policy to be applied to create the certificate 
<pre>
Add-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName -CertificatePolicy $policy </pre>
 
<h2>Enroll programmatically from Public CA (Certificate Authority)</h2>
<p>Azure Key Vault supports enrollment of certificates from Public CA such as <a href="https://www.digicert.com/azure-key-vault/">DigiCert</a>, and <a href="https://www.globalsign.com/en/lp/certificates-for-azure-key-vault/"> GlobalSign</a>. Azure Key Vault goes on behalf of the user to enroll for certificates from one of the above issuers. In this process Issuer needs to authenticate the entity requesting the certificate and also authorize to receive the requested certificate. Each Issuer requires different set of information to do so and this needs to be set once in the Key Vault. </p>
   
If you select DigiCert to be your certificate authority or Issuer to issue certificates then go through these one-time setup steps to configure DigiCert as one of the Issuer in your vault.   

<strong>Note:</strong> Customer will need to have an existing account or go <a href="https://www.digicert.com/azure-key-vault/connect-to-certcentral-quick-start-guide.htm">here</a> to create one with DigiCert and get domains pre-vetted 

<pre>
#Create an organization for the issuer
$orgIdentifier = "111111"   
$org = New-AzureKeyVaultCertificateOrganizationDetails -Id $orgIdentifier

$apiKey = "111111111" 
$secureApiKey = ConvertTo-SecureString $apiKey -AsPlainText -Force
$accountId = "1111111"
$issuerName = "digiCert01"
 
#Set the relation with the Public CA (DigiCert) for cert issuance
Set-AzureKeyVaultCertificateIssuer -VaultName $vaultName -IssuerName $issuerName -IssuerProvider DigiCert -AccountId $accountId -ApiKey $secureApiKey -OrganizationDetails $org
</pre>

If you select GlobalSign to be your Issuer then go through these one-time setup steps to configure GlobalSign as one of the Issuer in your vault. 

<strong>Note:</strong> Customer will need to have an existing account or go <a href="https://www.globalsign.com/files/6814/7492/2758/globalsign-integration-guide-azure-key-vault.pdf">here</a> to create one with GlobalSign and get your domains pre-vetted

<pre>
#Create an administrator for the issuer (GlobalSign needs to receive Administrator details in the certificate request)
$firstName = "Patti"
$lastName = "Fuller"
$phoneNumber = "4250000000"
$emailAddress = "patti. fuller@contoso.com"
$admin = New-AzureKeyVaultCertificateAdministratorDetails -FirstName $firstName -LastName $lastName -PhoneNumber $phoneNumber -EmailAddress $emailAddress

#Create an organization for the issuer
$org = New-AzureKeyVaultCertificateOrganizationDetails -AdministratorDetails $admin

#Set the relation with the Public CA (GlobalSign) for cert issuance
$apiKey = "Passw0rd!"
$secureApiKey = ConvertTo-SecureString $apiKey -AsPlainText -Force
$accountId = "PAR1000_kvissuer"
$issuerName = "globalsign01"

Set-AzureKeyVaultCertificateIssuer -VaultName $vaultName -IssuerName $issuerName -IssuerProvider GlobalSign -AccountId $accountId -ApiKey $secureApiKey -OrganizationDetails $org
</pre>

Create the certificate policy similar to creating the template that defines what needs to be in the certificate (SubjectName, SAN etc.), when to renew the certificate and from which Issuer the certificate is to be issued.  
<pre>
$policy = New-AzureKeyVaultCertificatePolicy -SecretContentType application/x-pkcs12 -SubjectName "CN=contoso.com" -ValidityInMonths 12 -IssuerName $issuerName -RenewAtNumberOfDaysBeforeExpiry 60</pre>
Request for a certificate based on the above set policy  
<pre>
Add-AzureKeyVaultCertificate -VaultName $vaultName -CertificateName $certificateName -CertificatePolicy $policy
</pre>
Certificate enrollment in Key Vault is an asynchronous process. The Add-AzureKeyVaultCertificate will return back an operation object which will indicate the status of enrollment.  You can poll the creation of Certificate till the status is returned as complete.

<pre>
Get-AzureKeyVaultCertificateOperation -VaultName $vaultName -Name $certificateName</pre>
Once the certificate is created you can view at the newly issued certificate details by following cmdlet

<pre>
Get-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName</pre>

<h2>Create a certificate manually and get signed by a CA </h2>
<p>Azure Key Vault supports to create the certificate signing request with private-public key pair and get it signed by any Certificate Authority of your choice.    It could be internal enterprise CA or external public CA. </p>   
<p>First create the certificate policy. Key Vault will not enroll or renew the certificate from the Issuer on behalf of the user as CA chosen in this scenario is not a supported one and hence the IssuerName is set to Unknown.  </p>  
<pre>
$manualPolicy = New-AzureKeyVaultCertificatePolicy -SubjectName "CN=www.contosoHRApp.com" -ValidityInMonths 1  -IssuerName Unknown
</pre>

Create the certificate signing request
<pre>$certificateOperation = Add-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName -CertificatePolicy $manualPolicy
$certificateOperation.CertificateSigningRequest</pre>

<p>The $certificateOperation.CertificateSigningRequest is the base4 encoded certificate signing request for the certificate. You can take this blob and dump into Issuer’s certificate request website or use tools such as certreq or openssl to get the certificate request signed and complete the process of generating a certificate. </p>
<p>After the certificate request has been signed by the Issuer, you can bring back the signed certificate usually a file with .cer extension and merge it with the initial private-public key created in Azure Key Vault</p>
<pre>
Import-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName -FilePath C:\test\OutputCertificateFile.cer
</pre>

<h2>Retrieve pfx file &amp; add password back  </h2>
 
<p>A typical scenario is that the application would need to pull the pfx of the certificate to the machine where it is going to consume the certificate. Here is an example on how an application can retrieve the pfx from Azure Key Vault to consume it.</p>
 
<pre>
$secretName = "TestCert"
$kvSecret = Get-AzureKeyVaultSecret -VaultName $vaultName -Name $secretName
$kvSecretBytes = [System.Convert]::FromBase64String($kvSecret.SecretValueText)
$certCollection = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection
$certCollection.Import($kvSecretBytes,$null,[System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::Exportable)
 </pre>
If the certificate file needs to be stored on the hard disk then it is good practice to encrypt it with a password. 

<pre>
#Get the file created
$password = '******'
$protectedCertificateBytes = $certCollection.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pkcs12, $password)
$pfxPath = [Environment]::GetFolderPath("Desktop") + "\MyCert.pfx"
[System.IO.File]::WriteAllBytes($pfxPath, $protectedCertificateBytes)
</pre>
Get public portion of Certificate from Certificates Endpoint
 
Type following to retrieve the certificate or the public portion and store in a file with *.cer extension.
 
<pre>
$cert = Get-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName
$filePath = [Environment]::GetFolderPath("Desktop") + "\MyCert.cer"
$certBytes = $cert.Certificate.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert)
[System.IO.File]::WriteAllBytes($filePath, $certBytes)
</pre>
 
<h2>Listing all the certificates from the management endpoint</h2>
<p>For management purposes, you would want to know the certificates in your key vault and related information about it. You would retrieve these information by running following queries as below:   </p>  
<pre>
Get-AzureKeyVaultCertificate –VaultName $vaultName 
</pre>

<h1>Renewal of certificates</h1> 
<p>Azure Key Vault certificates are auto renewed as per the configured certificate policy. Certificate policy is set to either say how many days before expiry do you want to renew the certificate or at what percentage of the lifetime of the certificate. And the policy also needs to have the Issuer value set to a supported Certificate Authority. In case where Certificate Authority needs authorization and authentication details then those should be set while adding the Issuer to the key vault. </p>

<p>Auto-renewal of certificates can fail due to misconfigured values or it can fail due to lack of funds and at times lack of incomplete vetting of domains. In any of the cases the Azure Key Vault Certificate Contact gets notified with the error message.  You can choose to rectify the misconfigured values or add the required funds to your contract so that Azure Key Vault can go ahead and re-attempt the renewal. There will be few instances where Azure key Vault will notify the customer that it is better to manually enroll for the certificate mainly when it is very close to expiry.  In such cases, you should go through and add a certificate using one of the above options. </p>

<h1>Other Azure PowerShell Cmdlets</h1>
<p>Few other commands that you might find useful for managing Azure Key Vault Certificate are:</p>
<ul>
<li>	<code>Add-AzureKeyVaultCertificateContact -VaultName $vaultName -EmailAddress "patti.fuller@contoso.com” </code>The Add-AzureKeyVaultCertificateContact cmdlet adds a contact to an Azure Key Vault for certificate notifications. The contact receives updates about events such as certificate close to expiry, certificate renewed, and so on. These events are determined by the certificate policy.</li>
<li>	<code>Stop-AzureKeyVaultCertificateOperation -VaultName $vaultName -Name $certificateName –Force </code>This cmdlet cancels the certificate operation in process on the $certificateName object.</li>
<li>	<code>Remove-AzureKeyVaultCertificate -VaultName $vaultName -Name $certificateName</code> Example how to remove a specific certificate. </li></ul>

<h1>Next steps</h1>
For a list of the latest Azure PowerShell Certificate cmdlets for Azure Key Vault, see <a href="https://msdn.microsoft.com/en-us/library/azure/dn868052(v=azure.200).aspx">Azure Key Vault Cmdlets</a>
For programming references, see the <a href="https://msdn.microsoft.com/library/azure/mt764801(v=azure.1).aspx">Azure Key Vault developer's guide</a>.]]></content:encoded>
    </item>
    <item>
      <title>Accessing Key Vault from a native application</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/accessing-key-vault-from-a-native-application</link>
      <pubDate>Sat, 17 Sep 2016 04:57:56 GMT</pubDate>
      <dc:creator><![CDATA[Amit Bapat [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=475</guid>
      <description><![CDATA[Hello Folks,

So you ask what is native application? In the Azure AD speak, a native application...]]></description>
      <content:encoded><![CDATA[Hello Folks,

So you ask what is native application? In the Azure AD speak, a native application (sometimes also referred to as native client) is an application that runs on a device (phone, tablet, PC etc.) and needs to authenticate a user to get resources from a web API that is secured by Azure AD. In the context of Key Vault, this would be an application that you want to write, which will access Key Vault by acquiring a token from Azure AD, using a user's credential. Compare that to a service or web application that uses client ID and a secret (or a X509 certificate) to acquire token from Azure AD. The difference being use of  user credentials versus client ID and secret or a certificate.
<blockquote>
<p style="margin-left: 30px"><em>As usual, we value your input so please take a moment to join our <a href="https://eepurl.com/3zw6z"><b>advisory board</b></a>, <a href="mailto:azurekeyvault@microsoft.com?subject=KVBlog"><b>send us private feedback</b></a>,and/or visit our <a href="https://social.msdn.microsoft.com/Forums/en-US/AzureKeyVault"><b>forum.</b></a></em></p>
</blockquote>
Now you'll ask, aren't Azure PowerShell and Azure Cross-platform Command Line Interface examples of such native clients? Yes they are, but they worked without this feature, as they were well known apps that were grandfathered in. Now you can write your own native client applications to access Key Vault. Native client application needs to be configured differently from the web apps or headless worker role etc. So read on!
<blockquote>Note: Native application support for Key Vault is available in all public Azure regions. Soon it will also be available in Azure Government, Azure China and Azure Germany.</blockquote>
Say you want to develop your own client application so that users can use their own credentials and access key vault. This could be for retrieving a secret from Key Vault that the application uses, or accessing a key for some cryptographic operations.
<h2>Registering native client application with Azure Active Directory</h2>
Go to Azure Portal and login to your subscription. Then click on 'More Services' and scroll down the list to find Azure Active Directory (preview) and click on it.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/Azure-AD.png"><img width="809" height="861" class="alignnone size-full wp-image-485" alt="Azure AD" src="https://msdnshared.blob.core.windows.net/media/2016/09/Azure-AD.png" /></a>

Now click on 'App Registrations' and then click 'Add' at the top.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/App-Registrations.png"><img width="396" height="948" class="alignnone size-full wp-image-495" alt="App Registrations" src="https://msdnshared.blob.core.windows.net/media/2016/09/App-Registrations.png" /></a>

Enter name for your application, and select 'Application Type' as 'Native'. Enter a valid redirect URI, don't worry about this value. It only needs to be a valid URI, it doesn't have to actually exist. Then click create.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/Create-Native-Client-App.png"><img width="422" height="1024" class="alignnone size-large wp-image-505" alt="Create Native Client App" src="https://msdnshared.blob.core.windows.net/media/2016/09/Create-Native-Client-App-422x1024.png" /></a>

Now you will see your newly created application listed in the 'App registrations' blade. But we are not done yet. There are a few more settings to take care of. So click on your new application and then click on the 'Required permissions' under the 'API ACCESS' section in the 'Settings' blade.<a href="https://msdnshared.blob.core.windows.net/media/2016/09/Native-Client-Settings.png"><img width="1024" height="859" class="alignnone size-large wp-image-515" alt="Native Client Settings" src="https://msdnshared.blob.core.windows.net/media/2016/09/Native-Client-Settings-1024x859.png" /></a>

Now click on 'Add' in the 'Required permissions' blade. Click on Select an API, type 'AzureKeyVault' (no spaces) in the search box then click 'Azure Key Vault (AzureKeyVault)' and then click Select.

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/Select-AzureKeyVault.png"><img width="1024" height="374" class="alignnone size-large wp-image-516" alt="Select AzureKeyVault" src="https://msdnshared.blob.core.windows.net/media/2016/09/Select-AzureKeyVault-1024x374.png" /></a>

Then in 'Select permissions' blade check 'Have full access to the Azure Key Vault service' then click 'Select' and then 'Done' in the Add API Access blade.
<blockquote>Note: If you have not created a new Key Vault in recent months, you may not see the 'Azure Key Vault (AzureKeyVault)' listed as shown. If you encounter such scenario, simply create a new key vault in your subscription, and return to this step. Creation of a new key vault will trigger registration of Azure Key Vault service in your tenant and then it will show up in the list as shown.</blockquote>
<a href="https://msdnshared.blob.core.windows.net/media/2016/09/Native-Client-Permissions.png"><img width="1024" height="325" class="alignnone size-large wp-image-525" alt="Native Client Permissions" src="https://msdnshared.blob.core.windows.net/media/2016/09/Native-Client-Permissions-1024x325.png" /></a>

&nbsp;

Note down the Application ID and Redirect URI of your application. You'll use it in your code.

For a native client you will not use a client ID and client secret (or a X509 cert) like a Web App or API type application does. Notice there is no use of clientCredential in the native application. You'll need to get client ID (referred to as Application ID above) and Redirect URI from the app.config. In addition, PlatformParameters will invoke user authentication dialog.
<pre>/// Get clientID and clientRedirectURI from app.config
var clientId = ConfigurationManager.AppSettings["AuthClientId"];
var clientRedirectURI = ConfigurationManager.AppSettings["AuthClientRedirectURI"];
:
:
/// Get AAD token
var context = new AuthenticationContext(authority, TokenCache.DefaultShared);
var result = await context.AcquireTokenAsync(resource, clientId, new Uri(clientRedirectURI), new PlatformParameters(PromptBehavior.Always));

return result.AccessToken;

</pre>
When you run your native client application, it will automatically prompt user to enter Azure AD credentials. If your directory administrator has configured multi-factor authentication, user will also be presented related prompts. To successfully access keys/secrets in the key vault, the user must have specific permissions to perform those operations. This could be achieved by directly adding an access policy entry for this user or an access policy entry for a Azure AD security group which this user is a member of.

So there you have it! You can now write your own key vault application where user credentials are used to access a key vault.]]></content:encoded>
    </item>
    <item>
      <title>Updated: Deploy Certificates to VMs from customer-managed Key Vault</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/updated-deploy-certificates-to-vms-from-customer-managed-key-vault</link>
      <pubDate>Wed, 14 Sep 2016 21:50:09 GMT</pubDate>
      <dc:creator><![CDATA[Amit Bapat [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=445</guid>
      <description><![CDATA[Hello again,

We have blogged about this topic in the past. Key Vault and Azure PowerShell have...]]></description>
      <content:encoded><![CDATA[Hello again,

We have <a href="https://blogs.technet.microsoft.com/kv/2015/07/14/deploy-certificates-to-vms-from-customer-managed-key-vault/">blogged about this topic</a> in the past. Key Vault and Azure PowerShell have gone through many changes since then. Therefore I've updated this blog post with latest information.
<blockquote>
<p style="margin-left: 30px"><em>As usual, we value your input so please take a moment to join our <a href="https://eepurl.com/3zw6z"><b>advisory board</b></a>, <a href="mailto:azurekeyvault@microsoft.com?subject=KVBlog"><b>send us private feedback</b></a>,and/or visit our <a href="https://social.msdn.microsoft.com/Forums/en-US/AzureKeyVault"><b>forum.</b></a></em></p>
</blockquote>
Consider this scenario: You have a cloud application running in a VM in Azure. This application needs a certificate, it could be for SSL for a website, for signing, or for authenticating (to Azure AD for example). How do you get these certificates into this VM today?
<ul>
 	<li>Embedded in the VM image, which means you have to rebuild the image when you update your certificates</li>
 	<li>bundled with the application package that gets deployed when the VM is created, which means those certificates also end up in some source code control system, and are accessible by a lot more people</li>
 	<li>some script running at startup provisions it by accessing it from a storage account, which means you still need to store the credentials to this storage account with the script</li>
</ul>
These certificates are of high value and in wrong hands it could compromise your application's security or security of your data. All the three methods described above can leave your certificate vulnerable to exposure. How can you make sure that the certificate stays safe until it is injected in the VM, when the VM gets created? You can with Azure Key Vault! Read on...

With Azure VMs deployed through Azure Resource Manager you can now store such certificates in Azure Key Vault and then Azure (Microsoft.Compute resource provider to be specific) will push them into your VMs when the VMs are deployed. Certificates can be used in many scenarios: SSL, encryption, certificate based authentication are just some examples.

By using this method, you can keep the certificate safe. Now it's not in the VM image, or in the applications configuration files or some other unsafe locations. By setting appropriate access policy for the key vault you can also control who gets access to your certificate. Another benefit is that you can manage all your certificates in one place in Azure Key Vault.

Here is a quick overview of the process
<ul>
 	<li>You need a certificate in .PFX format (See Note 1)</li>
 	<li>Create a Key Vault (either using template, or use the simple script below)</li>
 	<li>Make sure you have turned on the EnabledForDeployment switch</li>
 	<li>Upload the certificate as a secret (see the sample script)</li>
 	<li>Now grab the template, provide all the parameter values and then deploy the template</li>
</ul>
When you hit deploy, the VM is created, Azure (Microsoft.Compute resource provider) gets the secret stored in the Key Vault and places it in the specified Certificate Store. The EnabledForDeployment flag explicitly gives Azure permission to use the certificates stored as secrets for this deployment. Now applications can access this certificate from the specified Certificate Store.
<h2>Deploying VMs</h2>
As you know, there are always many ways to do the same thing. Here I'll describe one method in detail and also mention alternative methods where they exist.

Here's an example script, that creates a key vault, and then stores a certificate stored in the .pfx file in a local directory, to the Key Vault as a secret.
<pre style="color: #ffffff;background-color: #003366">$vaultName = "contosovault"
$resourceGroup = "contosovaultrg"
$location = "eastus"
$secretName = "servicecert"
$certPassword = "abcd1234"
$fileName = "certforvm.pfx"
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
$fileContentBytes = Get-Content $fileName -Encoding Byte
$fileContentEncoded = [System.Convert]::ToBase64String($fileContentBytes)

$jsonObject = @"
{
  "data": "$fileContentEncoded",
  "dataType" :"pfx",
  "password": "$certPassword"
}
"@

$jsonObjectBytes = [System.Text.Encoding]::UTF8.GetBytes($jsonObject)
$jsonEncoded = [System.Convert]::ToBase64String($jsonObjectBytes)

New-AzureRmResourceGroup -Name $resourceGroup -Location $location
New-AzureRmKeyVault -VaultName $vaultName -ResourceGroupName $resourceGroup -Location $location -sku standard -EnabledForDeployment

$secret = ConvertTo-SecureString -String $jsonEncoded -AsPlainText –Force
Set-AzureKeyVaultSecret -VaultName "contosovault" -Name "servicecert" -SecretValue $secret

</pre>
The first part of the script reads the .pfx file and then stores it as a JSON object with the file content base64 encoded. Then the JSON object is also base64 encoded.

Next it creates a new resource group and then create a key vault. Note the last parameter to the New-AzureKeyVault command, '-EnabledForDeployment', which grants access to Azure (Microsoft.Compute resource provider, if you want to be very specific) to read secrets from the Key Vault for deployments.

The last command simply stores the base64 encoded JSON object in the the Key Vault as a secret.

Here's sample output from the above script
<pre style="color: #ffffff;background-color: #003366">ResourceGroupName : contosovaultrg
Location          : eastus
ProvisioningState : Succeeded
Tags              :
ResourceId        : /subscriptions/4b2eb912-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/contosovaultrg

Vault Name                       : contosovault
Resource Group Name              : contosovaultrg
Location                         : eastus
Resource ID                      : /subscriptions/4b2eb912-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/contosovaultrg/providers/Microsoft.KeyVault/vaults/contosovault
Vault URI                        : https://contosovault.vault.azure.net
Tenant ID                        : 72f988bf-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SKU                              : standard
Enabled For Deployment?          : True
Enabled For Template Deployment? : False
Enabled For Disk Encryption?     : False
Access Policies                  :
                                   Tenant ID                :   72f988bf-xxxx-xxxx-xxxx-xxxxxxxxxxxx
                                   Object ID                :   50be469a-d7eb-4b26-a2d4-b092cebf0c80
                                   Application ID           :
                                   Display Name             :   Derick Developer (derick@contoso.com)
                                   Permissions to Keys      :   get, create, delete, list, update, import, backup,
                                   restore
                                   Permissions to Secrets   :   all


Tags                             :

Vault Name   : contosovault
Name         : servicecert
Version      : 359804b000ee42febab8a0bb030e200e
Id           : <span style="color: #00ff00">https://contosovault.vault.azure.net:443/secrets/servicecert/359804b000ee42febab8a0bb030e200e</span>
Enabled      : True
Expires      :
Not Before   :
Created      : 9/14/2016 7:39:42 PM
Updated      : 9/14/2016 7:39:42 PM
Content Type :
Tags         :
</pre>
Now we are ready to deploy a VM template. Note down the URI of the secret from the output (as highlighted above in green).

You'll need a template located <a href="https://azure.microsoft.com/en-us/documentation/templates/201-vm-push-certificate-windows/">here</a>. You can directly hit the 'Deploy to Azure' button at the top or deploy from Azure PowerShell using the instructions on that page. You'll need to supply values for all the parameters as noted on that page. The parameters of special interest (besides the usual VM parameters) are the Vault Name, Vault Resource Group and the Secret URI (highlighted in green above). And of course you can also download it from <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-push-certificate-windows">GitHub </a>and modify as needed.

When this VM is deployed, Azure will inject the certificate into the VM. On Windows, certificates in PFX file are added with the private key not exportable. The certificate is added to the LocalMachine certificate location, with the certificate store that the user provided. On Linux, the certificate file is placed under the /var/lib/waagent directory, with the file name &lt;UppercaseThumbprint&gt;.crt for the X509 certificate file and &lt;UppercaseThumbpring&gt;.prv for private key. Both of these files are .pem formatted. See <a href="https://how2ssl.com/articles/working_with_pem_files/">Working with PEM files</a> for more information.

The application usually find the certificate using the Thumbprint and doesn't need modification.
<h2>Updating certificates</h2>
Six months later (or whatever you've set as your certificate's lifetime), you need to create new certificates and push them to the VMs. But this time, the VMs are already running. Hence we need to push the certificates into existing VMs too. First you need to get a new certificate, store it in the key vault (as shown above). You'll notice in the $certUrl below, that it still uses the same secret name, but since this is a new version, the version ID has changed. When we update an existing secret Key Vault will automatically create a new version. You need to grab this new secret version. Then use the 'Add-AzureVMSecret' cmdlet to push the certificate into an existing VM, and finally run Update-AzureVM command so the change takes effect; see the code snippet example below. If new VMs are also going to be created later that need this certificate, you'll also need to update your template with this new secret URI.
<pre style="color: #ffffff;background-color: #003366">$subId = (Get-AzureRmContext).Subscription.SubscriptionId
$vm = Get-AzureRmVM -ResourceGroupName contosovaultrg -Name contosovm
$SourceVaultId = (Get-AzureRmKeyVault -VaultName contosovault).ResourceId
$certStore = "My";
$certUrl = (Get-AzureKeyVaultSecret -VaultName contosovault -Name servicecert).Id;
$vm = Add-AzureRmVMSecret -VM $vm -SourceVaultId $SourceVaultId -CertificateStore $certStore -CertificateUrl $certUrl;
Update-AzureRmVM -ResourceGroupName contosovaultrg -VM $vm
</pre>
Now that you have the certificate pushed to the VM, you need to 'tell' your application to use this new value. How you do this will be highly dependent on your application, hence I'm leaving that exercise to you. If your application configuration finds this certificate by thumbprint, then you will need to update your application configuration with thumbprint of the new certificate.
<h2>Retiring certificates</h2>
In the above section we showed you how to push a new certificate to your existing VMs. But your old certificate is still in the VM and cannot be removed. For added security you can change the attribute for old secret to 'Disabled' so that even if an old template tries to create a VM with this old version of certificate, it will. Here's how you set a specific secret version disabled:
<pre style="color: #ffffff;background-color: #003366">Set-AzureKeyVaultSecretAttribute -VaultName contosovault -Name servicecert -Version e3391a126b65414f93f6f9806743a1f7 -Enable 0</pre>
<h2>Conclusion</h2>
Now let's revisit our scenario again and see how things are different now:
<ul>
 	<li>With this new scheme, the certificate can be kept separate from the VM image or the application payload. So we have removed one point of exposure.</li>
 	<li>The certificate can also be renewed and uploaded to the Key Vault without having to re-build the VM image or the application deployment package. The application still needs to be supplied with the new URI for this new certificate version though.</li>
 	<li>By separating the certificate from the VM or the application payload, we have now reduced the number of personnel that will have direct access to the certificate.</li>
 	<li>As an added benefit, you now have one convenient place in key vault to manage all your certificates, including the all the versions that were deployed over time.</li>
</ul>
There you have it! Azure Key Vault makes it easier to inject certificates into the VMs and keeping them safe.
<h2>Notes</h2>
Note 1: You can quickly generate a self-signed certificate using this PowerShell snippet.
<pre style="color: #ffffff;background-color: #003366">$certificateName = "certforvm"
$thumbprint = (New-SelfSignedCertificate -DnsName $certificateName -CertStoreLocation Cert:\CurrentUser\My -KeySpec KeyExchange).Thumbprint
$cert = (Get-ChildItem -Path cert:\CurrentUser\My\$thumbprint)
$password = Read-Host -Prompt "Please enter the certificate password." -AsSecureString
Export-PfxCertificate -Cert $cert -FilePath ".\$certificateName.pfx" -Password $password
</pre>
Comments are disabled, head over to the <a href="https://social.msdn.microsoft.com/Forums/azure/en-US/home?forum=AzureKeyVault">Azure Key Vault forum</a> to discuss about this blog.
<table border="0" style="background-color: #003366"></table>]]></content:encoded>
    </item>
    <item>
      <title>Manage your key vaults from Azure portal</title>
      <link>https://docs.microsoft.com/archive/blogs/kv/manage-your-key-vaults-from-new-azure-portal</link>
      <pubDate>Mon, 12 Sep 2016 19:50:35 GMT</pubDate>
      <dc:creator><![CDATA[Amit Bapat [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kv/?p=365</guid>
      <description><![CDATA[Hello again! As promised in our last post, we are back with more today! We are really excited to...]]></description>
      <content:encoded><![CDATA[Hello again! As promised in our last post, we are back with more today! We are really excited to announce availability of one of the most requested features. So far managing key vaults required you to use command line tools, but starting today you can manage all your key vaults from the <a href="https://portal.azure.com">Azure portal</a> (new). This capability is now in preview in all public Azure regions. In coming weeks it will also become available in Azure Government and Azure China.
<blockquote><em>As usual, we value your input so please take a moment to join our <a href="https://eepurl.com/3zw6z"><b>advisory board</b></a>, <a href="mailto:azurekeyvault@microsoft.com?subject=KVBlog"><b>send us private feedback</b></a>,and/or visit our <a href="https://social.msdn.microsoft.com/Forums/en-US/AzureKeyVault"><b>forum</b></a><b>.</b>  </em></blockquote>
With Key Vault user interface in the Azure portal, you can browse existing vaults, create new vaults, set access policies and other attributes, create/edit tags for your key vaults, create and update keys and secrets, view current and older versions of your keys and edit attributes. All your existing vaults should automatically show up when you browse resources from the new Azure portal. So head over to the <a href="https://portal.azure.com">Azure portal</a> and give it a spin and let us know what you think.

Here are a few screenshots of the Key Vault user experience in the Azure portal.

[caption id="attachment_366" align="alignnone" width="1024"]<a href="https://msdnshared.blob.core.windows.net/media/2016/09/KV-browse-vaults.png"><img src="https://msdnshared.blob.core.windows.net/media/2016/09/KV-browse-vaults-1024x554.png" alt="Key Vault - Browse key vaults" width="1024" height="554" class="size-large wp-image-366" /></a> Key Vault - Browse key vaults[/caption]

&nbsp;

[caption id="attachment_405" align="alignnone" width="1024"]<a href="https://msdnshared.blob.core.windows.net/media/2016/09/KV-vault-settings.png"><img src="https://msdnshared.blob.core.windows.net/media/2016/09/KV-vault-settings-1024x926.png" alt="Key Vault Settings" width="1024" height="926" class="size-large wp-image-405" /></a> Key Vault Settings[/caption]

&nbsp;

[caption id="attachment_395" align="alignnone" width="874"]<a href="https://msdnshared.blob.core.windows.net/media/2016/09/KV-list-keys.png"><img src="https://msdnshared.blob.core.windows.net/media/2016/09/KV-list-keys.png" alt="Key Vault - List keys" width="874" height="781" class="size-full wp-image-395" /></a> Key Vault - List keys[/caption]

&nbsp;

[caption id="attachment_375" align="alignnone" width="875"]<a href="https://msdnshared.blob.core.windows.net/media/2016/09/KV-edit-key-version.png"><img src="https://msdnshared.blob.core.windows.net/media/2016/09/KV-edit-key-version.png" alt="Key Vault - edit key version attributes" width="875" height="901" class="size-full wp-image-375" /></a> Key Vault - edit key version attributes[/caption]

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/KV-edit-vault-permissions1.png"><img src="https://msdnshared.blob.core.windows.net/media/2016/09/KV-edit-vault-permissions1-1024x864.png" width="1024" height="864" class="alignnone wp-image-415 size-large" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2016/09/KV-edit-vault-permissions2.png"><img src="https://msdnshared.blob.core.windows.net/media/2016/09/KV-edit-vault-permissions2-859x1024.png" alt="KV - edit vault permissions2" width="859" height="1024" class="alignnone size-large wp-image-425" /></a>

Key Vault - Edit Access Policies. Access policies interface allows you to select pre-configured templates to quickly set right permissions for most used tasks for users and service principals by providing a choice of templates to choose from. And of course you can also edit the individual permissions for keys and secrets to tune it further.

Comments are disabled. Head over this <a href="https://social.msdn.microsoft.com/Forums/azure/en-US/cfd8b584-f1e6-456b-9545-cc684f0a528e/azure-key-vault-manage-your-key-vaults-from-new-azure-portal?forum=AzureKeyVault">Azure Key Vault forums thread</a> to submit your feedback.]]></content:encoded>
    </item>
  </channel>
</rss>