question

som avatar image
0 Votes"
som asked MaulikModi-2525 commented

Azure Managed Identity from within a docker container running locally

I am running a docker container consisting of a asp.net core 3.1 api. This api needs access to Azure key vault how can i assigned the mananed idenity to docker conatiner.
My code in working from Vs code and command line.
my code is

ProtectKeysWithAzureKeyVault(keyVaultIdentifier, new DefaultAzureCredential(true));


azure-active-directoryazure-container-instances
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@som Have you tried checking this blog and the documentation over here. If you looking to access it locally then you may try another approach of adding access token to environment variable and using it in your code to access key vault.


1 Vote 1 ·

@som Please let us know if you still need any assistance.

0 Votes 0 ·

As soon as we have a token then it is less secure, someone could share the key with actors outside the organization.

There must be a way to do this using Azure AD groups and loging in on the docker container.

0 Votes 0 ·

@WayneThompson-0993 ,
Azure client uses Credential chain, when you are running in local, you can supply using environment variable and
when you are running from docker, you can use Azure managed identity. will it work?

0 Votes 0 ·

0 Answers