Regex Replace - help with replace

Gabriel A. Hernandez 0 Reputation points
2023-03-06T21:23:30.83+00:00

Good afternoon,

I'm trying to migrate an Saml application to Azure Enterprise Applications. The application within ADFS currently manipulates the claims received from active directory and formats it as the Application vendor expects it.

Issuance Transform Rule from ADFS gets the Sam Account name and When created date and Truncates it.

What the application expects is the following "samaccountname-whencreateddate" but the when created date is passed over as shortdate. So essentially its received by the application as this "Tesuser-20220306105720"

Im trying to implement this azure by adding a custom claim and joining the two claims together, However Im unsure how exactly to manipulate this data using regex replace.

I have tried a couple of options but Im really not familiar with this, Would appreciate some assistance.

Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
148 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,162 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,716 Reputation points Microsoft Employee
    2023-03-11T03:57:31.3233333+00:00

    The exact expression would depend on the format of your SAML account name but a general RegexReplace that you could try is RegexReplace(SAML_Account_Name, "(.*)_(.*)", "$1-$2"). Here, "(.*)_(.*)" should match the SAML account name with the creation datetime and "$1-$2" should join the two tokenized groups in regular expression.

    0 comments No comments

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.