Create simpler, more efficient dynamic membership rules
Microsoft's edit ·
Microsoft's commit message in MicrosoftDocs/entra-docs · commit 1bcae89 · +3 −3 lines · also on GitHub
⋯ 18 unchanged lines
1919
2020
## Minimize use of the -match operator
2121
22
−Minimize your use of the `-match` operator in rules as much as possible. Instead, explore if it's possible to use the `-startswith` or `-eq` operator. Consider using other properties that allow you to write rules to select the users for a group without using the `-match` operator.
22
+Minimize your use of the `-match` operator in rules as much as possible. Instead, explore if it's possible to use the `-startsWith`, `endsWith` or `-eq` operator. `-eq` is preferred when the full attribute value is known; `-startsWith` and `-endsWith` are next most efficient when only a prefix or suffix is known. Consider using other properties that allow you to write rules to select the users for a group without using the `-match` operator.
2323
2424
For example, if you want a rule for the group that contains all users whose city is Lagos, don't use a rule like these:
2525
⋯ 2 unchanged lines
2828
2929
It's better to use a rule like this example:
3030
31
−- `user.city -startswith "Lag"`
31
+- `user.city -startsWith "Lag"`
3232
3333
Or, best of all:
3434
⋯ 1 unchanged line
3636
3737
## Minimize use of the -contains operator
3838
39
−As with `-match`, minimize your use of the `-contains` operator in rules as much as possible. Instead, explore if it's possible to use the `-startswith` or `-eq` operator. Using `-contains` can increase processing times, especially for tenants that have many dynamic membership groups.
39
+As with `-match`, minimize your use of the `-contains` operator in rules as much as possible. Instead, explore if it's possible to use the `-startsWith`, `-endsWith` or `-eq` operator. Using `-contains` can increase processing times, especially for tenants that have many dynamic membership groups.
4040
4141
## Use fewer -or operators
4242
⋯ 39 unchanged lines
Microsoft's Markdown source from MicrosoftDocs/entra-docs, © Microsoft Corporation, under MIT. Changed lines with up to 3 unchanged lines around each; ChangeIntel kept this copy today 06:21 UTC. The commit date is when the source changed, which can be hours or days before Learn published it.