Skip to content

Commit 8ff132b

Browse files
committed
add on-demand refresh example
1 parent 03cfccf commit 8ff132b

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

articles/azure-app-configuration/quickstart-azure-kubernetes-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ You can customize the installation by providing additional Helm values when inst
400400

401401
#### How to trigger on-demand refresh of ConfigMap and Secret
402402

403-
While you can set up automatic data refresh, there are times when you might want to trigger an on-demand refresh to get the latest data from App Configuration and Key Vault. To do this, you can restart the deployment of the Azure App Configuration Kubernetes provider controller. The Kubernetes provider will then reconcile and update the ConfigMap and Secret with the latest data from your App Configuration store and Key Vault.
403+
While you can set up automatic data refresh, there are times when you might want to trigger an on-demand refresh to get the latest data from App Configuration and Key Vault. To do this, you can modify `metadata.annotations` section and apply the changes. The Kubernetes provider will then reconcile and update the ConfigMap and Secret with the latest data from your App Configuration store and Key Vault. For examples and more information, see [On-demand Refresh](./reference-kubernetes-provider.md#on-demand-refresh).
404404

405405
It is not recommended to delete or modify the ConfigMap and Secret generated by the Kubernetes provider. Although new ones will be generated from the latest data, this could cause downtime for your applications in the event of any failures.
406406

articles/azure-app-configuration/reference-kubernetes-provider.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,34 @@ spec:
550550
interval: 10m
551551
```
552552

553+
### On-demand Refresh
554+
555+
While you can set up automatic data refresh, there are times when you might want to trigger an on-demand refresh to get the latest data from App Configuration and Key Vault. This can be done by adding or updating arbitrary key-value pairs of type `string` in the `metadata.annotations` section. The Kubernetes provider will then reconcile and update the ConfigMap and Secret with the latest data from your App Configuration store and Key Vault.
556+
557+
The following example modifies the `annotations` of `AzureAppConfigurationProvider` with a new key-value pair. After updating the annotations, apply the changes using `kubectl apply` to trigger on-demand refresh.
558+
559+
``` yaml
560+
apiVersion: azconfig.io/v1
561+
kind: AzureAppConfigurationProvider
562+
metadata:
563+
name: appconfigurationprovider-sample
564+
annotations:
565+
key1: value1
566+
spec:
567+
endpoint: <your-app-configuration-store-endpoint>
568+
target:
569+
configMapName: configmap-created-by-appconfig-provider
570+
configuration:
571+
selectors:
572+
- keyFilter: app1*
573+
labelFilter: common
574+
secret:
575+
target:
576+
secretName: secret-created-by-appconfig-provider
577+
auth:
578+
managedIdentityClientId: <your-user-assigned-managed-identity-client-id>
579+
```
580+
553581
### ConfigMap Consumption
554582

555583
Applications running in Kubernetes typically consume the ConfigMap either as environment variables or as configuration files. If the `configMapData.type` property is absent or is set to default, the ConfigMap is populated with the itemized list of data retrieved from Azure App Configuration, which can be easily consumed as environment variables. If the `configMapData.type` property is set to json, yaml or properties, data retrieved from Azure App Configuration is grouped into one item with key name specified by the `configMapData.key` property in the generated ConfigMap, which can be consumed as a mounted file.

0 commit comments

Comments
 (0)