Skip to main content
added 206 characters in body
Source Link
Dadwals
  • 1.3k
  • 3
  • 10
  • 17
  1. Created a User Assigned Managed Identity Azure Resource

  2. I deployed the Container Group with User Managed Identity as shown below: image

  3. Provided access to User Identity for a given Keyvault

  4. Now when I am trying to access the keyvault using the following C# code, its throwing exception:

image

Exception Error loading KV settings:: One or more errors occurred. (Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/xxxxxxxxx. 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/xxxxxx. 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/xxxxx. 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/xxxxxxxx. Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. )


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Here is recent error in container logs:

Startup Exception occurred: ManagedIdentityCredential authentication failed: 'R' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.

  1. Created a User Assigned Managed Identity Azure Resource

  2. I deployed the Container Group with User Managed Identity as shown below: image

  3. Provided access to User Identity for a given Keyvault

  4. Now when I am trying to access the keyvault using the following C# code, its throwing exception:

image

Exception Error loading KV settings:: One or more errors occurred. (Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/xxxxxxxxx. 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/xxxxxx. 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/xxxxx. 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/xxxxxxxx. Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. )


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

  1. Created a User Assigned Managed Identity Azure Resource

  2. I deployed the Container Group with User Managed Identity as shown below: image

  3. Provided access to User Identity for a given Keyvault

  4. Now when I am trying to access the keyvault using the following C# code, its throwing exception:

image

Exception Error loading KV settings:: One or more errors occurred. (Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/xxxxxxxxx. 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/xxxxxx. 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/xxxxx. 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/xxxxxxxx. Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. )


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Here is recent error in container logs:

Startup Exception occurred: ManagedIdentityCredential authentication failed: 'R' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.

Source Link
Dadwals
  • 1.3k
  • 3
  • 10
  • 17

Azure Container Instance Managed (User Assigned) Identity not able to fetch Keyvault secrets

  1. Created a User Assigned Managed Identity Azure Resource

  2. I deployed the Container Group with User Managed Identity as shown below: image

  3. Provided access to User Identity for a given Keyvault

  4. Now when I am trying to access the keyvault using the following C# code, its throwing exception:

image

Exception Error loading KV settings:: One or more errors occurred. (Parameters: Connection String: [No connection string specified], Resource: https://vault.azure.net, Authority: https://login.windows.net/xxxxxxxxx. 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/xxxxxx. 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/xxxxx. 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/xxxxxxxx. Exception Message: Tried to get token using Azure CLI. Access token could not be acquired. )


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.