A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
Hello !
Thank you for posting on MS Learn Q&A.
The issue is that k8sRuntimeFpaObjectId is not a top-level Azure CLI argument. It must be passed as an extension config setting either through --config-file / --config-settings-file or as key=value via --config-settings. The az k8s-extension create command supports config settings files and if you look into the doc below k8sRuntimeFpaObjectId being supplied inside config.json not as --k8sRuntimeFpaObjectId.
https://learn.microsoft.com/en-us/cli/azure/k8s-extension?view=azure-cli-latest
You should do like below :
az extension add --upgrade --name connectedk8s
az extension add --upgrade --name k8s-extension
I recommend that you use the latest Azure CLI with the latest connectedk8s and k8s-extension extensions before creating Arc Kubernetes extensions.
Then get the object ID and place it in a config file:
objID=$(az ad sp list --filter "appId eq '<app_id>'" --query "[].id" -o tsv)
{
"k8sRuntimeFpaObjectId": "<object-id>"
}
And install like this:
az k8s-extension create \
--cluster-name <clusterName> \
--resource-group <rgName> \
--cluster-type connectedClusters \
--extension-type microsoft.arcnetworking \
--name arcnetworking \
--config-file config.json
You can also pass it inline instead of using a file:
az k8s-extension create \
--cluster-name <clusterName> \
--resource-group <rgName> \
--cluster-type connectedClusters \
--extension-type microsoft.arcnetworking \
--name arcnetworking \
--config-settings k8sRuntimeFpaObjectId=<object-id>
The reason your 2nd attempt fails is that --k8sRuntimeFpaObjectId is not a recognized CLI parameter for az k8s-extension createthe command only accepts generic config inputs such as --config-settings and --config-file.