{"id":15771738,"url":"https://github.com/trstringer/aks-deploy-from-github-actions","last_synced_at":"2025-07-06T11:35:00.227Z","repository":{"id":45816691,"uuid":"408224378","full_name":"trstringer/aks-deploy-from-github-actions","owner":"trstringer","description":"Example showing how to deploy to AKS (Azure Kubernetes Service) from GitHub Actions","archived":false,"fork":false,"pushed_at":"2021-09-19T22:21:26.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T17:13:32.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trstringer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-19T20:00:15.000Z","updated_at":"2023-06-15T18:24:05.000Z","dependencies_parsed_at":"2022-09-06T08:51:26.914Z","dependency_job_id":null,"html_url":"https://github.com/trstringer/aks-deploy-from-github-actions","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Faks-deploy-from-github-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Faks-deploy-from-github-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Faks-deploy-from-github-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Faks-deploy-from-github-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trstringer","download_url":"https://codeload.github.com/trstringer/aks-deploy-from-github-actions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252922337,"owners_count":21825639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T15:04:50.082Z","updated_at":"2025-05-07T17:13:35.791Z","avatar_url":"https://github.com/trstringer.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy to AKS from GitHub Actions\n\n## Setup\n\nCreate the AKS cluster:\n\n```\n$ az group create \\\n    --location $LOCATION \\\n    --name $RG\n\n$ az aks create \\\n    --resource-group $RG \\\n    --name $CLUSTER\n```\n\nCreate the container registry (ACR):\n\n```\n$ az acr create \\\n    --resource-group $RG \\\n    --name $ACR \\\n    --sku basic\n```\n\nAttach the container registry to the AKS cluster:\n\n```\n$ az aks update \\\n    --resource-group $RG \\\n    --name $CLUSTER \\\n    --attach-acr $ACR\n```\n\nCreate a service principal which will be used to deploy the application to the AKS cluster:\n\n```\n$ az ad sp create-for-rbac \\\n    --name upgrade-test \\\n    --skip-assignment\n```\n\nTake the `appId` output and create a GitHub repository secret named `SERVICE_PRINCIPAL_APP_ID` with the value from `appId`.\n\nTake the `password` output and create a GitHub repository secret named `SERVICE_PRINCIPAL_SECRET` with the value from `password`.\n\nTake the `tenant` output and create a GitHub repository secret named `SERVICE_PRINCIPAL_TENANT` with the value from `tenant`.\n\nGrant this service principal the ability to push to the container registry:\n\n```\n$ az role assignment create \\\n    --role AcrPush \\\n    --assignee-principal-type ServicePrincipal \\\n    --assignee-object-id $(az ad sp show \\\n        --id $SERVICE_PRINCIPAL_APP_ID \\\n        --query objectId -o tsv) \\\n    --scope $(az acr show --name $ACR --query id -o tsv)\n```\n\nGrant this service principal the ability to get credentials:\n\n```\n$ az role assignment create \\\n    --role \"Azure Kubernetes Service Cluster User Role\" \\\n    --assignee-principal-type ServicePrincipal \\\n    --assignee-object-id $(az ad sp show \\\n        --id $SERVICE_PRINCIPAL_APP_ID \\\n        --query objectId -o tsv) \\\n    --scope $(az aks show \\\n        --resource-group $RG \\\n        --name $CLUSTER \\\n        --query id -o tsv)\n```\n\nGrant this service principal the ability to read and write in the default namespace:\n\n```\n$ az role assignment create \\\n    --role \"Azure Kubernetes Service RBAC Writer\" \\\n    --assignee-principal-type ServicePrincipal \\\n    --assignee-object-id $(az ad sp show \\\n        --id $SERVICE_PRINCIPAL_APP_ID \\\n        --query objectId -o tsv) \\\n    --scope \"$(az aks show \\\n        --resource-group $RG \\\n        --name $CLUSTER \\\n        --query id -o tsv)/namespaces/default\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Faks-deploy-from-github-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrstringer%2Faks-deploy-from-github-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Faks-deploy-from-github-actions/lists"}