Edit

Use the text PII playground in Microsoft Foundry

Note

This content refers to the new Foundry portal, which supports only Foundry projects and provides streamlined access to models, agents, and tools. To confirm that you're using new Foundry, make sure the version toggle in the portal banner is in the on position.

The text PII playground in Azure AI Foundry lets you detect and redact personally identifiable information (PII) from raw text interactively, without writing code. You can submit sample text, configure detection and redaction options, and review detected entities before integrating the feature into your application.

Prerequisites

Tip

  • If you already have an Azure Language in Foundry Tools or multi-service resource—whether used on its own or through Language Studio—you can continue to use those existing Language resources within the Microsoft Foundry portal.
  • For more information, see Connect services in the Microsoft Foundry portal.
  • Consider using a Foundry resource for the best experience. You can also follow these instructions with a Language resource.

Role-based access control (RBAC) requirements

Assign the correct roles to your user principal and project managed identity to access the text PII playground. Microsoft recommends using Microsoft Entra ID authentication, which enforces role-based restrictions. Key-based authentication grants full access without role checks and should be avoided in production environments.

Important

The Foundry RBAC roles were recently renamed. Foundry User, Foundry Owner, Foundry Account Owner, and Foundry Project Manager were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. You might still see the previous names in some places while the rename rolls out. The role IDs and core permissions are unchanged.

The active project appears in the upper-left corner. To create a new project:

  1. Open the project drop-down menu.

  2. Enter a project name or select an existing one.

  3. Select Create project.

    Screenshot of the new Foundry homepage.

There are two ways to access the text PII interface:

  • Select the Discover tab from the upper-right navigation bar:

    1. In the search bar, enter Azure and press Enter.
    2. Select Azure-Language-Text-PII redaction from the results.
    3. Select Open in Playground.
  • Select the Build tab from the upper-right navigation bar:

    1. From the left navigation bar, select Models.
    2. Select the AI services tab.
    3. Select Azure-Language-Text-PII redaction to go directly to the playground.

Extract PII from text

The Azure-Language-Text-PII redaction model identifies and redacts personally identifiable information in text. The playground provides configuration options to customize detection and redaction preferences, and detailed output to review detected entities and confidence scores.

  1. On the Playground tab, select Azure Language—Text PII redaction from the drop-down menu.

  2. Select the sample text, use the paperclip icon to upload your text, or enter your own text.

  3. In the Configure pane, set the following options:

    Option Description
    API version Select the API version that you prefer to use.
    Model version Select the model version that you prefer to use.
    Language Select the language in which your source text is written.
    Select types to include Select the PII types you want to redact.
    Value to exclude Specify values you want to exclude from detection. For example, to redact email addresses but exclude a specific ___domain, enter that ___domain as an excluded value.
    Synonyms Provide alternative names for specific entity types. For example, if you enter "Microsoft" as an excluded value, you can also specify synonyms such as MSFT and Microsoft Corporation.
    Policy type Choose the type of redaction policy to apply (character mask, entity mask, or no mask).
  4. Select Detect. Detected entities are highlighted in the text, and you can review the accompanying details in formatted text or as a JSON response.

    Screenshot of PII text detection output in the Foundry playground.

    Field Description
    Type The detected entity type.
    Confidence The model's level of certainty regarding whether it correctly identified an entity type.
    Offset The number of characters from the beginning of the text to the entity.
    Length The character length of the entity.

Verify that the detected entities match the PII in your input text. Use the Edit button to modify Configure parameters and rerun detection as needed.

Open in Visual Studio Code 🆕

After validating your scenario in the playground, select Open in VS Code to carry your current configuration directly into a development environment—no manual setup required.

  1. Configure your scenario in the playground:
    • Select your API version and model version.
    • Enter and test your sample input.
    • Adjust options such as entity types, redaction policy, and excluded values.
  2. Select Open in VS Code.
  3. Visual Studio Code opens with a preconfigured code sample that reflects your playground configuration, including your API version, model, and redaction settings.

Tip

Use the playground to compare outputs across API versions—for example, preview versus GA—before exporting your configuration to code.

Next steps

After opening in Visual Studio Code:

  1. Add your authentication credentials.
  2. Replace the sample input with your production data.
  3. Run and validate the request.
  4. Integrate the code into your application workflow.