k8s-actions/aks-set-context
UshaN 7a93ceb73d Update action.yml with deprecation message (#34)
* Update action.yml

* Update action.yml

* Update action.yml

* Update action.yml

* Update action.yml

* Update action.yml

* Update action.yml
2019-12-04 16:24:40 +05:30
..
lib New Azure Creds logic (#14) 2019-07-31 16:49:18 +05:30
src New Azure Creds logic (#14) 2019-07-31 16:49:18 +05:30
README.md fixes #28 2019-09-10 20:13:48 +05:30
action.yml Update action.yml with deprecation message (#34) 2019-12-04 16:24:40 +05:30
tsconfig.json AKS set context action (#8) 2019-07-29 16:00:38 +05:30

README.md

Azure Kubernetes Service set context

Used for setting the target AKS cluster context which will be used by other actions like azure/k8s-actions/k8s-deploy, azure/k8s-actions/k8s-create-secret etc. or run any [kubectl] (https://kubernetes.io/docs/reference/kubectl/overview/) commands.

uses: azure/k8s-actions/aks-set-context@master
    with:
        creds: '${{ secrets.AZURE_CREDENTIALS }}' # Azure credentials
        resource-group-name: '<resource group name>'
        cluster-name: '<cluster name>'
    id: login

Refer to the action metadata file for details about all the inputs https://github.com/Azure/k8s-actions/blob/master/aks-set-context/action.yml

Azure credentials

Run az ad sp create-for-rbac --sdk-auth to generate an Azure Active Directory service principals. For more details refer to: az ad sp create-for-rbac

{
  "clientId": "<client id>",
  "clientSecret": "<client secret>",
  "subscriptionId": "<subscription id>",
  "tenantId": "<tenant id>",
  "activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
  "resourceManagerEndpointUrl": "https://management.azure.com/",
  "activeDirectoryGraphResourceId": "https://graph.windows.net/",
  "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
  "galleryEndpointUrl": "https://gallery.azure.com/",
  "managementEndpointUrl": "https://management.core.windows.net/"
}

Using secret

Now add the json output as a secret in the GitHub repository. In the above example the secret name is AZURE_CREDENTIALS and it can be used in the workflow by using the following syntax:

creds: '${{ secrets.AZURE_CREDENTIALS }}'