+| Deploy custom policy | Azure AD B2C relies on caching to deliver performance to your end users. When you deploy a custom policy using whatever method, expect a delay of up to **30 minutes** for your users to see the changes. As a result of this behavior, consider the following practices when you deploy your custom policies: <br> - If you're deploying to a development environment, set the `DeploymentMode` attribute in your custom policy file's `<TrustFrameworkPolicy>` element to `Production`. <br> - Deploy your updated policy files to a production environment when traffic in your app is low. <br> - When you deploy to a production environment to update existing policy files, upload the updated files with new name(s), which will act as a new version of the policy, and then update your app reference to the new name(s)/version(s). You can then remove the old policy files afterwards, or keep it around as your last know good configuration and hence, an easy rollback mechanism.<br> - If you need to deploy to a production environment to update existing policy files without versioning, you should make the new policy "backward compatible" with the old policy by following some simple rules. If you need to change a technical profile, claim, SubJourney etc. then create a new version of it, publish the policy and wait 30 minutes for Azure AD B2C caches to pick the new version up, then in a subsequent update, make changes to use the new version and make another policy update. After waiting 30 minutes, you can delete the old version of the elements if needed. All of your business logic should also be inside [SubJourneys](https://learn.microsoft.com/en-us/azure/active-directory-b2c/subjourneys). <br> - You can set the `DeploymentMode` to `Development` in a production environment to bypass the caching behavior. However, we don't recommend this practice. If you [Collect Azure AD B2C logs with Application Insights](troubleshoot-with-application-insights.md), all claims sent to and from identity providers are collected, which is a security and performance risk. |
0 commit comments