Azure AD B2C Unable to upload custom policy

Joseph Fox 21 Reputation points
2021-07-12T14:51:43.88+00:00

I am unable to upload a custom policy to Azure AD B2C (via the web interface). I have been able to upload in the past, as recent as this morning, but it is now broken.

No matter what I upload, I get the following error:

Validation failed: 1 validation error(s) found in policy "{POLICYNAME}" of tenant "{MYTENANT}".An item with the same key has already been added.An item with the same key has already been added.

If I change the policy name to something entirely unique, it still fails. It seems our Azure AD B2C instance is corrupted. This started when I really was trying to overwrite an existing policy, and as such ensured I checked the box "Overwrite the custom policy if it already exists".

At time of writing I don't have access to paid support.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Joseph Fox 21 Reputation points
    2021-07-12T16:20:46.353+00:00

    I misunderstood the error, thinking it was due to a conflict of policy name. My issue was that I had accidentally pasted in a duplicate metadata item assignment to a Technical Profile.
    Further information for posterity: I naively pasted both of the following lines of code from this Stack Overflow answer:
    <Item Key="AllowInsecureAuthInProduction">true</Item>
    <Item Key="AuthenticationType">None</Item>
    Since I already had the second line, I only needed to add the first.


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.