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

Nekhilesh Bansod 0 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.
405 questions
GitHub Training
GitHub Training
GitHub: A web-based hosting service for software development and version control using Git. Acquired by Microsoft in 2018.Training: Instruction to develop new skills.
43 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Patchfox 3,831 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!


Your answer

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