I am trying to remove a UDP label set on a file in my tenant by using the following code. Could someone point me to a resource that talks about steps that I'll need to perform to remove this type of label? I have come across code to apply this type of label but nothing that talks about how to remove this using the MIP SDK. I am using a service account that has the "Superuser (Add-AipServiceSuperUser)" permissions
LabelingOptions lowerLabelingOptions = new LabelingOptions()
{
AssignmentMethod = AssignmentMethod.Privileged, //because we are removing a high priority label
IsDowngradeJustified = true,
JustificationMessage = "Lowering label via Azure function"
};
if(deleteHandler.Protection != null)
{
deleteHandler.RemoveProtection();
}
deleteHandler.DeleteLabel(lowerLabelingOptions);
var deleteResult = Task.Run(async () => await deleteHandler.CommitAsync(outputStream)).Result;
The deleteResult variable is returning true (no errors) but the label remains on the file.
Once you have the handler, you can check if the file needs protection to be removed, remove it, and then delete the label from the file.
Now you can commit changes to some output file. Note that in your example you are committing to a stream that needs to be saved somewhere.