An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
Hello Trevor Blackman,
Thank you for following steps suggested and providing us with the logs. Based on the error
Helm installation failed: YAML parse error on mte-api-relay/templates/deployment.yaml:
error converting YAML to JSON: yaml: line 27: did not find expected key
The issue is not related to managed identity or network connectivity, but rather to how the Helm chart is being rendered with the values provided during extension deployment. Specifically, the value being passed to outboundToken is not being parsed correctly by Helm, which leads to the failure.
Here are the next steps to troubleshoot the error based on the logs provided:
1.Provide the Exact Values Used: exact command you have used to deploy the extension-configuration settings and config-protected-settings values (you can remove any secrets) to verify what value is being passed for outboundToken, since special characters, empty values, or multiline inputs can cause YAML parsing errors.
You need to modify the command to ensure the outboundToken value is a correctly formatted YAML string. The simplest way to do this is to enclose the value in double quotes (").
__Example:__If the previous command was like this:
Bash
az k8s-extension create \
--cluster-type managedClusters \
--cluster-name <cluster-name> \
--resource-group <resource-group> \
--name mteapirelay \
--extension-type "MTEApiRelayExtension" \
--scope cluster \
--configuration-settings '{"outboundToken": some-token-value}'
It should be changed to this: Bash
az k8s-extension create \
--cluster-type managedClusters \
--cluster-name <cluster-name> \
--resource-group <resource-group> \
--name mteapirelay \
--extension-type "MTEApiRelayExtension" \
--scope cluster \
--configuration-settings '{"outboundToken": "some-token-value"}'
By adding the double quotes around the token value, it is correctly parsed as a string, which should prevent the Helm chart from failing.
For more information, refer here: Helm | Template Functions and Pipelines
After correcting the command, the customer should attempt to re-install the AKS extension. The new command should successfully parse the YAML, and the extension should deploy correctly.
For more information, refer here: Cluster extensions for Azure Kubernetes Service (AKS) - Azure Kubernetes Service | Microsoft Learn
2.Test Rendering Locally: With the same values, try rendering the Helm chart locally. If the error reproduces, it confirms the issue is with the provided input rather than the cluster.
helm template my-release ./<chart-path> -f values.yaml
For more information, refer here: Helm | Helm Template
3.Inspect the values applied in the cluster: After attempting deployment, check how the environment variables were rendered in the Deployment manifest. This will whether the value was truncated, malformed, or missing.
kubectl get deployment <extension-deployment> -n <extension-namespace> -o yaml | grep APP_SETTINGS__OUTBOUND_TOKEN -A2
4.Validate Cluster Context: Provide the AKS version __.__Once confirm whether the cluster is public or private. Any Azure Policies or admission controllers (OPA/Gatekeeper) applied that could mutate resource manifests.
__AKS version (az aks show --resource-group <rg> --name <cluster> --query kubernetesVersion)- __check the version using this
For more information, refer here: Built-in policy definitions for Azure Kubernetes Service - Azure Kubernetes Service | Microsoft Learn
The deployment failure is caused by a YAML parsing error in the Helm chart due to the outboundToken value. Kindly follow the above steps to share the details required:
- Share the exact --configuration-settings used.
- Try helm template locally with those values.
- Confirm AKS version, cluster type (public/private), and any applied Azure Policies.
With this info, we can identify whether the issue is input-related (mostly seems like) or environment-specific. Let me know if you require any additional information from my end. I happy to help you with the queries.
Thanks,
Rashmika