Skip to content

Commit d54560c

Browse files
update tabs
1 parent d7e5374 commit d54560c

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

articles/container-apps/functions-secrets-tutorial.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ Azure Container Apps provides two ways to store secrets that your function code
3838
> [!TIP]
3939
> Use Container Apps secrets for development and simple workloads. Use Key Vault references for production workloads that need centralized management, automatic rotation, or compliance-grade auditing.
4040
41-
# [Container Apps secrets](#tab/in-place)
41+
## Use Container Apps secrets
4242

43-
## Store a secret in Container Apps
43+
### Store a secret in Container Apps
4444

4545
Container Apps stores secrets in the app's `configuration.secrets` array. The platform encrypts values at rest. You can reference secrets defined here in environment variables, scale rules, volume mounts, and Dapr components.
4646

47-
### [Portal](#tab/portal)
47+
#### [Portal](#tab/portal)
4848

4949
1. Go to your Functions container app in the [Azure portal](https://portal.azure.com).
5050

@@ -62,7 +62,7 @@ Container Apps stores secrets in the app's `configuration.secrets` array. The pl
6262

6363
1. Select **Add**.
6464

65-
### [Azure CLI](#tab/cli)
65+
#### [Azure CLI](#tab/cli)
6666

6767
Add a secret when you create your Functions container app:
6868

@@ -87,11 +87,11 @@ az containerapp secret set \
8787

8888
---
8989

90-
## Reference the secret in an environment variable
90+
### Reference the secret in an environment variable
9191

9292
After you store a secret, reference it in an environment variable so your function code can read it.
9393

94-
### [Portal](#tab/portal)
94+
#### [Portal](#tab/portal)
9595

9696
1. In your Functions container app, under *Application*, select **Revisions and replicas**.
9797

@@ -111,7 +111,7 @@ After you store a secret, reference it in an environment variable so your functi
111111

112112
1. Select **Save**, and then select **Create** to deploy the new revision.
113113

114-
### [Azure CLI](#tab/cli)
114+
#### [Azure CLI](#tab/cli)
115115

116116
```azurecli
117117
az containerapp update \
@@ -122,7 +122,7 @@ az containerapp update \
122122

123123
---
124124

125-
## Verify the Container Apps secret
125+
### Verify the Container Apps secret
126126

127127
Confirm your function can read the secret valueby invoking the function and checking that it runs without errors related to missing configuration.
128128

@@ -133,7 +133,7 @@ curl "https://<FUNCTIONS_APP_URL>/api/<FUNCTION_NAME>"
133133
> [!IMPORTANT]
134134
> Container Apps injects the secret value into the environment variable at runtime. Your code reads the environment variable and doesn't access the secret store directly.
135135
136-
## Limitations of Container Apps secrets
136+
### Limitations of Container Apps secrets
137137

138138
- **No centralization**: Each container app stores its own secrets separately.
139139
- **No automatic rotation**: You must update secret values manually.
@@ -142,13 +142,13 @@ curl "https://<FUNCTIONS_APP_URL>/api/<FUNCTION_NAME>"
142142
- **No versioning**: No built-in secret version history.
143143
- **Update behavior**: Changing a secret doesn't create a new revision. You must create a new revision or restart existing revisions to pick up changes.
144144

145-
# [Key Vault references](#tab/keyvault)
145+
## Use Key Vault references
146146

147-
## Set up managed identity
147+
### Set up managed identity
148148

149149
Your container app needs a managed identity to authenticate to Key Vault without credentials.
150150

151-
### [Portal](#tab/portal)
151+
#### [Portal](#tab/portal)
152152

153153
1. Go to your Functions container app in the [Azure portal](https://portal.azure.com).
154154

@@ -158,7 +158,7 @@ Your container app needs a managed identity to authenticate to Key Vault without
158158

159159
1. Select **Save**, and then select **Yes** to confirm.
160160

161-
### [Azure CLI](#tab/cli)
161+
#### [Azure CLI](#tab/cli)
162162

163163
```azurecli
164164
az containerapp identity assign \
@@ -169,11 +169,11 @@ az containerapp identity assign \
169169

170170
---
171171

172-
## Grant Key Vault access
172+
### Grant Key Vault access
173173

174174
Assign the **Key Vault Secrets User** role to the managed identity so it can read secrets.
175175

176-
### [Portal](#tab/portal)
176+
#### [Portal](#tab/portal)
177177

178178
1. Go to your Key Vault in the [Azure portal](https://portal.azure.com).
179179

@@ -191,7 +191,7 @@ Assign the **Key Vault Secrets User** role to the managed identity so it can rea
191191

192192
1. Select **Review + assign**.
193193

194-
### [Azure CLI](#tab/cli)
194+
#### [Azure CLI](#tab/cli)
195195

196196
```azurecli
197197
PRINCIPAL_ID=$(az containerapp show \
@@ -213,9 +213,9 @@ az role assignment create \
213213

214214
---
215215

216-
## Store a secret in Key Vault
216+
### Store a secret in Key Vault
217217

218-
### [Portal](#tab/portal)
218+
#### [Portal](#tab/portal)
219219

220220
1. In your Key Vault, under *Objects*, select **Secrets**.
221221

@@ -235,7 +235,7 @@ az role assignment create \
235235

236236
1. Copy the **Secret Identifier** URI. Use the versionless URI (without the trailing version segment) to enable automatic rotation.
237237

238-
### [Azure CLI](#tab/cli)
238+
#### [Azure CLI](#tab/cli)
239239

240240
```azurecli
241241
az keyvault secret set \
@@ -254,11 +254,11 @@ echo $SECRET_URI
254254

255255
---
256256

257-
## Reference the Key Vault secret in Container Apps
257+
### Reference the Key Vault secret in Container Apps
258258

259259
Create a Container Apps secret that references the Key Vault secret, then bind it to an environment variable.
260260

261-
### [Portal](#tab/portal)
261+
#### [Portal](#tab/portal)
262262

263263
1. Go to your Functions container app. Under *Settings*, select **Secrets**.
264264

@@ -277,7 +277,7 @@ Create a Container Apps secret that references the Key Vault secret, then bind i
277277

278278
1. Under *Application*, select **Revisions and replicas**. Create a new revision with the environment variable `DATABASE_PASSWORD` referencing the `database-password` secret.
279279

280-
### [Azure CLI](#tab/cli)
280+
#### [Azure CLI](#tab/cli)
281281

282282
For system-assigned identity:
283283

@@ -308,15 +308,15 @@ az containerapp update \
308308

309309
---
310310

311-
## Verify the Key Vault secret
311+
### Verify the Key Vault secret
312312

313313
Invoke your function and confirm it runs without errors related to missing configuration:
314314

315315
```bash
316316
curl "https://<FUNCTIONS_APP_URL>/api/<FUNCTION_NAME>"
317317
```
318318

319-
## Automatic secret rotation
319+
### Automatic secret rotation
320320

321321
When you reference a Key Vault secret with a versionless URI, Container Apps automatically retrieves the latest version:
322322

0 commit comments

Comments
 (0)