01 Run account list command (Windows/macOS/Linux) with custom output filters to list the IDs of the cloud subscriptions available in your Azure cloud account:
az account list
--query '[*].id'
02 The command output should return the requested subscription identifiers (IDs):
[
"abcdabcd-1234-abcd-1234-abcdabcdabcd",
"abcd1234-abcd-1234-abcd-abcd1234abcd"
]
03 Run account set command (Windows/macOS/Linux) with the ID of the Azure cloud subscription that you want to examine as the identifier parameter to set the selected subscription to be the current active subscription (the command does not produce an output):
az account set
--subscription abcdabcd-1234-abcd-1234-abcdabcdabcd
04 Run extension add command (OSX/Linux/UNIX) to install the aks-preview Azure CLI extension. This extension provides a preview for new and upcoming Azure Kubernetes Service (AKS) features (the command does not produce an output):
az extension add --name aks-preview
05 Run feature register command (OSX/Linux/UNIX) to register the EnableImageIntegrityPreview feature flag for the selected Azure subscription:
az feature register
--namespace "Microsoft.ContainerService"
--name "EnableImageIntegrityPreview"
06 The command output should return the registration information available for the EnableImageIntegrityPreview feature:
{
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/providers/Microsoft.Features/providers/Microsoft.ContainerService/features/EnableImageIntegrityPreview",
"name": "Microsoft.ContainerService/EnableImageIntegrityPreview",
"properties": {
"state": "Registering"
},
"type": "Microsoft.Features/providers/features"
}
07 Run feature register command (OSX/Linux/UNIX) to register the AKS-AzurePolicyExternalData feature flag for the selected Azure subscription:
az feature register
--namespace "Microsoft.ContainerService"
--name "AKS-AzurePolicyExternalData"
08 The command output should return the registration information available for the AKS-AzurePolicyExternalData feature:
{
"id": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/providers/Microsoft.Features/providers/Microsoft.ContainerService/features/AKS-AzurePolicyExternalData",
"name": "Microsoft.ContainerService/AKS-AzurePolicyExternalData",
"properties": {
"state": "Registering"
},
"type": "Microsoft.Features/providers/features"
}
09 Run provider register command (OSX/Linux/UNIX) to refresh the registration of the Microsoft.ContainerService resource provider for the selected subscription:
az provider register --namespace Microsoft.ContainerService
10 Run aks addon enable command (OSX/Linux/UNIX) to install the Azure Policy add-on for Azure Kubernetes Service (AKS). This add-on is required for enabling the Image Integrity feature on your AKS clusters:
az aks addon enable
--addon azure-policy
--name cc-data-mining-cluster
--resource-group cloud-shell-storage-westeurope
11 The command output should return the configuration information available for the modified AKS cluster:
{
"aadProfile": {
"adminGroupObjectIDs": null,
"adminUsers": null,
"clientAppId": null,
"enableAzureRbac": true,
"managed": true,
"serverAppId": null,
"serverAppSecret": null,
"tenantId": "abcdabcd-1234-abcd-1234-abcdabcdabcd"
},
"addonProfiles": {
"azureKeyvaultSecretsProvider": {
"config": null,
"enabled": false,
"identity": null
},
"azurepolicy": {
"config": null,
"enabled": true,
"identity": {
"objectId": "abcdabcd-1234-abcd-1234-abcdabcdabcd",
"resourceId": "/subscriptions/abcdabcd-1234-abcd-1234-abcdabcdabcd/resourcegroups/MC_cloud-shell-storage-westeurope_cc-data-mining-cluster_westeurope/providers/Microsoft.ManagedIdentity/userAssignedIdentities/azurepolicy-cc-data-mining-cluster"
}
}
},
...
"storageProfile": {
"blobCsiDriver": null,
"diskCsiDriver": {
"enabled": true,
"version": "v1"
},
"fileCsiDriver": {
"enabled": true
},
"snapshotController": {
"enabled": true
}
},
"supportPlan": "KubernetesOfficial",
"systemData": null,
"tags": null,
"type": "Microsoft.ContainerService/ManagedClusters",
"upgradeSettings": null,
"windowsProfile": {
"adminPassword": null,
"adminUsername": "azureuser",
"enableCsiProxy": true,
"gmsaProfile": null,
"licenseType": null
},
"workloadAutoScalerProfile": {
"keda": null,
"verticalPodAutoscaler": null
}
}
12 Run aks update command (OSX/Linux/UNIX) to enable the OIDC issuer for the selected AKS cluster. Enabling the OIDC issuer on an existing aks cluster changes the current service account token issuer to a new value, which can cause downtime as it restarts the Kubernetes API server. Skip this step if you have the OIDC issuer already installed on your AKS cluster:
az aks update
--name cc-data-mining-cluster
--resource-group cloud-shell-storage-westeurope
--enable-oidc-issuer
13 The command output should return the configuration information available for the modified cluster:
{
"aadProfile": {
"adminGroupObjectIDs": null,
"adminUsers": null,
"clientAppId": null,
"enableAzureRbac": true,
"managed": true,
"serverAppId": null,
"serverAppSecret": null,
"tenantId": "abcdabcd-1234-abcd-1234-abcdabcdabcd"
},
...
"supportPlan": "KubernetesOfficial",
"systemData": null,
"type": "Microsoft.ContainerService/ManagedClusters",
"upgradeSettings": null,
"windowsProfile": {
"adminPassword": null,
"adminUsername": "azureuser",
"enableCsiProxy": true,
"gmsaProfile": null,
"licenseType": null
}
}
14 Run aks update command (OSX/Linux/UNIX) to enable the Image Integrity feature for the selected Azure Kubernetes Service (AKS) cluster:
az aks update
--name cc-data-mining-cluster
--resource-group cloud-shell-storage-westeurope
--enable-image-integrity
15 The command output should return the configuration information available for the modified AKS cluster:
{
"aadProfile": {
"adminGroupObjectIDs": [
"abcdabcd-1234-abcd-1234-abcdabcdabcd"
],
"clientAppId": null,
"enableAzureRbac": true,
"managed": true,
"serverAppId": null,
"serverAppSecret": null,
"tenantId": "abcdabcd-1234-abcd-1234-abcdabcdabcd"
},
...
"supportPlan": "KubernetesOfficial",
"systemData": null,
"tags": null,
"type": "Microsoft.ContainerService/ManagedClusters",
"upgradeSettings": null,
"windowsProfile": null,
"workloadAutoScalerProfile": {
"keda": null,
"verticalPodAutoscaler": null
}
}
16 Repeat steps no. 10 - 15 for each AKS cluster that you want to configure, available within the selected Azure subscription.
17 Repeat steps no. 3 – 16 for each subscription created in your Microsoft Azure cloud account.