Azure-Samples / Azure-Samples/serviceconnector-aks-samples
ManagedIdentityCredential: Network unreachable. Message: network_error: Network request failed
- Dominant language
- Python
- Stars
- 8
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
I am not sure how to go about setting this up for an app I have running in AKS. What I want to achieve is to simply read the contents of a storage account. I am not sure whether I am missing any network configuration but something else I tried is running `curl` on the IMDS endpoint. I did this for both within the pod and the VM the pod runs on and the request was successful. I am not really sure what might be causing this issue.
### This issue is for a: (mark with an `x`)
```
- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
```
### Minimal steps to reproduce
>Create an AKS cluster and an Azure storage account.
> Create a connection between the AKS cluster and the Azure storage account with Service Connector.
> Clone a sample application that will talk to the Azure storage account from an AKS cluster.
> Deploy the application to a pod in AKS cluster and test the connection.
### Any log messages given by the failure
```
[nuxt] [request error] [unhandled] [500] ChainedTokenCredential authentication failed.
CredentialUnavailableError: EnvironmentCredential is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.
CredentialUnavailableError: WorkloadIdentityCredential: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters.
In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables -
"AZURE_TENANT_ID",
"AZURE_CLIENT_ID",
"AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot
CredentialUnavailableError: ManagedIdentityCredential: Network unreachable. Message: network_error: Network request failed
CredentialUnavailableError: Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.
CredentialUnavailableError: Error: Unable to execute PowerShell. Ensure that it is installed in your system. To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot.
CredentialUnavailableError: Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.
CredentialUnavailableError: Error: Unable to execute PowerShell. Ensure that it is installed in your system. To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot.
CredentialUnavailableError: Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.
at ./.output/server/chunks/_/base.mjs:3074:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.withSpan (./.output/server/node_modules/@azure/core-tracing/dist/esm/tracingClient.js:33:28)
at async DefaultAzureCredential.getToken (./.output/server/chunks/_/base.mjs:3049:28)
at async tryGetAccessToken (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js:37:32)
at async beginRefresh (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js:45:17)
at async Object.defaultAuthorizeRequest [as authorizeRequest] (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js:22:25)
at async Object.sendRequest (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js:73:13)
at async Object.sendRequest (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js:26:30)
at async Object.sendRequest (./.output/server/node_modules/@azure/storage-blob/dist/index.js:1784:32)
[nuxt] [request error] [unhandled] [500] ChainedTokenCredential authentication failed.
CredentialUnavailableError: EnvironmentCredential is unavailable. No underlying credential could be used. To troubleshoot, visit https://aka.ms/azsdk/js/identity/environmentcredential/troubleshoot.
CredentialUnavailableError: WorkloadIdentityCredential: is unavailable. tenantId, clientId, and federatedTokenFilePath are required parameters.
In DefaultAzureCredential and ManagedIdentityCredential, these can be provided as environment variables -
"AZURE_TENANT_ID",
"AZURE_CLIENT_ID",
"AZURE_FEDERATED_TOKEN_FILE". See the troubleshooting guide for more information: https://aka.ms/azsdk/js/identity/workloadidentitycredential/troubleshoot
CredentialUnavailableError: ManagedIdentityCredential: Network unreachable. Message: network_error: Network request failed
CredentialUnavailableError: Azure CLI could not be found. Please visit https://aka.ms/azure-cli for installation instructions and then, once installed, authenticate to your Azure account using 'az login'.
CredentialUnavailableError: Error: Unable to execute PowerShell. Ensure that it is installed in your system. To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot.
CredentialUnavailableError: Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.
CredentialUnavailableError: Error: Unable to execute PowerShell. Ensure that it is installed in your system. To troubleshoot, visit https://aka.ms/azsdk/js/identity/powershellcredential/troubleshoot.
CredentialUnavailableError: Azure Developer CLI couldn't be found. To mitigate this issue, see the troubleshooting guidelines at https://aka.ms/azsdk/js/identity/azdevclicredential/troubleshoot.
at ./.output/server/chunks/_/base.mjs:3074:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.withSpan (./.output/server/node_modules/@azure/core-tracing/dist/esm/tracingClient.js:33:28)
at async DefaultAzureCredential.getToken (./.output/server/chunks/_/base.mjs:3049:28)
at async tryGetAccessToken (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js:37:32)
at async beginRefresh (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js:45:17)
at async Object.defaultAuthorizeRequest [as authorizeRequest] (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js:22:25)
at async Object.sendRequest (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/bearerTokenAuthenticationPolicy.js:73:13)
at async Object.sendRequest (./.output/server/node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js:26:30)
at async Object.sendRequest (./.output/server/node_modules/@azure/storage-blob/dist/index.js:1784:32)
```
### Expected/desired behavior
> Authenticate with ManagedIdentityCredential
### OS and Version?
> Ubuntu
### Versions
>
### Mention any other details that might be useful
The cluster is created with `cilium` and the `karpenter` managed add-on. I am not sure if this is what is causing the issue.
Contributor guide
Assessment
This issue has not been assessed yet.