Skip to content

Commit 0832a33

Browse files
authored
Merge pull request #192176 from JackStromberg/patch-46
Endorse best practice and remove limitation
2 parents afa5905 + f92853d commit 0832a33

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

articles/application-gateway/key-vault-certs.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ Application Gateway uses a secret identifier in Key Vault to reference the certi
4040

4141
The Azure portal supports only Key Vault certificates, not secrets. Application Gateway still supports referencing secrets from Key Vault, but only through non-portal resources like PowerShell, the Azure CLI, APIs, and Azure Resource Manager templates (ARM templates).
4242

43-
> [!WARNING]
44-
> Azure Application Gateway currently supports only Key Vault accounts in the same subscription as the Application Gateway resource. Choosing a Key Vault under a different subscription than your Application Gateway will result in a failure.
43+
References to Key Vaults in other Azure subscriptions is supported, but must be configured via ARM Template, Azure PowerShell, CLI, Bicep, etc. Cross-subscription key vault configuration is not supported by Application Gateway via Azure Portal today.
4544

4645
## Certificate settings in Key Vault
4746

@@ -132,26 +131,13 @@ $appgw = Get-AzApplicationGateway -Name MyApplicationGateway -ResourceGroupName
132131
Set-AzApplicationGatewayIdentity -ApplicationGateway $appgw -UserAssignedIdentityId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyManagedIdentity"
133132
# Get the secret ID from Key Vault
134133
$secret = Get-AzKeyVaultSecret -VaultName "MyKeyVault" -Name "CertificateName"
135-
$secretId = $secret.Id # https://<keyvaultname>.vault.azure.net/secrets/<hash>
134+
$secretId = $secret.Id.Replace($secret.Version, "") # Remove the secret version so AppGW will use the latest version in future syncs
136135
# Specify the secret ID from Key Vault
137136
Add-AzApplicationGatewaySslCertificate -KeyVaultSecretId $secretId -ApplicationGateway $appgw -Name $secret.Name
138137
# Commit the changes to the Application Gateway
139138
Set-AzApplicationGateway -ApplicationGateway $appgw
140139
```
141140
142-
> [!NOTE]
143-
> If you require Application Gateway to sync the last version of the certificate with the key vault, provide the versionless `secretId` value (no hash). To do this, in the preceding example, replace the following line:
144-
>
145-
> ```
146-
> $secretId = $secret.Id # https://<keyvaultname>.vault.azure.net/secrets/<hash>
147-
> ```
148-
>
149-
> With this line:
150-
>
151-
> ```
152-
> $secretId = $secret.Id.Replace($secret.Version, "") # https://<keyvaultname>.vault.azure.net/secrets/
153-
> ```
154-
155141
Once the commands have been executed, you can navigate to your Application Gateway in the Azure portal and select the Listeners tab. Click Add Listener (or select an existing) and specify the Protocol to HTTPS.
156142
157143
Under **Choose a certificate** select the certificate named in the previous steps. Once selected, select *Add* (if creating) or *Save* (if editing) to apply the referenced Key Vault certificate to the listener.

0 commit comments

Comments
 (0)