Assigning Cognitive Services Roles in Azure AI Foundry to use Content Safety
Introduction
Azure AI Foundry comes with built-in Safety + Security
features, also known as Azure AI Services. However, you may encounter the following error message:
Your account does not have access to this resource, please contact your resource owner to get access
The Learn More link directs you to a possible fix: ensuring your account is assigned the role of Cognitive Services User for the Content Safety resource or Azure AI Services resource you’re using. Unfortunately, it does not provide a step-by-step guide on how to achieve this.
I was fortunate to watch a session by Divya Akula: Building Trustworthy AI: Ensuring Responsible AI with Data Groundedness & Finetuning, where she demonstrated how to ensure the user has the roles Cognitive Services OpenAI Contributor
and Cognitive Services OpenAI User
are required in addition to Cognitive Services User
role suggested in the error resolution to allow the use of groundedness tests within Azure AI Foundry.
- Cognitive Services OpenAI Contributor: Full access, including the ability to fine-tune, deploy, and generate text.
- Cognitive Services OpenAI User: Ability to view files, models, and deployments. Readers can’t make any changes but can perform inference and create images.
- Cognitive Services User: Lets you read and list keys of Cognitive Services.
Similar safety content features can be accessed from the Azure Content Safety
resource by accessing the Content Safety Studio
. If the right permissions are not applied to the Azure AI Services
resource, the Run Test
option will be greyed out.
Step-by-Step Guide to Grant Permission to Azure AI Services Resource linked to Azure AI Foundry
- Navigate to Azure Portal: Open the Azure Portal.
- Navigate to the Azure AI Foundry Instance: Locate your Azure AI Foundry instance.
- Select the Azure AI Services Resource: Click on the resource of type
Azure AI Services
. - Access Control (IAM): Click on the Access Control (IAM) option.
- View My Access: Click on
View my access
and check the results. If the rolesCognitive Services OpenAI User
andCognitive Services OpenAI Contributor
are missing, proceed to the next step. - Add Role Assignment: Click on
Add
>Add role assignment
. - Search for Cognitive Services OpenAI Role: Search for the
Cognitive Services OpenAI
role. - Select Cognitive Services OpenAI Contributor Role: Select the
Cognitive Services OpenAI Contributor
role and click onNext
. - Select Members: Click on
Select members
. - Review and Assign: Click on the
Review + assign
button to finish the role assignment. - Repeat for Cognitive Services OpenAI User Role: Repeat steps 6 to 10 to assign the user to the
Cognitive Services OpenAI User
role. - Repeat for Cognitive Services User Role: Repeat steps 6 to 10 to assign the user to the
Cognitive Services User
role. - Verify Access: Click on
View my access
and check the results to ensure the rolesCognitive Services OpenAI User
andCognitive Services OpenAI Contributor
are present. - Verify in Azure AI Foundry Studio: Navigate back to the
Azure AI Foundry
studio, click onSafety + Security
, and verify that theAzure AI Services
resource appears under ‘Try it out`.
By following these steps, you can ensure that your deployment is successful and ready to test within Azure Ai Foundry
Test Safety + security features
Once the roles have been updated, the different Content Safety features can be tested
Moderate Text Content
Groundedness detection
Azure Content Safety Studio
Similar Safety content features can be accessed from Azure Content Safety
resource by accessing the Content Safety Studio
. If right permissions are not applied to the Azure AI Services
resource, the Run Test
is greyed out.
Step by Step to grant permission to resource of type Azure AI Services
within Content Safety Studio
can be found from content safety lab
References
- Building Trustworthy AI: Ensuring Responsible AI with Data Groundedness & Finetuning
- Learn More About Azure AI Studio error messages
- What is Azure AI Foundry?
- Explore Content Safety in Azure AI Foundry
- Explore Azure AI Services