title: How to assign Access Policies to an Azure Key Vault using Blueprints
body: <p>I am creating a key vault through an Azure Blueprint: it gets created with no problem.
  The thing is that, in order to access the Key Vault (Listing it, putting or getting values) Access Policies must be configured.</p>
  <p>With ARM templates, I could insert a section like :</p>
  <pre><code>&quot;accessPolicies&quot;: [
                      {
                          &quot;tenantId&quot;: &quot;22222222-3333-4444-aaaa-eeeeeeeeeeee&quot;,
                          &quot;objectId&quot;: &quot;77777777-6666-4444-8888-111111111111&quot;,
                          &quot;permissions&quot;: {
                              &quot;keys&quot;: [
                                  &quot;Get&quot;,
                                  ...
                                  &quot;Restore&quot;
                              ],
                              &quot;secrets&quot;: [
                                  &quot;Get&quot;,
                                  ...
                                  &quot;Restore&quot;
                              ],
                              &quot;certificates&quot;: []
                          }
                      },
  </code></pre>
  <p>but I'd need to have a <code>TenantId</code> and an <code>ObjectId</code> to hardcode, or to get as parameter, which is not the right way to do it.
  Unfortunately I could not find a way to assign these access policies to the Key Vault, without which the key vault itself just can't be used, unless making those settings manual (and deleting them each time the blueprint is upgraded).</p>
  <p>Is there a guideline or a best practice to do this in the proper way ?</p>