You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Pull settings from App Configuration with Azure Pipelines
3
-
description: Learn how to use Azure Pipelines to pull key-values from an App Configuration Store
2
+
title: Export settings from App Configuration with Azure Pipelines
3
+
description: Learn how to use Azure Pipelines to export key-values from an App Configuration Store
4
4
services: azure-app-configuration
5
5
author: maud-lv
6
6
ms.service: azure-app-configuration
7
7
ms.topic: how-to
8
-
ms.date: 10/03/2023
8
+
ms.date: 10/29/2024
9
9
ms.author: malev
10
10
---
11
11
12
-
# Pull settings from App Configuration with Azure Pipelines
12
+
# Export settings from App Configuration with Azure Pipelines
13
13
14
-
The [Azure App Configuration](https://marketplace.visualstudio.com/items?itemName=AzureAppConfiguration.azure-app-configuration-task)task pulls key-values from your App Configuration store and sets them as Azure pipeline variables, which can be consumed by subsequent tasks. This task complements the [Azure App Configuration Push](https://marketplace.visualstudio.com/items?itemName=AzureAppConfiguration.azure-app-configuration-task-push) task that pushes key-values from a configuration file into your App Configuration store. For more information, see [Push settings to App Configuration with Azure Pipelines](push-kv-devops-pipeline.md).
14
+
The Azure App Configuration Export task exports key-values from your App Configuration store and sets them as Azure pipeline variables, which subsequent tasks can consume. This task complements the Azure App Configuration Import task that imports key-values from a configuration file into your App Configuration store. For more information, see [Import settings to App Configuration with Azure Pipelines](azure-pipeline-import-task.md).
15
15
16
16
## Prerequisites
17
17
18
18
- Azure subscription - [create one for free](https://azure.microsoft.com/free/)
19
19
- App Configuration store - [create one for free](./quickstart-azure-app-configuration-create.md#create-an-app-configuration-store)
20
20
- Azure DevOps project - [create one for free](https://go.microsoft.com/fwlink/?LinkId=2014881)
21
-
- Azure App Configuration task - download for free from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=AzureAppConfiguration.azure-app-configuration-task#:~:text=Navigate%20to%20the%20Tasks%20tab,the%20Azure%20App%20Configuration%20instance.).
22
-
-[Azure Pipelines agent version 2.206.1](https://github.com/microsoft/azure-pipelines-agent/releases/tag/v2.206.1) or later and [Node version 16](https://nodejs.org/en/blog/release/v16.16.0/) or later for running the task on self-hosted agents.
21
+
-[Azure Pipelines agent version 2.144.0](https://github.com/microsoft/azure-pipelines-agent/releases/tag/v2.144.0) or later and [Node version 16](https://nodejs.org/en/blog/release/v16.16.0/) or later for running the task on self-hosted agents.
23
22
24
23
## Create a service connection
25
24
@@ -43,53 +42,60 @@ Assign the proper App Configuration role assignments to the credentials being us
43
42
44
43
## Use in builds
45
44
46
-
This section will cover how to use the Azure App Configuration task in an Azure DevOps build pipeline.
45
+
This section covers how to use the Azure App Configuration Export task in an Azure DevOps build pipeline.
47
46
48
47
1. Navigate to the build pipeline page by clicking **Pipelines** > **Pipelines**. For build pipeline documentation, see [Create your first pipeline](/azure/devops/pipelines/create-first-pipeline?tabs=net%2Ctfs-2018-2%2Cbrowser).
49
48
- If you're creating a new build pipeline, on the last step of the process, on the **Review** tab, select **Show assistant** on the right side of the pipeline.
50
-

49
+
> [!div class="mx-imgBorder"]
50
+
> 
51
51
- If you're using an existing build pipeline, click the **Edit** button at the top-right.
52
-

53
-
1. Search for the **Azure App Configuration** Task.
54
-

55
-
1. Configure the necessary parameters for the task to pull the key-values from the App Configuration store. Descriptions of the parameters are available in the **Parameters** section below and in tooltips next to each parameter.
52
+
> [!div class="mx-imgBorder"]
53
+
> 
54
+
1. Search for the **Azure App Configuration Export** Task.
55
+
> [!div class="mx-imgBorder"]
56
+
> 
57
+
1. To export the key-values from the App Configuration store, configure the necessary parameters for the task. Descriptions of the parameters are available in the **Parameters** section and in tooltips next to each parameter.
56
58
- Set the **Azure subscription** parameter to the name of the service connection you created in a previous step.
57
59
- Set the **App Configuration Endpoint** to the endpoint of your App Configuration store.
58
60
- Leave the default values for the remaining parameters.
59
-

60
-
1. Save and queue a build. The build log will display any failures that occurred during the execution of the task.
61
+
> [!div class="mx-imgBorder"]
62
+
> 
63
+
1. Save and queue a build. The build log displays any failures that occurred during the execution of the task.
61
64
62
65
## Use in releases
63
66
64
-
This section will cover how to use the Azure App Configuration task in an Azure DevOps release pipeline.
67
+
This section covers how to use the Azure App Configuration Export task in an Azure DevOps release pipeline.
65
68
66
69
1. Navigate to release pipeline page by selecting **Pipelines** > **Releases**. For release pipeline documentation, see [Release pipelines](/azure/devops/pipelines/release).
67
70
1. Choose an existing release pipeline. If you don’t have one, click **New pipeline** to create a new one.
68
71
1. Select the **Edit** button in the top-right corner to edit the release pipeline.
69
-
1. From the **Tasks** dropdown, choose the **Stage** to which you want to add the task. More information about stages can be found [here](/azure/devops/pipelines/release/environments).
70
-

72
+
1. From the **Tasks** dropdown, choose the **Stage** to which you want to add the task. More information about stages can be found in [Add stages, dependencies, & conditions](/azure/devops/pipelines/release/environments).
73
+
> [!div class="mx-imgBorder"]
74
+
> 
71
75
1. Click **+** next to the Job to which you want to add a new task.
72
-

73
-
1. Search for the **Azure App Configuration** Task.
74
-

75
-
1. Configure the necessary parameters within the task to pull your key-values from your App Configuration store. Descriptions of the parameters are available in the **Parameters** section below and in tooltips next to each parameter.
76
+
> [!div class="mx-imgBorder"]
77
+
> 
78
+
1. Search for the **Azure App Configuration Export** Task.
79
+
> [!div class="mx-imgBorder"]
80
+
> 
81
+
1. To export your key-values from your App Configuration store, configure the necessary parameters within the task. Descriptions of the parameters are available in the **Parameters** section and in tooltips next to each parameter.
76
82
- Set the **Azure subscription** parameter to the name of the service connection you created in a previous step.
77
83
- Set the **App Configuration Endpoint** to the endpoint of your App Configuration store.
78
84
- Leave the default values for the remaining parameters.
79
-
1. Save and queue a release. The release log will display any failures encountered during the execution of the task.
85
+
1. Save and queue a release. The release log displays any failures encountered during the execution of the task.
80
86
81
87
## Parameters
82
88
83
-
The following parameters are used by the Azure App Configuration task:
89
+
The following parameters are used by the Azure App Configuration Export task:
84
90
85
91
-**Azure subscription**: A drop-down containing your available Azure service connections. To update and refresh your list of available Azure service connections, press the **Refresh Azure subscription** button to the right of the textbox.
86
92
-**App Configuration Endpoint**: A drop-down that loads your available configuration stores endpoints under the selected subscription. To update and refresh your list of available configuration stores endpoints, press the **Refresh App Configuration Endpoint** button to the right of the textbox.
87
93
-**Selection Mode**: Specifies how the key-values read from a configuration store are selected. The 'Default' selection mode allows the use of key and label filters. The 'Snapshot' selection mode allows key-values to be selected from a snapshot. Default value is **Default**.
88
-
-**Key Filter**: The filter can be used to select what key-values are requested from Azure App Configuration. A value of * will select all key-values. For more information on, see [Query key-values](concept-key-value.md#query-key-values).
89
-
-**Label**: Specifies which label should be used when selecting key-values from the App Configuration store. If no label is provided, then key-values with the no label will be retrieved. The following characters are not allowed: , *.
94
+
-**Key Filter**: The filter can be used to select what key-values are requested from Azure App Configuration. A value of * selects all key-values. For more information on, see [Query key-values](concept-key-value.md#query-key-values).
95
+
-**Label**: Specifies which label should be used when selecting key-values from the App Configuration store. If no label is provided, then key-values with the no label are retrieved. The following characters aren't allowed: , *.
90
96
-**Snapshot Name**: Specifies snapshot from which key-values should be retrieved in Azure App Configuration.
91
-
-**Trim Key Prefix**: Specifies one or more prefixes that should be trimmed from App Configuration keys before setting them as variables. Multiple prefixes can be separated by a new-line character.
92
-
-**Suppress Warning For Overridden Keys**: Default value is unchecked. Specifies whether to show warnings when existing keys are overridden. Enable this option when it is expected that the key-values downloaded from App Configuration have overlapping keys with what exists in pipeline variables.
97
+
-**Trim Key Prefix**: Specifies one or more prefixes that should be trimmed from App Configuration keys before setting them as variables. A new-line character can be used to separate multiple prefixes.
98
+
-**Suppress Warning For Overridden Keys**: Default value is unchecked. Specifies whether to show warnings when existing keys are overridden. Enable this option when it's expected that the key-values downloaded from App Configuration have overlapping keys with what exists in pipeline variables.
93
99
94
100
## Use key-values in subsequent tasks
95
101
@@ -99,10 +105,10 @@ For example, if a subsequent task runs a PowerShell script, it could consume a k
99
105
```powershell
100
106
echo "$env:myBuildSetting"
101
107
```
102
-
And the value will be printed to the console.
108
+
And the value is printed to the console.
103
109
104
110
> [!NOTE]
105
-
> Azure Key Vault references within App Configuration will be resolved and set as [secret variables](/azure/devops/pipelines/process/variables#secret-variables). In Azure pipelines, secret variables are masked out from log. They are not passed into tasks as environment variables and must instead be passed as inputs.
111
+
> Azure Key Vault references within App Configuration will be resolved and set as [secret variables](/azure/devops/pipelines/process/variables#secret-variables). In Azure pipelines, secret variables are masked out from log. They aren't passed into tasks as environment variables and must instead be passed as inputs.
106
112
107
113
## Troubleshooting
108
114
@@ -112,4 +118,22 @@ If an unexpected error occurs, debug logs can be enabled by setting the pipeline
112
118
113
119
**How do I compose my configuration from multiple keys and labels?**
114
120
115
-
There are times when configuration may need to be composed from multiple labels, for example, default and dev. Multiple App Configuration tasks may be used in one pipeline to implement this scenario. The key-values fetched by a task in a later step will supersede any values from previous steps. In the aforementioned example, a task can be used to select key-values with the default label while a second task can select key-values with the dev label. The keys with the dev label will override the same keys with the default label.
121
+
There are times when configuration may need to be composed from multiple labels, for example, default and dev. Multiple App Configuration tasks may be used in one pipeline to implement this scenario. The key-values fetched by a task in a later step supersedes any values from previous steps. In the aforementioned example, a task can be used to select key-values with the default label while a second task can select key-values with the dev label. The keys with the dev label override the same keys with the default label.
122
+
123
+
## Next step
124
+
125
+
For a complete reference of the parameters or to use this pipeline task in YAML pipelines, refer to the following document.
0 commit comments