MQ: Update Identity tests for Azure Pod
Describe the issue:
Test the Testing azure-identity in Azure Pod with instructions (Repro steps) . When run the kubectl logs -f test-xxx command, it displays the error :

In addition, this issue also occurs in other sdk ( python, go, js). We don't file duplicate isssues under other repo.
Environment: Env: Azure Pod Package: https://search.maven.org/artifact/com.azure/azure-identity/1.7.0-beta.2/jar Related issue: https://github.com/Azure/azure-sdk/issues/814
Expected behavior:
Run the kubectl logs -f test-xxx. expected the logs output test pass.
@josefree for notification.
@chlowell could you please assist here as this is the same failure for all languages, and @v-jiaodi only opened the 1 tracking issue in the java repo
It isn't unusual to see that error for a short period of time immediately after launching the pod, because the pod does take at least a few seconds to initialize. If it's still initializing after a couple of minutes though, the pod could be stuck. If you do have a stuck pod, can you please share the output of kubectl describe pods test-xxx for that pod?
@chlowell The output of kubectl describe pods test-xxx for that pod.

I was able to get the tests to pass for Go, Java, JS, and Python, and along the way I learned the instructions are out of date in several places. Your pod is probably stuck initializing because Pod Identity isn't fully configured.
For Java in particular, the Dockerfile in the instructions needs updating before the test app will build. Let me add what I used here, so it doesn't get lost (thanks @g2vinay):
FROM alpine/git as clone
RUN git clone https://github.com/Azure/azure-sdk-for-java --single-branch --depth 1 /azure-sdk-for-java
FROM maven:3-jdk-8
COPY --from=clone /azure-sdk-for-java /azure-sdk-for-java
WORKDIR /azure-sdk-for-java
RUN mvn clean install -Dgpg.skip -DskipTests -f eng/code-quality-reports/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -f common/perf-test-core/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/core/azure-core/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/core/azure-core-test/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/core/azure-core-http-netty/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/identity/azure-identity/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/keyvault/azure-security-keyvault-secrets/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/keyvault/azure-security-keyvault-keys/pom.xml
RUN mvn clean install -Dgpg.skip -DskipTests -Dmaven.javadoc.skip=true -f sdk/keyvault/azure-security-keyvault-certificates/pom.xml
CMD [ "mvn", "test", "-Dtest=ManagedIdentityCredentialLiveTest#testMSIEndpoint*", "-f", "sdk/e2e/pom.xml", "-Dgpg.skip", "-am", "-DfailIfNoTests=false" ]
I'll leave this issue open pending updates to the instructions.
Moving milestone and updating title to match what the work item is now tracking
@chlowell , I updated the Dockfile as described above and retested. First of all, it takes too long ( about 46855s ) to build the docker image. Is this normal?
Even so, the same error finally occurred:

Output of kubectl describe pods test-xxx for that pod as follow:

This image is large and slow to build. It could be more efficient, but the top priority was getting the tests to run. I did that, and the tests passed. The Dockerfile wasn't the only problem. The deployment instructions in the linked issue are (still) out of date, so following them doesn't produce a working test environment. AKS docs have better deployment instructions, and Pod Identity docs have a helpful troubleshooting guide. To be clear though, I don't think it's necessary to run the tests again at this time.
@chlowell ,Please help update the test instructions:https://github.com/Azure/azure-sdk/issues/814#issuecomment-568112609.
@jianghaolu , @jntrnr and @catalinaperalta, For testing azure identity in azure Pod, the current test instructions are out of date, please help update the test instructions. Related issue: https://github.com/Azure/azure-sdk/issues/814 About python language, @pvaneck has opened a PR to update: https://github.com/Azure/azure-sdk-for-python/pull/27585.
@joshfree For testing azure identity in azure Pod, python language has updated test instruction, but the test instructions in other languages are still outdated. Can you help contact relevant personnel to update them?
@joshfree, @jianghaolu For testing azure identity in azure pods, the test instructions for other languages (except python) are outdated. Could you please contact the relevant people to update it? Thanks in advance.
In the Azure Identity SDK RC Test Pass for May 2023, this issue still exists for Java, go, js.
- java identity version: https://github.com/Azure/azure-sdk-for-java/tree/7d20dd9e7cebafad7503d1e17fe31f70b7d14b44/sdk/identity/azure-identity
- go identity version: v1.3.0-beta.5.0.20230425151240-402376456ba8
- Js identity version: @azure/[email protected]
@joshfree, @billwert , @chlowell , @KarishmaGhiya Could you help check it?
Hi @v-jiaodi I will take a look at this soon (probably next week.)
Adding this to the Azure Identity SDK Improvements github project so it's tracked better
Updated Java docker instructions.
Updated Java docker instructions.
@g2vinay , I retested based on your updated Java docker instructions, the same issue can still be reproduced:
Output of
kubectl describe pods test-xxx for that pod as follow:
Hi @v-jiaodi, we deeply appreciate your input into this project. Regrettably, this issue has remained unresolved for over 2 years and inactive for 30 days, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.