I was trying to update my Azure Language service to enable Custom text classification / Custom Named Entity Recognition. That feature requires a storage account. While you are supposed to be able to create the storage account when you enable the feature it didn’t work for me 🙁 (I was getting an “Invalid user storage id or storage type is not supported” error).
Problem 1: “Invalid user storage id or storage type is not supported”
As part of learning a bit about Azure AI Services, I was doing a Classify Text exercise, but since it is one of a few prior exercises I was not creating a new Language service from scratch, but rather re-using an existing one. So I needed to enable the Custom text classification…. feature.
I would click the Create a new storage account link and fill in all the details. and will click Apply on the Azure Language service Features page.
But, it would almost immediately error out with an “Invalid user storage id or storage type is not supported” message
Solution for: “Invalid user storage id or storage type is not supported”
The solution was simple: create a new Azure Storage Account and then select it from the drop-down list (or use one of the existing ones).
Problem 2: blob containers are not visible when creating a new project
Next, when I was trying to create the Custom text single label classification project I was supposed to select a container (from an already pre-filled storage account), but it wasn’t visible.
Solution for: blob containers are not visible when creating a new project
Make sure that the managed identity has the necessary permissions.
In Azure Portal go to your storage account > Access Management (IAM).
Click Add > Add role assignment
In the Role section search for and select Storage Blob Data Owner
Under the Members section, select Managed Identity and click Select members.
Then on the right select the correct subscription, Language, and the correct resource.
Select, apply, etc. until the role is assigned and you will be able to pick up the blob container in the Azure Language services wizard that is used to create a new project.
Problem 3: “A server error occurred. Please refresh the page and try again”
After going through the wizard, it looks like the project is finally created, but when you click it, the following (very informative 😕) error pops up on the right.
Solution for: “A server error occurred. Please refresh the page and try again”
Add CORS for Language service endpoint to the Azure Storage account.
In Azure Portal go to your storage account > Resource Sharing (CORS)
Fill in:
- Allowed origins: https://language.cognitive.azure.com
- Allowed methods: DELETE, GET, PUT
- Allowed headers: *
- Max age: 500
Click Save
You might need to recreate the Custom Text Classificaion project either via UI or using a REST call like the one below:
curl -X PATCH https://<YOU_LANGUAGE_SERVICE_URL_PREFIX>.cognitiveservices.azure.com/language/authoring/analyze-text/projects/<PROJECT_NAME>?api-version=2022-05-01 -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Ocp-Apim-Subscription-Key: <YOUR_LANGUAGE_SERVICE_API_KEY>' -d '{"projectName": "<PROJECT_NAME>", "language": "en-us", "projectKind": "CustomSingleLabelClassification", "description": "<PROJECT_DESCRIPTION>", "multilingual": false, "storageInputContainerName": "<BLOB_CONTAINER_NAME>"}'
P.S.
I probably could have avoided all these problems, if I had just created a new Azure language service from scratch, following the training, instead of re-using an existing Azure language service….., but then what would I be writing here instead? 🤔
Thank you for this post! It helped me in exactly the same situation 🙂
Happy it helped you Thomas!