Skip to content

Azure Container Repository Login Fails #3288

@dbalseiro

Description

@dbalseiro

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

  1. 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
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions