Skip to content

Commit 000596a

Browse files
Update for feedback
1 parent 5216712 commit 000596a

File tree

2 files changed

+23
-99
lines changed

2 files changed

+23
-99
lines changed

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

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -245,30 +245,6 @@ Add following key-values to the App Configuration store and leave **Label** and
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-
272248
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.
273249
274250
```yaml
@@ -285,10 +261,10 @@ Add following key-values to the App Configuration store and leave **Label** and
285261
key: mysettings.json
286262
auth:
287263
workloadIdentity:
288-
serviceAccountName: aspnetapp-demo-service-account
264+
serviceAccountName: <your-service-account-name>
289265
```
290266
291-
Replace the value of the `endpoint` field with the endpoint of your Azure App Configuration store.
267+
Replace the value of the `endpoint` field with the endpoint of your Azure App Configuration store. Proceed to the next step to update the `auth` section with your authentication information.
292268
293269
> [!NOTE]
294270
> `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:
@@ -297,6 +273,8 @@ Add following key-values to the App Configuration store and leave **Label** and
297273
> - The ConfigMap will be reset based on the present data in your App Configuration store if it's deleted or modified by any other means.
298274
> - The ConfigMap will be deleted if the App Configuration Kubernetes Provider is uninstalled.
299275
276+
1. In this example, you use workload identity to authenticate with your App Configuration store. Follow these [instructions](./reference-kubernetes-provider.md#use-workload-identity) to set it up, and replace the serviceAccountName field with the name of the service account you created in the *appConfigurationProvider.yaml* file. For more information on other authentication methods, see the [Authentication](./reference-kubernetes-provider.md#authentication) section.
277+
300278
1. Update the *deployment.yaml* file in the *Deployment* directory to use the ConfigMap `configmap-created-by-appconfig-provider` as a mounted data volume. It is important to ensure that the `volumeMounts.mountPath` matches the `WORKDIR` specified in your *Dockerfile* and the *config* directory created before.
301279
302280
```yaml
@@ -330,13 +308,13 @@ Add following key-values to the App Configuration store and leave **Label** and
330308
name: configmap-created-by-appconfig-provider
331309
```
332310
333-
1. Run the following command to deploy the changes. Replace the namespace if you are using your existing AKS application.
311+
4. Run the following command to deploy the changes. Replace the namespace if you are using your existing AKS application.
334312
335313
```console
336314
kubectl apply -f ./Deployment -n appconfig-demo
337315
```
338316
339-
1. Refresh the browser. The page shows updated content.
317+
5. Refresh the browser. The page shows updated content.
340318
341319
![Screenshot showing Kubernetes Provider after using configMap.](./media/quickstarts/kubernetes-provider-app-launch-after.png)
342320
@@ -394,9 +372,9 @@ Ensure that you specify the correct key-value selectors to match the expected da
394372

395373
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.
396374

397-
#### Why the workload identity does not work after I upgrade the Azure App Configuration Kubernetes Provider to v2.0.0?
375+
#### Why am I unable to authenticate with Azure App Configuration using workload identity after upgrading the provider to version 2.0.0?
398376

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.
377+
Starting with version 2.0.0, a user-provided service account is required for authenticating with Azure App Configuration [using workload identity](./reference-kubernetes-provider.md#use-workload-identity). This change enhances security through namespace isolation. Previously, a Kubernetes providers service account was used for all namespaces. For updated instructions, see the documentation on using workload identity. If you need time to migrate when upgrading to version 2.0.0, you can temporarily set `workloadIdentity.globalServiceAccountEnabled=true` during provider installation. Please note that support for using the provider’s service account will be deprecated in a future release.
400378

401379
## Clean up resources
402380

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

Lines changed: 15 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,7 @@ helm install azureappconfiguration.kubernetesprovider \
182182
--set autoscaling.enabled=true
183183
```
184184

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
185+
## Data collection
198186

199187
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.
200188

@@ -271,92 +259,50 @@ The software may collect information about you and your use of the software and
271259

