Giter Site home page Giter Site logo

Comments (22)

danwkennedy avatar danwkennedy commented on July 19, 2024 6

Is it possible to release this as a patch fix sooner? This potentially impacts every use of the azure/login GitHub Action.

Also, the workaround only works if you're using the azure/cli Action. If you use the az command directly in your scripts, it won't work. This use case is fairly common since hosted GitHub Actions runners come with the latest version of the az command preinstalled. Without this, users have to override the version and we have to hope they remember to undo their workarounds later.

from azure-cli.

jiasli avatar jiasli commented on July 19, 2024 2

Azure CLI 2.60.0 has been released just now with this issue fixed:

https://github.com/Azure/azure-cli/blob/dev/src/azure-cli-core/HISTORY.rst#2600

Fix #28737: Fix token cache for service principal authentication (#28747)

The rollout status for Azure CLI on GitHub Actions and Azure DevOps images can be found at https://github.com/actions/runner-images

from azure-cli.

jiasli avatar jiasli commented on July 19, 2024 1

Workarounds

Adopt either workarounds:

  1. Use service principal secret for authentication:

  2. [GitHub Actions only] In Azure CLI Action azure/cli@v2, specify azcliversion to use an older version of Azure CLI below 2.59.0, such as 2.58.0: https://github.com/marketplace/actions/azure-cli-action

from azure-cli.

yonzhan avatar yonzhan commented on July 19, 2024 1

@jiasli is working on the new build right now.

from azure-cli.

bcarthic avatar bcarthic commented on July 19, 2024 1

@jiasli, Even after upgrading to Azure CLI 2.60.0, I am facing the same issue. I am running the Azure CLI task from Azure devops and it expires after 10 mins and I get ERROR: AADSTS700024: Client assertion is not within its valid time range.

Since the images still uses 2.59.0, I do az upgrade --yes before running dotnet test.

from azure-cli.

jiasli avatar jiasli commented on July 19, 2024 1

Azure CLI 2.60.0 has been deployed to GitHub Actions and Azure DevOps images: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md#cli-tools

from azure-cli.

jiasli avatar jiasli commented on July 19, 2024

We plan to fix this issue in the next Azure CLI release: https://github.com/Azure/azure-cli/milestone/141

Official Release: 04/30/2024
Azure CLI version: 2.60.0

For now, to get unblocked, please follow the instructions at #28737 (comment).

from azure-cli.

andre-qumulo avatar andre-qumulo commented on July 19, 2024

@jiasli Thank you for the update. Just for clarity, what, specifically, will get fixed? Will we still need the code to continue requesting the OID token in the background or will we just need to use Azure CLI 2.60.0?

from azure-cli.

danwkennedy avatar danwkennedy commented on July 19, 2024

@jiasli would it be possible to release this in a patch fix?

from azure-cli.

cloudcosmonaut avatar cloudcosmonaut commented on July 19, 2024

@jiasli is there anyway to promote this as a hotfix so releases that rely on az cli can work again? The current time limit is braking a lot of builds :(

from azure-cli.

cloudcosmonaut avatar cloudcosmonaut commented on July 19, 2024

Awesome! Any ETA for this release?

from azure-cli.

vaibbavisk20 avatar vaibbavisk20 commented on July 19, 2024

Is there any workaround for Azure/[email protected] while the hot fix makes it to production, since there doesn't seem to be a way to change the cli version this action uses?

from azure-cli.

vaibbavisk20 avatar vaibbavisk20 commented on July 19, 2024

Service principal with a secret is not feasible for our case, due to issues transmitting and storing the value. Changing azure/cli version is not feasible due to using azure/login and azure/powershell only

from azure-cli.

jiasli avatar jiasli commented on July 19, 2024

Changing azure/cli version is not feasible due to using azure/login and azure/powershell only

This 5-minute-expiration issue only affects azure/cli action. azure/login and azure/powershell are not affected. If your task lasts longer than 60 minutes, this is currently a known limitation: #28708

from azure-cli.

cloudcosmonaut avatar cloudcosmonaut commented on July 19, 2024

@jiasli is working on the new build right now.

@yonzhan any update on this? When can we expect a release?

from azure-cli.

yonzhan avatar yonzhan commented on July 19, 2024

Build to Cloud Shell: 04/25/2024
Official Release: 04/30/2024
Azure CLI version: 2.60.0

from azure-cli.

nosalan avatar nosalan commented on July 19, 2024

This is quite a problematic issue for us and makes service connections based on Workload Identity federation unusable. Please add a test suite for regression so that it doesn't happen again.

from azure-cli.

nosalan avatar nosalan commented on July 19, 2024

The issue also happens with Azure PowerShell on the latest MS Hosted Azure DevOps agents, example:

Set-AzFirewall -AzureFirewall $azfwAllocated | Select-Object Name,  …
     |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | ClientAssertionCredential authentication failed: A configuration issue
     | is preventing authentication - check the error message from the server
     | for details. You can modify the configuration in the application
     | registration portal. See https://aka.ms/msal-net-invalid-client for
     | details.  Original exception: AADSTS700024: Client assertion is not
     | within its valid time range. Current time: 2024-04-26T07:47:14.2804194Z,
     | assertion valid from 2024-04-26T06:52:04.0000000Z, expiry time of
     | assertion 2024-04-26T07:02:04.0000000Z. Review the documentation at
     | https://docs.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials . Trace ID: <REDACTED> Correlation ID: <REDACTED>

Also AzureCli@2 task is affected.

from azure-cli.

cloudcosmonaut avatar cloudcosmonaut commented on July 19, 2024

Build to Cloud Shell: 04/25/2024 Official Release: 04/30/2024 Azure CLI version: 2.60.0

Can I fetch the Cloud build to ingest it in a pipeline decorator?

from azure-cli.

LiliDeng avatar LiliDeng commented on July 19, 2024

@jiasli, Even after upgrading to Azure CLI 2.60.0, I am facing the same issue. I am running the Azure CLI task from Azure devops and it expires after 10 mins and I get ERROR: AADSTS700024: Client assertion is not within its valid time range.

Since the images still uses 2.59.0, I do az upgrade --yes before running dotnet test.

+1

from azure-cli.

jiasli avatar jiasli commented on July 19, 2024

@bcarthic, are you requesting a data-plane access token? If so, please see #28708 (comment).

from azure-cli.

m-soltani avatar m-soltani commented on July 19, 2024

@bcarthic, are you requesting a data-plane access token? If so, please see #28708 (comment).

@jiasli
What happens if I intend to kick off a long-running operation that starts by obtaining an access token and concludes five hours later? This scenario is typical for us, as we use Packer to create VM images for our build servers. Are there any plans to implement a process in Azure CLI that automatically exchanges a refresh token for an access token in the background? Packer is configured to use already logged in account via Azure CLi. With the current fix, the access token expires 1 Hour later and there is no chance to refreshing that :(

from azure-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.