{"id":15290895,"url":"https://github.com/azure/aks-set-context","last_synced_at":"2025-10-23T02:34:49.649Z","repository":{"id":37792872,"uuid":"206243972","full_name":"Azure/aks-set-context","owner":"Azure","description":"GitHub Action for setting context (retrieving Kubeconfig) before interacting with Kubernetes cluster","archived":false,"fork":false,"pushed_at":"2025-04-08T00:03:05.000Z","size":29324,"stargazers_count":53,"open_issues_count":5,"forks_count":41,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-13T05:06:39.848Z","etag":null,"topics":["actions","azure","deploy","github-action","github-actions","k8s","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-04T06:06:41.000Z","updated_at":"2025-04-01T19:06:11.000Z","dependencies_parsed_at":"2024-03-08T20:15:17.723Z","dependency_job_id":"568a232c-4f7d-4273-a5b4-c52980ac1738","html_url":"https://github.com/Azure/aks-set-context","commit_stats":{"total_commits":92,"total_committers":26,"mean_commits":"3.5384615384615383","dds":0.782608695652174,"last_synced_commit":"75fcab2748dfae95c7ad109664259342471bfc11"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Faks-set-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Faks-set-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Faks-set-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Faks-set-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/aks-set-context/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665748,"owners_count":21142123,"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":["actions","azure","deploy","github-action","github-actions","k8s","kubernetes"],"created_at":"2024-09-30T16:09:58.989Z","updated_at":"2025-10-23T02:34:49.638Z","avatar_url":"https://github.com/Azure.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Kubernetes Service set context\n\nThis action can be used to set cluster context before other actions like [`azure/k8s-deploy`](https://github.com/Azure/k8s-deploy/tree/master) and [`azure/k8s-create-secret`](https://github.com/Azure/k8s-create-secret/tree/master). Any kubectl commands (in script) can also be run subsequently in the workflow.\n\nYou must run [Azure/login](https://github.com/Azure/login) before this action.\n\n## Action inputs\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eAction inputs\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003eresource-group\u003c/code\u003e\u003cbr/\u003e(Required)\u003c/td\u003e\n    \u003ctd\u003eResource group containing the AKS cluster\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003ecluster-name\u003c/code\u003e\u003cbr/\u003e(Required)\u003c/td\u003e\n    \u003ctd\u003eName of the AKS cluster\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003esubscription\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eSubscription tied to AKS cluster\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003eadmin\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eGet cluster admin credentials. Values: true or false\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003euse-kubelogin\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eAllows non-admin users to use the Action via kubelogin\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003epublic-fqdn\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eGet private cluster credential with server address to be public fqdn\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003eresource-type\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eMicrosoft.ContainerService/managedClusters (default) or Microsoft.ContainerService/fleets\u003c/td\u003e\n  \u003c/tr\u003e\n\n\u003c/table\u003e\n\n## Example\n\n### OIDC Authentication (recommended)\n\n```yaml\n- uses: azure/login@v2\n  with:\n     client-id: ${{ secrets.AZURE_CLIENT_ID }}\n     tenant-id: ${{ secrets.AZURE_TENANT_ID }}\n     subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}\n\n- uses: azure/aks-set-context@v4\n  with:\n     resource-group: '\u003cresource group name\u003e'\n     cluster-name: '\u003ccluster name\u003e'\n```\n\n### Service Principal Authentication\n\n```yaml\n- uses: azure/login@v2\n  with:\n     creds: ${{ secrets.AZURE_CREDENTIALS }}\n\n- uses: azure/aks-set-context@v4\n  with:\n     resource-group: '\u003cresource group name\u003e'\n     cluster-name: '\u003ccluster name\u003e'\n```\n\n### Kubelogin\n\n`kubelogin` is at the core of the non-admin user scenario. For more information on `kubelogin`, refer to the documentation [here](https://github.com/Azure/kubelogin).\n\nTo run this Action as a non-admin user, you must first install `kubelogin`. To set up `kubelogin`, you may use the action [azure/use-kubelogin][action_use_kubelogin]:\n\n```yaml\n- name: Set up kubelogin for non-interactive login\n  uses: azure/use-kubelogin@v1.2\n  with:\n     kubelogin-version: 'v0.0.24'\n```\n\n[action_use_kubelogin]: https://github.com/marketplace/actions/setup-kubelogin\n\n### Non-Admin User Example\n\nIf you are executing this Action as a non-admin user, you need to toggle the optional `use-kubelogin` Action input to `true` for it to work.\n\n```yaml\n- uses: azure/login@v2\n  with:\n     client-id: ${{ secrets.AZURE_CLIENT_ID }}\n     tenant-id: ${{ secrets.AZURE_TENANT_ID }}\n     subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}\n\n- uses: azure/aks-set-context@v4\n  with:\n     resource-group: '\u003cresource group name\u003e'\n     cluster-name: '\u003ccluster name\u003e'\n     admin: 'false'\n     use-kubelogin: 'true'\n```\n\n```yaml\n- uses: azure/login@v2\n  with:\n     creds: ${{ secrets.AZURE_CREDENTIALS }}\n\n- uses: azure/aks-set-context@v4\n  with:\n     resource-group: '\u003cresource group name\u003e'\n     cluster-name: '\u003ccluster name\u003e'\n     admin: 'false'\n     use-kubelogin: 'true'\n```\n\n## Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Support\n\naks-set-context is an open source project that is [**not** covered by the Microsoft Azure support policy](https://support.microsoft.com/en-us/help/2941892/support-for-linux-and-open-source-technology-in-azure). [Please search open issues here](https://github.com/Azure/aks-set-context/issues), and if your issue isn't already represented please [open a new one](https://github.com/Azure/aks-set-context/issues/new/choose). The project maintainers will respond to the best of their abilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Faks-set-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Faks-set-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Faks-set-context/lists"}