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

Nekhilesh Bansod 20 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.
686 questions
{count} votes

Accepted answer
  1. Patchfox 4,176 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.

0 additional answers

Sort by: Most helpful

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.