Skip to content

Commit 5216712

Browse files
Update for feedback
1 parent a169833 commit 5216712

File tree

2 files changed

+90
-19
lines changed

2 files changed

+90
-19
lines changed

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

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,34 @@ Add following key-values to the App Configuration store and leave **Label** and
241241
--namespace azappconfig-system \
242242
--create-namespace
243243
```
244-
244+
245245
> [!TIP]
246246
> The App Configuration Kubernetes Provider is also available as an AKS extension. This integration allows for seamless installation and management via the Azure CLI, ARM templates, or Bicep templates. Utilizing the AKS extension facilitates automatic minor/patch version updates, ensuring your system is always up-to-date. For detailed installation instructions, please refer to the [Azure App Configuration extension for Azure Kubernetes Service](/azure/aks/azure-app-configuration).
247247
248+
1. Follow the step 1-4 in [using workload identity](./reference-kubernetes-provider.md#use-workload-identity) and note down the client ID, tenant ID, resource group and name of the managed identity, the OIDC issuer URL of the AKS cluster, you will use them in the following steps.
249+
250+
1. Add a *serviceaccount.yaml* file to the *Deployment* directory with the following content to create a service account for the application.
251+
252+
```yaml
253+
apiVersion: v1
254+
kind: ServiceAccount
255+
metadata:
256+
name: aspnetapp-demo-service-account
257+
annotations:
258+
azure.workload.identity/client-id: <your-managed-identity-client-id>
259+
azure.workload.identity/tenant-id: <your-tenant-id>
260+
```
261+
262+
Replace the value of the `azure.workload.identity/client-id` and `azure.workload.identity/tenant-id` fields with the client ID and tenant ID of the managed identity you created in the previous step.
263+
264+
1. Create federated credentials for the service account by running the following command:
265+
266+
```azurecli
267+
az identity federated-credential create --name "federated-credential-demo" --identity-name <identity-name> --resource-group <resource-group> --issuer <OIDC-issuer> --subject system:serviceaccount:default:aspnetapp-demo-service-account --audience api://AzureADTokenExchange
268+
```
269+
270+
Replace the value of the `identity-name`, `resource-group` fields with the name, resource group of your managed identity created in the previous step. Replace the value of the `OIDC-issuer` field with the OIDC issuer URL of your AKS cluster.
271+
248272
1. Add an *appConfigurationProvider.yaml* file to the *Deployment* directory with the following content to create an `AzureAppConfigurationProvider` resource. `AzureAppConfigurationProvider` is a custom resource that defines what data to download from an Azure App Configuration store and creates a ConfigMap.
249273
250274
```yaml
@@ -261,10 +285,10 @@ Add following key-values to the App Configuration store and leave **Label** and
261285
key: mysettings.json
262286
auth:
263287
workloadIdentity:
264-
managedIdentityClientId: <your-managed-identity-client-id>
288+
serviceAccountName: aspnetapp-demo-service-account
265289
```
266290
267-
Replace the value of the `endpoint` field with the endpoint of your Azure App Configuration store. Follow the steps in [use workload identity](./reference-kubernetes-provider.md#use-workload-identity) and update the `auth` section with the client ID of the user-assigned managed identity you created.
291+
Replace the value of the `endpoint` field with the endpoint of your Azure App Configuration store.
268292
269293
> [!NOTE]
270294
> `AzureAppConfigurationProvider` is a declarative API object. It defines the desired state of the ConfigMap created from the data in your App Configuration store with the following behavior:
@@ -370,6 +394,10 @@ Ensure that you specify the correct key-value selectors to match the expected da
370394

371395
You can customize the installation by providing additional Helm values when installing the Azure App Configuration Kubernetes Provider. For example, you can set the log level, configure the provider to run on a specific node, or disable the workload identity. Refer to the [installation guide](./reference-kubernetes-provider.md#installation) for more information.
372396

397+
#### Why the workload identity does not work after I upgrade the Azure App Configuration Kubernetes Provider to v2.0.0?
398+
399+
Start from v2.0.0, per namespace service account should be used for workload identity by default. See the [workload identity](./reference-kubernetes-provider.md#use-workload-identity) documentation for more details. If you still want to use the provider's service account, binding your managed identities to the global service account `az-appconfig-k8s-provider` that been created in `azappconfig-system` namespace, you can enable it by setting `workloadIdentity.globalServiceAccountEnabled=true` at installation time, refer to the [installation guide](./reference-kubernetes-provider.md#installation) for more information.
400+
373401
## Clean up resources
374402

375403
Uninstall the App Configuration Kubernetes Provider from your AKS cluster if you want to keep the AKS cluster.

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

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: junbchen
1212

1313
# Azure App Configuration Kubernetes Provider reference
1414

15-
The following reference outlines the properties supported by the Azure App Configuration Kubernetes Provider `v1.3.0`. See [release notes](https://github.com/Azure/AppConfiguration/blob/main/releaseNotes/KubernetesProvider.md) for more information on the change.
15+
The following reference outlines the properties supported by the Azure App Configuration Kubernetes Provider `v2.0.0`. See [release notes](https://github.com/Azure/AppConfiguration/blob/main/releaseNotes/KubernetesProvider.md) for more information on the change.
1616

1717
## Properties
1818

@@ -162,7 +162,7 @@ The `spec.featureFlag.refresh` property has the following child properties.
162162
## Installation
163163

164164
Use the following `helm install` command to install the Azure App Configuration Kubernetes Provider. See [helm-values.yaml](https://github.com/Azure/AppConfiguration-KubernetesProvider/blob/main/deploy/parameter/helm-values.yaml) for the complete list of parameters and their default values. You can override the default values by passing the `--set` flag to the command.
165-
165+
166166
```bash
167167
helm install azureappconfiguration.kubernetesprovider \
168168
oci://mcr.microsoft.com/azure-app-configuration/helmchart/kubernetes-provider \
@@ -174,6 +174,30 @@ helm install azureappconfiguration.kubernetesprovider \
174174

