You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
When using DefaultAzureCredential in github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 on Azure Container Instance, it throws error ManagedIdentityCredential: unexpected response to IMDS probe.
Azure Container Instance implements same IMDS token request protocol, but its response to SDK's probe request is different with the authentic IMDS. Authentic IMDS returns {"error":"invalid_request","error_description":"Required metadata header not specified"}, but ACI's mock IMDS only returns plain string Required metadata header not specified or not correct.
azidentity v1.7.0 works. Checking whether the response to probe request is a valid JSON is added in DefaultAzureCredential continues after an unexpected IMDS response #23273.
What did you expect or want to happen?
Azure SDK should work on Azure Container Instance, by accepting the probe response to be a string, or... coordinate with ACI team so ACI also returns a JSON for probe request.
How can we reproduce it?
Deploy this bicep template to get an ACI instance which simulates the probe request sent by azidentity SDK:
Thanks for reporting this! I don't see a good way to make DefaultAzureCredential do the right thing in this scenario. Reverting #23273 is easy but would regress other applications. Alternatively, we could add a special case for ACI, but that would use a fragile mechanism like matching the error string because we can't identify ACI at runtime. I'll give this some more thought and discuss it with the rest of the team after the holidays. In the meantime, you can avoid this by using ManagedIdentityCredential instead.
Bug Report
When using
DefaultAzureCredential
ingithub.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
on Azure Container Instance, it throws error ManagedIdentityCredential: unexpected response to IMDS probe.Azure Container Instance implements same IMDS token request protocol, but its response to SDK's probe request is different with the authentic IMDS. Authentic IMDS returns
{"error":"invalid_request","error_description":"Required metadata header not specified"}
, but ACI's mock IMDS only returns plain stringRequired metadata header not specified or not correct
.azidentity v1.7.0 works. Checking whether the response to probe request is a valid JSON is added in DefaultAzureCredential continues after an unexpected IMDS response #23273.
Azure SDK should work on Azure Container Instance, by accepting the probe response to be a string, or... coordinate with ACI team so ACI also returns a JSON for probe request.
Deploy this bicep template to get an ACI instance which simulates the probe request sent by azidentity SDK:
Output:
In comparison, this is the response of an authentic IMDS server, by running the same curl command on a VM:
The text was updated successfully, but these errors were encountered: