Skip to content

Commit c683478

Browse files
Merge pull request #305197 from RichardChen820/appconfig/import/configmap
[azappconfig] Import kv from AKS configmap
2 parents 7195636 + f005afe commit c683478

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

articles/azure-app-configuration/howto-import-export-data.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,57 @@ For more optional parameters and examples, go to [az appconfig kv import](/cli/a
259259
260260
---
261261
262+
### Import data from Azure Kubernetes Service ConfigMaps
263+
264+
Follow the steps below to import key-values from Azure Kubernetes Service ConfigMaps. Portal support for this feature is in development, please use Azure CLI to import from AKS.
265+
266+
#### [Portal](#tab/azure-portal)
267+
268+
The Azure portal support for this feature is in development.
269+
270+
#### [Azure CLI](#tab/azure-cli)
271+
272+
From the Azure CLI, follow the steps below. If you don't have the Azure CLI installed locally, you can optionally use [Azure Cloud Shell](../cloud-shell/overview.md).
273+
274+
1. Enter the import command `az appconfig kv import` and add the following parameters:
275+
276+
| Parameter | Description | Example |
277+
|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
278+
| `--name` | Enter the name of the App Configuration store you want to import data to. | `my-app-config-store` |
279+
| `--source` | Enter `aks` to indicate that you're importing app configuration data from Azure Kubernetes Service. | `aks` |
280+
| `--aks-cluster` | Enter the Azure Kubernetes Service's ARM ID or use the name of the Azure Kubernetes Service, if it's in the same subscription and resource group as the App Configuration. | `/subscriptions/123/resourceGroups/my-resource-group/providers/Microsoft.ContainerService/managedClusters/my-aks-cluster` or `my-aks-cluster` |
281+
| `--configmap-namespace`| Enter the namespace of the ConfigMap you want to import. | `default` |
282+
| `--configmap-name` | Enter the name of the ConfigMap you want to import. | `my-configmap` |
283+
284+
1. Optionally also add the following parameters:
285+
286+
| Parameter | Description | Example |
287+
|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------|
288+
| `--prefix` | Optional. A key prefix is the beginning part of a key-value's "key" property. Prefixes can be used to manage groups of key-values in a configuration store. This prefix will be appended to the front of the "key" property of each imported key-value. | `TestApp:` |
289+
| `--label` | Optional. Enter a label that will be assigned to your imported key-values. If you don't specify a label, the null label will be assigned to your key-values. | `test` |
290+
| `--content-type` | Optional. Enter appconfig/kvset or application/json to state that the imported content consists of a Key Vault reference or a JSON file. | `application/json` |
291+
| `--format` | Optional. Enter yaml, properties, or json to indicate the format of ConfigMap you're importing. | `json` |
292+
| `--separator` | Optional. The separator is the delimiter for flattening the key-values. It's required for exporting hierarchical structure and will be ignored for property files and feature flags. Select one of the following options: `.`, `,`, `:`, `;`, `/`, `-`, `_`, `—`. | `;` |
293+
294+
295+
To get the value for `--aks-cluster`, use the command `az aks show --resource-group <resource-group> --name <aks-cluster-name>`.
296+
297+
Example: import all settings from your AKS Configmap as key-values with the label "test", to your App Configuration store, and add a "TestApp:" prefix.
298+
299+
```azurecli
300+
az appconfig kv import --name my-app-config-store --source aks --aks-cluster /subscriptions/123/resourceGroups/my-resource-group/providers/Microsoft.ContainerService/managedClusters/my-aks-cluster --configmap-namespace default --configmap-name my-configmap --label test --prefix TestApp:
301+
```
302+
303+
1. The command line displays a list of the coming changes. Confirm the import by selecting `y`.
304+
305+
:::image type="content" source="./media/import-export/continue-import-aks-prompt.png" alt-text="Screenshot of the CLI. Import from AKS confirmation prompt.":::
306+
307+
You imported all settings from your AKS ConfigMap as key-values, assigned them the label "test", and added a "TestApp:" prefix.
308+
309+
For more optional parameters and examples, go to [az appconfig kv import](/cli/azure/appconfig/kv?view=azure-cli-latest#az-appconfig-kv-import&preserve-view=true).
310+
311+
---
312+
262313
## Export data
263314
264315
Export writes configuration data stored in App Configuration to another destination. Use the export function, for example, to save data from an App Configuration store to a file that can be embedded in your application code during deployment.
34.6 KB
Loading

0 commit comments

Comments
 (0)