Cristian E.
Cristian E.

Reputation: 3583

Azure ARM Template - Is it possible to define SSL binding for App Service with .pfx KeyVault Certificate?

I want to use a linked ARM template for adding a SSL binding for an existing App Service.

So far according to official docs: https://learn.microsoft.com/en-us/azure/templates/microsoft.web/certificates

{
  "name": "string",
  "type": "Microsoft.Web/certificates",
  "apiVersion": "2020-06-01",
  "kind": "string",
  "location": "string",
  "tags": {},
  "properties": {
    "hostNames": [
      "string"
    ],
    "pfxBlob": [
      "integer"
    ],
    "password": "string",
    "keyVaultId": "string",
    "keyVaultSecretName": "string",
    "serverFarmId": "string",
    "canonicalName": "string"
  }
}

There are properties for:

But nothing about KeyVault Certificates.

Are KeyVault Certificates supported at all in ARM?

P.S. I do know that instead of PFX I could just upload the certificate as a KeyVault object backed by a Secret. However i'm insterested in using PFX directly if possible.

Upvotes: 0

Views: 449

Answers (2)

Sandro Mastronardi
Sandro Mastronardi

Reputation: 13

It is perfectly possible to use a certificate from Key Vault this way: The KeyVaultSecretName must be the name of the certificate (names are unique across keys, secrets, and certificates) When you create a certificate this way it will reference the certificate in the key vault... The only thing that I encountered is that a "dependsOn" reference in your ARM Template on this certificate doesn't work... so my script is failing the first time because the certificate is not found on resources that depend on it... but it is created nevertheless.

Do keep in mind that the certificate must exist ofcourse.. I use https://github.com/shibayan/keyvault-acmebot for this.

Upvotes: 1

Joey Cai
Joey Cai

Reputation: 20067

Are KeyVault Certificates supported at all in ARM?

Currently KeyVault only supports adding new secrets using ARM templates. Your needs are temporarily not supported, so it cannot be resolved at this time.

You can put forward your needs in azure key vault user voice, so that the development team can better improve the product.

Upvotes: 1

Related Questions