Context
Starting with az CLI v2.30, token persistence to accessTokens.json was deprecated. However, func still relies on this file to authenticate against ACR. As a result, we are hitting errors such as:
open Azure access tokens: no such file or directory
This breaks ACR authentication flows that previously worked without any user-side changes.
Possible Approaches
- Call
az acr login --expose-token or az account get-access-token to get a fresh token from az CLI whenever we want to access an Azure Container Repository
- Use the Azure SDK for Go to get default credentials and a fresh token (this would delegate authentication to supported mechanisms (including, but not limited to
az CLI)
Related Work
I implemented a fix to validate the second approach here: stackbuilders#2
The PR avoids relying on accessTokens.json and instead fetches a fresh token using the SDK.
Happy to open a PR here and adjust it to better align with the project’s preferred direction.
Context
Starting with
azCLI v2.30, token persistence to accessTokens.json was deprecated. However,funcstill relies on this file to authenticate against ACR. As a result, we are hitting errors such as:This breaks ACR authentication flows that previously worked without any user-side changes.
Possible Approaches
az acr login --expose-tokenoraz account get-access-tokento get a fresh token from az CLI whenever we want to access an Azure Container RepositoryazCLI)Related Work
I implemented a fix to validate the second approach here: stackbuilders#2
The PR avoids relying on
accessTokens.jsonand instead fetches a fresh token using the SDK.Happy to open a PR here and adjust it to better align with the project’s preferred direction.