Right now I have several ideas in theory, but they all have problems. My setup is:
- Azure DevOps Services
- Azure Cloud
- A powerful service principal connection with which I run the pipeline
- Pipeline deploys an AKS cluster, AAD Pod Identity and Argo CD.
- Pipeline configures a Managed Identity for the Argo CD service.
- Pipeline adds the ArgoCD Managed Identity as a user to Azure Repos
The Problem - could not find a way to add a managed identity as a user to Azure Repos.
- Pipeline deploys an AKS cluster, Argo CD and generates SSH public/private keys.
- Pipeline registers the public SSH key with the Azure DevOps Services.
- Argo CD would use the generated private SSH key to access Azure DevOps under the identity of the pipeline account.
The Problem - there is no REST API to register a public SSH key with the Azure DevOps Services. Another problem is that we need to manage the SSH private key storage (be it in the terraform remote state or in an Azure KV or both)
- Manually register SSH public key with Azure DevOps. The respective private key is uploaded as a secure file in the Pipelines Library.
- Pipeline deploys an AKS cluster, an Azure Key Vault and Argo CD.
- Pipeline uploads the SSH private key to the Azure Key Vault
- Pipeline configures ArgoCD to read the SSH private key from the Azure Key Vault and use it to authenticate with the Azure Repos.
The Problem - How to make ArgoCD get the secrets from the Azure Key Vault? There seem to be multiple ways:
And the question is - which one is the most mature and the safest?
I wonder how folks have resolved this question. What is your approach to this problem?