An organization is deploying a large language model inference endpoint using Azure Machine Learning managed online endpoints. The security team requires that inference requests containing PII must be detected and logged separately for compliance purposes. What is the recommended approach to implement this within the Azure ML inference pipeline?
Select an answer to reveal the explanation.
Short Explanation
You should put the PII check inside the endpoint’s pre-processing scoring script. That lets you detect PII in each inference request before the model sees it and log the results separately for compliance.
Full Explanation
The correct approach is to implement a pre-processing Python scoring script in the managed online endpoint that calls Azure AI Language PII detection before passing the request to the model. Azure Machine Learning managed online endpoints execute a scoring script, commonly score.py, that can be customized to include pre-processing logic. Adding a call to Azure AI Language's PII detection service within the scoring script enables real-time PII detection on each inference request before it reaches the model, with results logged to a separate compliance logging store. This approach integrates seamlessly within the existing ML deployment without external proxy infrastructure. The option that deploys Azure API Management in front of the managed online endpoint and uses APIM policies to inspect and log PII-containing requests is incorrect because adding APIM as a proxy adds latency and infrastructure complexity; it also requires APIM to have visibility into request bodies, which requires careful configuration. The option that configures Microsoft Purview DLP on the Azure Machine Learning workspace to scan inference request logs is incorrect because Purview DLP on inference request logs would provide after-the-fact compliance scanning, not real-time detection during inference. The option that enables Azure Monitor Application Insights on the managed online endpoint and uses custom telemetry to log PII detection results is incorrect because Application Insights provides telemetry infrastructure but does not itself perform PII detection; the PII detection logic must still be implemented in the scoring script.