Creating and automating custom data classification policies
You can absolutely create custom classification rules in the Microsoft Purview governance portal using regex patterns or keyword lists to fit your organizational needs. These are applied during scans to classify newly onboarded data.
However, at this time, custom classification rules must be created manually in the portal. They cannot be created or managed via REST API or SDKs.
Once your classification rules are in place, you can automate scans to apply them continuously as new data is ingested.
Applying sensitive data labels automatically
Yes, Microsoft Purview integrates with Microsoft Information Protection (MIP) to apply sensitivity labels based on data content or metadata. For example, if Purview identifies sensitive information types (like credit card numbers or national IDs), it can trigger auto-labeling policies configured in the Microsoft 365 Compliance Center.
Labels are not applied directly in Purview — they’re managed via MIP and associated with classification results.
Keeping classification and tagging up to date
To keep classification and tagging current with structural or content changes:
Set up recurring or triggered scans in the Purview portal or via automation tools (e.g., Azure Data Factory). These scans ensure that any schema or content changes are reclassified with the latest rules.
Automating processes within Purview
You can automate several aspects of the classification process, including:
Registering new data sources using the Purview REST API.
Triggering scans after new data is ingested (e.g., using pipelines or Azure Functions).
Monitoring changes using Purview Insights or Azure Monitor.
That said, the creation of classification rules still requires manual setup, and there’s currently no public API for managing them.
For more details refer: https://learn.microsoft.com/en-us/purview/sensitivity-labels-teams-groups-sites?view=o365-worldwide
I hope this information helps.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.