-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authorize GitHub Workflow to publish to ACR and deploy to cluster #253
Comments
I can see a couple of approaches for authenticating the Azure user account with GitHub: via the DevHub API, or directly through VS Code. DevHub APITo consume the DevHub API, we add a dependency to @azure/arm-devhub, which gives us a JS Client that we can use to call However, if the user is attempting to authenticate for the first time, Through VS CodeThe VS Code API has a built-in Which approach to use?Consuming the DevHub API would maximise code reuse since we'd be making use of an existing RP, and might even mean we wouldn't depend on the Draft binary. It would also mean that authorization performed in the Portal would also take effect in VS Code, and vice versa. However, that would make us entirely dependent on the RP implementation and would make it harder to innovate independently. If we were simply building "Automated Deployments for VS Code", this is probably what we'd want, but we are really building our own experience, which we don't want to be tied to a specific Portal feature. So, in terms of both development effort and agility I think it'd be preferable to use the built-in VS Code API for GitHub authorization. |
The AKS extension allows users to create workflow files that publish images to an ACR and deploy applications to a cluster. There is also a command to 'attach' the ACR to the cluster, giving the kubelet identity
AcrPull
permission on the ACR. However, a few extra pieces need to be set up to authorize the GitHub workflow to run successfully, namely:Both Automated Deployments and Draft are able to set up this configuration. However, with both these tools, there is very little visibility into what secrets, applications, identities, credentials and role assignments are being created. This is not ideal from a UX perspective (it can feel opaque and magic, without helping users understand what they've done). It is also potentially worrying from a security standpoint, because if you're not even aware of the resources you've created it's impossible to review and clean them up.
In our implementation, we can provide a much more interactive experience, allowing users to select existing applications and service principals, and review their role assignments, federated identity credentials and associated GitHub secrets. Missing secrets, credentials or role assignments can be added, and extraneous ones removed.
The text was updated successfully, but these errors were encountered: