← cd ~/roles
// roles/azure · ai-machine-learning
Cognitive Services Face RecognizerAzure built-in role
Lets you perform detect, verify, identify, group, and find similar operations on Face API. This role does not allow create or delete operations, which makes it well suited for endpoints that only need inferencing capabilities, following 'least privilege' best practices.
| Role ID | 9894cab4-e18a-44aa-828b-cb588cd6f2d7 |
|---|---|
| Category | Ai-machine-learning |
| Actions | 0 |
| Data actions | 12 |
Before you assign it
- It reaches the data, not just the resource. It has 12 data actions, such as reading blobs, secrets or messages.
What it can do
No control-plane actions.
Data actions
| Permission | What it allows |
|---|---|
Microsoft.CognitiveServices/accounts/Face/detect/action | Detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes. |
Microsoft.CognitiveServices/accounts/Face/verify/action | Verify whether two faces belong to a same person or whether one face belongs to a person. |
Microsoft.CognitiveServices/accounts/Face/identify/action | 1-to-many identification to find the closest matches of the specific query person face from a person group or large person group. |
Microsoft.CognitiveServices/accounts/Face/group/action | Divide candidate faces into groups based on face similarity. |
Microsoft.CognitiveServices/accounts/Face/findsimilars/action | Given query face's faceId, to search the similar-looking faces from a faceId array, a face list or a large face list. faceId |
Microsoft.CognitiveServices/accounts/Face/detectliveness/multimodal/action | |
Microsoft.CognitiveServices/accounts/Face/detectliveness/singlemodal/action | Performs liveness detection on a target face in a sequence of images of the same modality (e.g. color or infrared), and returns the liveness classification of the target face as either ‘real face’, ‘spoof face’, or ‘uncertain’ if a classification cannot be made with the given inputs. |
Microsoft.CognitiveServices/accounts/Face/detectlivenesswithverify/singlemodal/action | Detects liveness of a target face in a sequence of images of the same stream type (e.g. color) and then compares with VerifyImage to return confidence score for identity scenarios. |
Microsoft.CognitiveServices/accounts/Face/*/sessions/action | Every operation matching Microsoft.CognitiveServices/accounts/Face/*/sessions/action |
Microsoft.CognitiveServices/accounts/Face/*/sessions/delete | Every operation matching Microsoft.CognitiveServices/accounts/Face/*/sessions/delete |
Microsoft.CognitiveServices/accounts/Face/*/sessions/read | Every operation matching Microsoft.CognitiveServices/accounts/Face/*/sessions/read |
Microsoft.CognitiveServices/accounts/Face/*/sessions/audit/read | Every operation matching Microsoft.CognitiveServices/accounts/Face/*/sessions/audit/read |
Assign it
Scope it as tightly as you can: a resource or resource group rather than the whole subscription.
az role assignment create \
--assignee "jane.doe@contoso.com" \
--role "Cognitive Services Face Recognizer" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Cognitive Services Face Recognizer" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, '9894cab4-e18a-44aa-828b-cb588cd6f2d7')
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '9894cab4-e18a-44aa-828b-cb588cd6f2d7')
principalId: principalId
}
}Who already has it?
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "9894cab4-e18a-44aa-828b-cb588cd6f2d7"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)Other ai-machine-learning roles
- AzureML Metrics Writer (preview) · 1 permission
- Cognitive Services Data Reader · 1 permission
- Cognitive Services Immersive Reader User · 1 permission
- Cognitive Services Usages Reader · 1 permission
- Search Index Data Reader · 1 permission
- AzureML Compute Operator · 2 permissions
- AzureML Registry User · 2 permissions
- Cognitive Services Custom Vision Contributor · 2 permissions