Skip to content
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

Get access token using Microsoft.Azure.Services.AppAuthentication in a container #4933

Closed
Zenuka opened this issue Oct 26, 2018 · 3 comments
Closed

Comments

@Zenuka
Copy link

Zenuka commented Oct 26, 2018

I've got a docker container using the AzureServiceTokenProvider to get an access token to access key vault but it's not working. I'm getting the following exception message:

Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/{GUID}. Exception Message: Tried the following 3 methods to get an access token, but none of them worked.
Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/{GUID}. Exception Message: Tried to get token using Managed Service Identity. Unable to connect to the Managed Service Identity (MSI) endpoint. Please check that you are running on an Azure resource that has MSI setup.
Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/{GUID}. Exception Message: Tried to get token using Visual Studio. Access token could not be acquired. Environment variable LOCALAPPDATA not set.
Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/{GUID}. Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. 

I'm not sure if the nuget package should be working inside a docker container I start up using Visual Studio (docker-compose).

@Zenuka Zenuka changed the title Running a container which uses Microsoft.Azure.Services.AppAuthentication Get access token using Microsoft.Azure.Services.AppAuthentication in a container Oct 26, 2018
@Zenuka
Copy link
Author

Zenuka commented Feb 1, 2019

Anyone have an idea if this should be working or if this is not supported currently?

@kdcllc
Copy link

kdcllc commented Mar 22, 2019

@Zenuka please give a test drive for this cli tool https://www.nuget.org/packages/appauthentication/

@varunsh-coder
Copy link
Contributor

To use the app auth library in a container on local machine, you will need to set env variables to use an explicit service principal credential. https://docs.microsoft.com/en-us/azure/key-vault/service-to-service-authentication#running-the-application-using-a-service-principal

@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants