-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[V2] Add OIDC Test, Cut V2.0.0 #331
Conversation
…to avoid locally built plugin issue
… plugins issue is fixed
6322ae6
to
c93b915
Compare
Merging this without approval due to the test previously being approved, and it otherwise being a version bump. |
@JenGoldstrich Using your code for the GitHub workflow, I see that the request JWT has an expiration time in only 5 minutes:
How did you get around this issue and/or do you have any suggestions to rectify this issue? |
hey @adyavanapalli I believe you're using a version of the Azure plugin before 2.0.0, prior to 2.0.0 there was a check in the code that would block builds where the client jwt was less than 5 minute away from expiry, the initial OIDC auth token however would always throw an error for this. Can you confirm the version of the Azure plugin you are using, and if you're experiencing this on versions greater than or equal to 2.0.0 open a new issue with the version of packer and the Azure plugin you are using |
Hey @JenGoldstrich, you were absolutely right. v2.0.0 and above fixes that issue. Thank you for the quick response 😄 ! |
Hi @JenGoldstrich , I read the post "https://www.hashicorp.com/blog/version-2-packer-azure-plugin-now-available". I use Packer with the latest Azure plugin and use the OIDC connection. After approximately 50 minutes the following error occurs: ==> azure-arm.windows11-avd: autorest/Client#Do: Preparing request failed: StatusCode=0 -- Original Error: clientCredentialsToken: received HTTP status 401 with response: {"error":"invalid_client","error_description":"AADSTS700024: Client assertion is not within its valid time range. Current time: 2024-02-27T14:01:33.3967841Z, assertion valid from 2024-02-27T12:47:05.0000000Z, expiry time of assertion 2024-02-27T12:52:05.0000000Z. Review the documentation at https://docs.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials . Trace ID: b4e5b623-f000-4983-876c-85b424ac8e00 Correlation ID: 1b880267-c308-4c21-a6f6-085e62971c0d Timestamp: 2024-02-27 14:01:33Z","error_codes":[700024],"timestamp":"2024-02-27 14:01:33Z","trace_id":"b4e5b623-f000-4983-876c-85b424ac8e00","correlation_id":"1b880267-c308-4c21-a6f6-085e62971c0d","error_uri":"https://login.microsoftonline.com/error?code=700024"} It looks like a token expiration problem. Do you know how you can solve this? |
Successful run of test: https://github.com/hashicorp/packer-plugin-azure/actions/runs/5837275042/job/15832492979, I've now configured the service principal in Azure to run on main after testing it on this branch. Once we merge I will tag the squashed merge commit as v2.0.0