title: How to access Azure KeyVault from Asp.net Core Docker container deployed in Azure Kubernetes Service (AKS) as pod?
body: <p>I have an Asp.Net Core application that is configured to connect to Azure KeyVault using Visual Studio 2019 Connected Services:</p>
  <p><a href="https://docs.microsoft.com/en-us/azure/key-vault/general/vs-key-vault-add-connected-service" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/key-vault/general/vs-key-vault-add-connected-service</a></p>
  <p>I containerized the application with Docker and deployed it into Kubernetes as a Pod.
  The KeyVault connection is not working, probably because of the Managed Identity not set-up.</p>
  <p>I tried:</p>
  <ol>
  <li>Added the Kubernetes agent Managed Identity to the KeyVault Acccess policies like I would do with App Services or Container Services, but does not allow the connection.</li>
  <li>Followed the docs here: <a href="https://docs.microsoft.com/en-us/azure/key-vault/general/key-vault-integrate-kubernetes" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/key-vault/general/key-vault-integrate-kubernetes</a></li>
  </ol>
  <p>I wonder if the &quot;Azure Key Vault provider for the Secrets Store CSI driver on Kubernetes&quot; is the right way to use KeyVault from a pod, or if there is a simpler solution like a direct connection.</p>