question

TolgaE-9929 avatar image
0 Votes"
TolgaE-9929 asked ·

Error while trying to import an custom vision project

Hi,

I have been using this documentation: https://docs.microsoft.com/nl-nl/azure/cognitive-services/custom-vision-service/copy-move-projects to move my project from one Azure Account to another.

After succesfully retrieving the information needed to import the project I get the following error:

{
"code": "BadRequestInvalidImportToken",
"message": "Import token was not valid."
}

I have tried to import the project via Postman, cURL and via the microsoft site itself.

I am pretty certain the token is valid and have no idea why the import does not work. It also does not work when I enter the subscription key and endpoint of the source account. I still get the same error.

the POST (edited for sensitive information) I try to do is:

https://xxxxxxx.cognitiveservices.azure.com/customvision/v3.3/Training/projects/import?token=https://irisprodwetraining.blob.core.windows.net/prjexp-xxxxxxxxx/project-export-info?sv=2019-12-12&se=2021-03-10T11%3A53%3A16Z&sr=b&sp=r&sig=%xxxxxxxxxxxx%3D

azure-custom-vision
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

romungi-MSFT avatar image
1 Vote"
romungi-MSFT answered ·

@TolgaE-9929 I have tried to import a project using the steps from the document with curl and it seems to work as expected.

76321-image.png

I think the reason for your error could be the SAS token might be expired. If you could copy your token and paste it in a browser window it should download a project info file, if it fails though a new token might be required.


image.png (115.0 KiB)
· 8 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi. Thanks for your answer.

When putting the url of the token it downloads a project info file which is valid and contains information about the project, but still getting the 'import token was not valid' error even with curl.

0 Votes 0 ·

@TolgaE-9929 Thanks for checking. If the file is being downloaded then I think the token is valid and the issue might be with the request that might be getting corrupted. Do you mind pasting the command without your token and keys so I can review if there is any issue?

0 Votes 0 ·

Hi. I've got it working. I changed the endpoint from my own specific endpoint to https://westeurope.api.cognitive.microsoft.com/customvision/v3.3/Training/projects/import and now it works!

0 Votes 0 ·
Show more comments