175175
By default, autoscaling is disabled. However, if you have multiple `AzureAppConfigurationProvider` resources to produce multiple ConfigMaps/Secrets, you can enable horizontal pod autoscaling by setting `autoscaling.enabled` to `true`.
176176

177+
```bash
178+
helm install azureappconfiguration.kubernetesprovider \
179+
oci://mcr.microsoft.com/azure-app-configuration/helmchart/kubernetes-provider \
180+
--namespace azappconfig-system \
181+
--create-namespace
182+
--set autoscaling.enabled=true
183+
```
184+
185+
### Global service account
186+
187+
By default, the provider uses custom per namespace service account to access Azure App Configuration and Key Vaults. If you still want to use the provider's service account, binding your managed identities to the global service account `az-appconfig-k8s-provider` that been created in `azappconfig-system` namespace, you can enable it by setting `workloadIdentity.globalServiceAccountEnabled=true` at installation time.
188+
189+
```bash
190+
helm install azureappconfiguration.kubernetesprovider \
191+
oci://mcr.microsoft.com/azure-app-configuration/helmchart/kubernetes-provider \
192+
--namespace azappconfig-system \
193+
--create-namespace
194+
--set workloadIdentity.globalServiceAccountEnabled=true
195+
```
196+
197+
### Data collection
198+
199+
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry by setting the `requestTracing.enabled=false` while installing the Azure App Configuration Kubernetes Provider. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
200+
177201
## Examples
178202

179203
### Authentication
@@ -251,36 +275,55 @@ By default, autoscaling is disabled. However, if you have multiple `AzureAppConf
251275

252276
3. [Create a user-assigned managed identity](/azure/active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities#create-a-user-assigned-managed-identity) and note down its client ID after creation.
253277

254-
4. [Grant the user-assigned managed identity **App Configuration Data Reader** role](/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vmss#user-assigned-managed-identity) in Azure App Configuration.
278+
4. [Grant the user-assigned managed identity **App Configuration Data Reader** role](/azure/azure-app-configuration/concept-enable-rbac#assign-azure-roles-for-access-rights) in Azure App Configuration.
255279

256-
5. Create the federated identity credential between the managed identity, OIDC issuer, and subject using the Azure CLI. You can choose to bind the managed identity to the provider global service account or a custom service account.
257-
258-
##### [Use service account of provider](#tab/global)
259-
260-
``` azurecli
261-
az identity federated-credential create --name "${FEDERATED_IDENTITY_CREDENTIAL_NAME}" --identity-name "${USER_ASSIGNED_IDENTITY_NAME}" --resource-group "${RESOURCE_GROUP}" --issuer "${AKS_OIDC_ISSUER}" --subject system:serviceaccount:azappconfig-system:az-appconfig-k8s-provider --audience api://AzureADTokenExchange
262-
```
280+
5. Create federated identity credential between the managed identity, OIDC issuer, and subject using the Azure CLI. You can choose to bind the managed identity to the provider global service account or a custom service account.
263281

264282
##### [Use custom service account](#tab/custom)
265283

266284
Create a custom service account in the same namespace as the `AzureAppConfigurationProvider` resource.
267285

268-
``` console
269-
kubectl create serviceaccount my-service-account -n default
286+
``` bash
287+
cat <<EOF | kubectl create -f -
288+
apiVersion: v1
289+
kind: ServiceAccount
290+
metadata:
291+
name: my-service-account
292+
annotations:
293+
azure.workload.identity/client-id: <managed-identity-client-id>
294+
azure.workload.identity/tenant-id: <tenant-id>
295+
EOF
270296
```
271297

272298
Create the federated identity credential to bind the managed identity to the custom service account.
273299

274300
``` azurecli
275301
az identity federated-credential create --name "${FEDERATED_IDENTITY_CREDENTIAL_NAME}" --identity-name "${USER_ASSIGNED_IDENTITY_NAME}" --resource-group "${RESOURCE_GROUP}" --issuer "${AKS_OIDC_ISSUER}" --subject system:serviceaccount:default:my-service-account --audience api://AzureADTokenExchange
302+
```
303+
304+
The subject of the federated identity credential should be in the format `system:serviceaccount:<service-account-namespace>:<service-account-name>`.
305+
306+
##### [Use service account of provider](#tab/global)
307+
308+
> [!NOTE]
309+
> To use the service account of the provider, please ensure the `workloadIdentity.enableGlobalServiceAccount` property is set to `true` while installing the Azure App Configuration Kubernetes Provider.
310+
> ```bash
311+
> helm install azureappconfiguration.kubernetesprovider \
312+
> oci://mcr.microsoft.com/azure-app-configuration/helmchart/kubernetes-provider \
313+
> --namespace azappconfig-system \
314+
> --create-namespace \
315+
> --set workloadIdentity.enableGlobalServiceAccount=true
316+
> ```
276317

318+
``` azurecli
319+
az identity federated-credential create --name "${FEDERATED_IDENTITY_CREDENTIAL_NAME}" --identity-name "${USER_ASSIGNED_IDENTITY_NAME}" --resource-group "${RESOURCE_GROUP}" --issuer "${AKS_OIDC_ISSUER}" --subject system:serviceaccount:azappconfig-system:az-appconfig-k8s-provider --audience api://AzureADTokenExchange
277320
```
278321

279322
---
280323

281324
6. Apply the following sample `AzureAppConfigurationProvider` resource to the Kubernetes cluster.
282325

283-
##### [Use service account of provider](#tab/global)
326+
##### [Use custom service account](#tab/custom)
284327

285328
``` yaml
286329
apiVersion: azconfig.io/v1
@@ -293,10 +336,10 @@ By default, autoscaling is disabled. However, if you have multiple `AzureAppConf
293336
configMapName: configmap-created-by-appconfig-provider
294337
auth:
295338
workloadIdentity:
296-
managedIdentityClientId: <your-managed-identity-client-id>
339+
serviceAccountName: my-service-account
297340
```
298341

299-
##### [Use custom service account](#tab/custom)
342+
##### [Use service account of provider](#tab/global)
300343

301344
``` yaml
302345
apiVersion: azconfig.io/v1
@@ -309,7 +352,7 @@ By default, autoscaling is disabled. However, if you have multiple `AzureAppConf
309352
configMapName: configmap-created-by-appconfig-provider
310353
auth:
311354
workloadIdentity:
312-
serviceAccountName: my-service-account
355+
managedIdentityClientId: <your-managed-identity-client-id>
313356
```
314357

315358
---

0 commit comments

Comments
 (0)