Share via

Azure GitHub Action Federated Identity Login Issue with Release Tag Pattern Matching

Nekhilesh Bansod 25 Reputation points
2024-09-19T09:58:06.9933333+00:00

I am deploying a container app in Azure using GitHub Actions. I encountered an issue with the federated identity when trying to login with Azure CLI through OIDC.

The error from the GitHub Action log is as follows:

AADSTS700213: No matching federated identity record found for presented assertion subject 'repo:yeshpal-test17/container-app-bot:ref:refs/tags/alpha-v1'. Please note that the matching is done using a case-sensitive comparison. Check your federated identity credential Subject, Audience and Issuer against the presented assertion.

It seems the issue is related to the subject identifier in the federated credentials. I tried using a wildcard pattern in the subject identifier, such as: repo:yeshpal-test17/container-app-bot:ref:refs/tags/alpha-v* and repo:yeshpal-test17/container-app-bot:ref:refs/tags/*

However, both attempts returned the same error. The only time the action succeeds is when I specify the exact tag in the subject identifier like this: repo:yeshpal-test17/container-app-bot:ref:refs/tags/alpha-v2

Is there a way to configure the subject identifier to allow wildcard pattern matching for different tags in a single federated identity credential? Or is there a recommended approach to handle this scenario in Azure and GitHub Actions?

Thanks in advance!

Azure Container Apps
Azure Container Apps

An Azure service that provides a general-purpose, serverless container platform.


Answer accepted by question author

  1. Mario Schützle 4,181 Reputation points
    2024-09-19T10:20:10.5133333+00:00

    Hello, unfortunately it is not possible by design to use wildcards in the subject string.

    Currently it is only possible to choose from the following options:

    • Environment scope: repo:< Organization/Repository >:environment:< Name >

    OR

    • Branch Scope: repo:< Organization/Repository >:ref:< ref path>

    The answer is probably not satisfactory but answers it anyway.


    If the reply was helpful, please don’t forget to upvote or accept it as an answer, thank you!

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2025-07-09T21:00:46.96+00:00

    https://docs.azure.cn/en-us/entra/workload-id/workload-identities-flexible-federated-identity-credentials?tabs=github
    Flexible federated identity credentials (preview) was announced in 03/12/2025 may be able to help with this by making a Federated credential scenario: Other with A Claims matching expression of

    claims['sub'] matches '^repo:prosperops/azure:ref:refs/heads/gh-readonly-queue/main/.*'

    P.S. It's a preview ;)

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.