az aks draft
Note
This reference is part of the aks-preview extension for the Azure CLI (version 2.61.0 or higher). The extension will automatically install the first time you run an az aks draft command. Learn more about extensions.
Commands to build deployment files in a project directory and deploy to an AKS cluster.
Commands
Name | Description | Type | Status |
---|---|---|---|
az aks draft create |
Generate a Dockerfile and the minimum required Kubernetes deployment files (helm, kustomize, manifests) for your project directory. |
Extension | GA |
az aks draft generate-workflow |
Generate a GitHub workflow for automatic build and deploy to AKS. |
Extension | GA |
az aks draft setup-gh |
Set up GitHub OIDC for your application. |
Extension | GA |
az aks draft up |
Run |
Extension | GA |
az aks draft update |
Update your application to be internet accessible. |
Extension | GA |
az aks draft create
Generate a Dockerfile and the minimum required Kubernetes deployment files (helm, kustomize, manifests) for your project directory.
az aks draft create [--app]
[--create-config]
[--deployment-only]
[--destination]
[--dockerfile-only]
[--language]
[--path]
Examples
Prompt to generate a Dockerfile and deployment files in the current directory.
az aks draft create
Generate only the Dockerfile in the current directory.
az aks draft create --dockerfile-only=true
Generate only the deployment files in the current directory.
az aks draft create --deployment-only=true
Generate a Dockerfile and an deployment file in a Java project with an app name at a specific project directory.
az aks draft create --language=java --app=some_app --destination=/projects/some_project
Optional Parameters
Specify the name of the helm release.
Specify the path to the configuration file.
Only generate deployment files (helm, kustomize, manifests) for the Kubernetes deployment.
Specify the path to the project directory (default is .).
Only generate Dockerfile for the Kubernetes deployment.
Specify the language used to create the Kubernetes deployment.
Automatically download and use the Draft binary at the specified location.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az aks draft generate-workflow
Generate a GitHub workflow for automatic build and deploy to AKS.
Before running this command, Make sure you have set up GitHub OIDC for your application. You also need to create a resource group, a container registry and a Kubernetes cluster on Azure and link the three resources using az aks update -n <cluster-name> -g <resource-group-name> --attach-acr <acr-name>
.
az aks draft generate-workflow [--branch]
[--cluster-name]
[--container-name]
[--destination]
[--path]
[--registry-name]
[--resource-group]
Examples
Prompt to generate a GitHub workflow in the current directory.
az aks draft generate-workflow
Prompt to generate a GitHub workflow in a specific project directory.
az aks draft generate-workflow --destination=/projects/some_project
Generate a GitHub workflow with a resource group, an AKS cluster name, a container registry name in a specific project directory.
az aks draft generate-workflow --resource-group=some_rg --cluster-name=some_cluster --registry-name=some_registry --destination=/projects/some_project
Generate a GitHub workflow that deploys from the main branch with a resource group, an AKS cluster name, a container registry name, and a container image name in a specific project directory.
az aks draft generate-workflow --branch=main --resource-group=some_rg --cluster-name=some_cluster --registry-name=some_registry --container-name=some_image --destination=/projects/some_project
Optional Parameters
Specify the GitHub branch to automatically deploy from.
Specify the AKS cluster name.
Specify the name of the container image.
Specify the path to the project directory (default is .).
Automatically download and use the Draft binary at the specified location.
Specify the path to the project directory.
Specify the name of the Azure resource group.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az aks draft setup-gh
Set up GitHub OIDC for your application.
az aks draft setup-gh [--app]
[--gh-repo]
[--path]
[--provider]
[--resource-group]
[--subscription-id]
Examples
Prompt to setup the GitHub OIDC for a repository.
az aks draft setup-gh
Setup the GitHub OIDC on Azure for a specific repository.
az aks draft setup-gh --provider=azure --gh-repo=some_organization/some_repo
Setup the GitHub OIDC on Azure with subscription ID and resource group.
az aks draft setup-gh --provider=azure --subscription-id=some_subscription --resource-group=some_rg
Setup the GitHub OIDC with an application name on Azure with subscription ID and resource group for a specific repository.
az aks draft setup-gh --app=some_app --provider=azure --subscription-id=some_subscription --resource-group=some_rg --gh-repo=some_organization/some_repo
Optional Parameters
Specify the Azure Active Directory applicaton name.
Specify the the GitHub repository (organization/repo_name).
Automatically download and use the Draft binary at the specified location.
Specify the cloud provider (default is azure).
Specify the name of the Azure resource group.
Specify the Azure subscription ID.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az aks draft up
Run az aks draft setup-gh
then az aks draft generate-workflow
.
This command combines az aks draft setup-gh
and az aks draft generate-workflow
to set up GitHub OIDC and generate a GitHub workflow for automatic build and deploy to AKS. Before running this command, create a resource group, a container registry and a Kubernetes cluster on Azure and link the three resources using az aks update -n <cluster-name> -g <resource-group-name> --attach-acr <acr-name>
.
az aks draft up [--app]
[--branch]
[--cluster-name]
[--container-name]
[--destination]
[--gh-repo]
[--path]
[--provider]
[--registry-name]
[--resource-group]
[--subscription-id]
Examples
Prompt to setup the GitHub OIDC then generate a GitHub workflow in the current directory.
az aks draft up
Prompt to setup the GitHub OIDC then generate a GitHub workflow in a specific project directory.
az aks draft up --destination=/projects/some_project
Prompt to setup the GitHub OIDC for a specific repository then generate a GitHub workflow in a specific project directory.
az aks draft up --gh-repo=some_organization/some_repo --destination=/projects/some_project
Optional Parameters
Specify the name of the application.
Specify the GitHub branch to automatically deploy from.
Specify the AKS cluster name.
Specify the name of the container image.
Specify the path to the project directory (default is .).
Specify the the GitHub repository (organization/repo_name).
Automatically download and use the Draft binary at the specified location.
Specify the cloud provider (default is azure).
Specify the path to the project directory.
Specify the name of the Azure resource group.
Specify the Azure subscription ID.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az aks draft update
Update your application to be internet accessible.
This command automatically updates your yaml files as necessary so that your application will be able to receive external requests.
az aks draft update [--certificate]
[--destination]
[--host]
[--path]
Examples
Prompt to update the application to be internet accessible.
az aks draft update
Prompt to update the application to be internet accessible in a specific project directory.
az aks draft update --destination=/projects/some_project
Update the application to be internet accessible with a host of the ingress resource and a Keyvault certificate in a specific project directory.
az aks draft update --host=some_host --certificate=some_certificate --destination=/projects/some_project
Optional Parameters
Specify the URI of the Keyvault certificate to present.
Specify the path to the project directory (default is .).
Specify the host of the ingress resource.
Automatically download and use the Draft binary at the specified location.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI