Skip to content

Commit dafdd54

Browse files
authored
Merge pull request #297414 from Akhilesh-microsoft/ACA/client_certificate_authorization_gh286840
[GH_286840]: Updated the article to address the issue, extended the documentation to "format the certificate gets forwarded to the app running in ACA container".
2 parents 5a00304 + 918195a commit dafdd54

File tree

1 file changed

+60
-3
lines changed

1 file changed

+60
-3
lines changed

articles/container-apps/client-certificate-authorization.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services: container-apps
55
author: craigshoemaker
66
ms.service: azure-container-apps
77
ms.topic: how-to
8-
ms.date: 06/13/2024
8+
ms.date: 06/30/2025
99
ms.author: cshoe
1010
---
1111

@@ -17,7 +17,7 @@ When client certificates are used, the TLS certificates are exchanged between th
1717

1818
For example, you might want to require a client certificate for a container app that manages sensitive data.
1919

20-
Container Apps accepts client certificates in the PKCS12 format are that issued by a trusted certificate authority (CA), or are self-signed.
20+
Container Apps accepts client certificates in the PKCS12 format when a trusted certificate authority (CA) issues them or when they're self-signed.
2121

2222
## Configure client certificate authorization
2323

@@ -34,7 +34,7 @@ Ingress passes the client certificate to the container app if `require` or `acce
3434
The following ARM template example configures ingress to require a client certificate for all requests to the container app.
3535

3636
```json
37-
{
37+
{
3838
"properties": {
3939
"configuration": {
4040
"ingress": {
@@ -44,6 +44,63 @@ The following ARM template example configures ingress to require a client certif
4444
}
4545
}
4646
```
47+
> [!NOTE]
48+
> You can set the `clientCertificateMode` directly on the ingress property. It isn't available as an explicit option in the CLI, but you can patch your app using the Azure CLI.
49+
50+
Before you run the following commands, make sure to replace the placeholders surrounded by `<>` with your own values.
51+
52+
Get the Azure Resource Manager (ARM) ID of your container app:
53+
54+
```bash
55+
APP_ID=$(az containerapp show \
56+
--name <APP_NAME> \
57+
--resource-group <RESOURCE_GROUP> \
58+
--query id \
59+
--output tsv)
60+
```
61+
62+
Patch the `clientCertificateMode` property on the app:
63+
64+
```azurecli
65+
az rest \
66+
--method patch \
67+
--url "https://management.azure.com/$APP_ID?api-version=<API_VERSION>" \
68+
--body '{
69+
"properties": {
70+
"configuration": {
71+
"ingress": {
72+
"clientCertificateMode": "require"
73+
}
74+
}
75+
}
76+
}'
77+
```
78+
79+
> [!NOTE]
80+
> Be sure to use a valid and stable API version that supports this feature. For example, replace <API_VERSION> in the command with 2025-01-01 or another supported version.
81+
82+
## Client certificate mode and header format
83+
84+
The value for `clientCertificateMode` varies what you need to provide for Container Apps to manage your certificate:
85+
- When `require` is set, the client must provide a certificate.
86+
- When `accept` is set, the certificate is optional. If the client provides a certificate, it passes to the app in the `X-Forwarded-Client-Cert` header, as a semicolon-separated list.
87+
88+
### Example `X-Forwarded-Client-Cert` header value
89+
90+
The following example is a sample value of the `X-Forwarded-Client-Cert` header that your app might receive:
91+
92+
```text
93+
Hash=<HASH_VALUE>;Cert="-----BEGIN CERTIFICATE-----<CERTIFICATE_VALUE>";Chain="-----BEGIN CERTIFICATE-----<CERTIFICATE_VALUE>";
94+
```
95+
96+
### Header field breakdown
97+
98+
| Field | Description | How to Use It |
99+
|---|---|---|
100+
| `Hash` | The SHA-256 thumbprint of the client certificate. | Use the thumbprint to identify or validate the client certificate. |
101+
| `Cert` | The base64-encoded client certificate in PEM format (single certificate). | Parse the certificate to inspect metadata such as subject and issuer. |
102+
| `Chain` | One or more PEM-encoded intermediate certificates. | Provide the intermediate certificates when building a full trust chain for validation. |
103+
47104

48105
## Next Steps
49106

0 commit comments

Comments
 (0)