Run Command on Cluster
A 2-step recipe with Azure Kubernetes Service. We can help you get access.
Recipe · 2 steps
Run Command on Cluster
with Azure Kubernetes Service · IT Infrastructure Management
Verify a cluster is ready, then run a command against it through the AKS command runner.
- Read the cluster and confirm provisioningState is Succeeded before attempting to run a command against it.
- Submit the command to the AKS command runner. The command field is required; a 200 indicates the command completed synchronously and the result carries exitCode and logs.
What you'll need to have ready
- subscriptionId: The ID of the target subscription (valid UUID).
- resourceGroupName: The name of the resource group.
- resourceName: The name of the managed cluster.
- command: The shell/kubectl command to run (e.g. "kubectl get pods -A").
- context: A base64 encoded zip of files required by the command.
- apiVersion: The AKS REST API version to use.
- accessToken: An Azure AD bearer token with user_impersonation scope.
For your developer
Arazzo workflow microsoft-azure-kubernetes-service:run-command-on-cluster, 2 operations: ManagedClusters_Get → ManagedClusters_RunCommand. Specs on APIs.io.