A cloud-based identity and access management service for securing user authentication and resource access
Hello Shree Varshan G,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that you have Question Regarding Entra SCIM Provisioning Exporting Old userName Value.
Most of all, regarding your questions:
Under what conditions can Entra provisioning continue exporting an older
userNamevalue even after the UPN has changed?
When:
- User already matched using old value
- Matching attribute still resolves to that identity
- Target object holds legacy identifier
Why provision on demand sending the some email address that is not a upn
Because:
- It uses same matching and correlation engine
- It does NOT bypass identity linkage - https://learn.microsoft.com/en-us/entra/identity/app-provisioning/provision-on-demand
The cause is not simply the userPrincipalName → userName mapping. The issue is caused by the existing provisioning matching/correlation state between Microsoft Entra ID and the target SCIM application. - https://learn.microsoft.com/en-us/entra/identity/app-provisioning/how-provisioning-works, https://learn.microsoft.com/en-us/entra/identity/app-provisioning/customize-application-attributes
The best practice advice to you is to:
- Review the SCIM user attribute mappings and confirm which attribute is configured for “Match objects using this attribute.”- https://learn.microsoft.com/en-us/entra/identity/app-provisioning/customize-application-attributes
- Stop using a mutable value such as
userPrincipalName,mail, or email address as the primary matching attribute if those values can change. - https://microsoft.github.io/zerotrustassessment/docs/workshop-guidance/identity/RMI_120 - Use a stable immutable identifier for matching, preferably: Microsoft Entra ID objectId > SCIM externalId
- Keep the display/login value mapping separately as: userPrincipalName > userName
- Break the old correlation for the affected user by removing the user from the application scope or deleting the stale target SCIM user, then re-provision the user cleanly after the matching rule is corrected.
- Restart provisioning and run Provision on demand again to confirm that the current UPN is now exported to
userName. On-demand provisioning uses the same provisioning configuration, mapping, and matching logic as normal provisioning, so it is useful for validating the corrected configuration. - https://learn.microsoft.com/en-us/entra/identity/app-provisioning/provision-on-demand
After the matching rule is changed to an immutable identifier and the stale target correlation is removed, Microsoft Entra will correctly identify the target account by externalId and export the current UPN into userName as expected.
Use the below official Microsoft resources for more reading and steps:
- Microsoft Entra provisioning architecture: https://learn.microsoft.com/en-us/entra/identity/app-provisioning/how-provisioning-works
- Customize Microsoft Entra attribute mappings: https://learn.microsoft.com/en-us/entra/identity/app-provisioning/customize-application-attributes
- On-demand provisioning in Microsoft Entra ID: https://learn.microsoft.com/en-us/entra/identity/app-provisioning/provision-on-demand
- SCIM support in Microsoft Entra ID: https://learn.microsoft.com/en-us/entra/identity/app-provisioning/scim-support-in-entra-id
I hope this is helpful! Do not hesitate to let me know if you have any other questions, steps or clarifications.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.