Hi Neha,
Based on my tests Azure Container Instances only supports getting tokens via the IMDS metadata/identity/oauth2/token endpoint. In other words, Instance isn't supported.
The other endpoint categories return 404 error if Identity is enabled for the container, if Identity is not enabled for the container then connections to IMDS will fail as in your example.
If you would like to confirm my results, navigate to your container instance -- Identity blade in the portal, turn on system-assigned managed identity, Save, wait a minute, then repeat test in your container.
Please click Accept Answer if the above was useful.
Thanks.
-TP