272260
1. [Enable Workload Identity](/azure/aks/workload-identity-deploy-cluster#update-an-existing-aks-cluster) on the Azure Kubernetes Service (AKS) cluster.
273261

274-
2. [Get the OIDC issuer URL](/azure/aks/workload-identity-deploy-cluster#retrieve-the-oidc-issuer-url) of the AKS cluster.
262+
1. [Get the OIDC issuer URL](/azure/aks/workload-identity-deploy-cluster#retrieve-the-oidc-issuer-url) of the AKS cluster.
275263

276-
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.
264+
1. [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.
277265

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.
279-
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.
281-
282-
##### [Use custom service account](#tab/custom)
283-
284-
Create a custom service account in the same namespace as the `AzureAppConfigurationProvider` resource.
266+
1. [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.
267+
268+
1. Create a service account by applying the following sample yaml. Replace `<your-managed-identity-client-id>` with the client ID and `<your-tenant-id>` with the tenant ID of the user-assigned managed identity just been created. Replace `<your-service-account-name>` with your favorite name.
285269

286-
``` bash
287-
cat <<EOF | kubectl create -f -
270+
``` yaml
288271
apiVersion: v1
289272
kind: ServiceAccount
290273
metadata:
291-
name: my-service-account
274+
name: <your-service-account-name>
275+
namespace: default
292276
annotations:
293-
azure.workload.identity/client-id: <managed-identity-client-id>
294-
azure.workload.identity/tenant-id: <tenant-id>
295-
EOF
277+
azure.workload.identity/client-id: <your-managed-identity-client-id>
278+
azure.workload.identity/tenant-id: <your-tenant-id>
296279
```
297280

298-
Create the federated identity credential to bind the managed identity to the custom service account.
281+
1. Create federated identity credential for the user-assigned managed identity using the Azure CLI.
299282

300283
``` azurecli
301284
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
302285
```
303286

304287
The subject of the federated identity credential should be in the format `system:serviceaccount:<service-account-namespace>:<service-account-name>`.
305288

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-
> ```
317-
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
320-
```
321-
322-
---
323-
324-
6. Apply the following sample `AzureAppConfigurationProvider` resource to the Kubernetes cluster.
325-
326-
##### [Use custom service account](#tab/custom)
327-
328-
``` yaml
329-
apiVersion: azconfig.io/v1
330-
kind: AzureAppConfigurationProvider
331-
metadata:
332-
name: appconfigurationprovider-sample
333-
spec:
334-
endpoint: <your-app-configuration-store-endpoint>
335-
target:
336-
configMapName: configmap-created-by-appconfig-provider
337-
auth:
338-
workloadIdentity:
339-
serviceAccountName: my-service-account
340-
```
341-
342-
##### [Use service account of provider](#tab/global)
289+
1. Apply the following sample `AzureAppConfigurationProvider` resource to the Kubernetes cluster. Be sure it's in the same namespace as the service account. Replace `<your-app-configuration-store-endpoint>` with the endpoint of the Azure App Configuration store. Replace `<your-service-account-name>` with the name of the service account just been created.
343290

344291
``` yaml
345292
apiVersion: azconfig.io/v1
346293
kind: AzureAppConfigurationProvider
347294
metadata:
348295
name: appconfigurationprovider-sample
296+
namespace: default
349297
spec:
350298
endpoint: <your-app-configuration-store-endpoint>
351299
target:
352300
configMapName: configmap-created-by-appconfig-provider
353301
auth:
354302
workloadIdentity:
355-
managedIdentityClientId: <your-managed-identity-client-id>
303+
serviceAccountName: <your-service-account-name>
356304
```
357305

358-
---
359-
360306
#### Use connection string
361307

362308
1. Create a Kubernetes Secret in the same namespace as the `AzureAppConfigurationProvider` resource and add Azure App Configuration connection string with key *azure_app_configuration_connection_string* in the Secret.

0 commit comments

Comments
 (0)