Today, I started getting the error: Rejected by Microsoft Translator: TranslateApiExceptionMethod: TranslateArray()Message: The Azure Market Place Translator Subscription associated with the request credentials has zero balance.message id=1116.V2_Rest.TranslateArray.4182143E
Some digging revealed https://datamarket.azure.com/dataset/bing/microsofttranslator the Microsoft data market is closed, and has been moved to https://portal.azure.com/#create/Microsoft.CognitiveServices/apitype/Tex...
I've created new API credentials on the Azure Portal, but the two-key system does not seem to mesh with the TMGMT "Client ID" and "Client Secret" -- is there a way to use the new Azure Portal "Translate Text" API credentials with TMGMT?
Comment | File | Size | Author |
---|---|---|---|
#88 | 2840876-88.patch | 37.98 KB | bceyssens |
#86 | screenshot-wangjueju.cn-2019.02.17-00-16-24.png | 46.77 KB | jjwfcd |
#84 | 2840876-84.patch | 48.2 KB | Peacog |
#84 | interdiff-2840876-81-84.txt | 498 bytes | Peacog |
#81 | 2840876-81.patch | 48.32 KB | heddn |
|
Comments
Comment #2
firfin CreditAttribution: firfin commentedExperincing the same issue. To elaborate: In the Azure Portal, go to 'All resources' somewhere in this list you can click on your Cognitive Services account for the current project. Under the 'resource management' vertical tab you can find 'keys' section.
They you can find three values:
- Account name
- KEY 1
- KEY 2
Haven't found a way to get these working yet. Which I think makes sense probably, I can imagine there is a completely new auth system in place now. Probably API changed too.
Comment #3
firfin CreditAttribution: firfin commentedDatamarket/translator will stop working end of april. See https://translatorbusiness.uservoice.com/knowledgebase/articles/1078534-...
This module will probably stop functioning completely at that point, therefore setting priority to critical.
According to that page:
Comment #4
firfin CreditAttribution: firfin commentedComment #5
heddnThere is a replacement in Azure. We might just need to updated some endpoints and use a single key, instead of the combo key/secret. Anyone up to rolling a patch. See https://cognitive.uservoice.com/knowledgebase/articles/1128340-announcem...
New endpoint:
https://api.cognitive.microsoft.com/sts/v1.0/issueToken
Comment #6
ccrawford91 CreditAttribution: ccrawford91 at SpinSpire commentedI've patched the module to use the new endpoint and API key.
Comment #7
heddnDo we need an update path? Me thinks yes.
Comment #8
heddnOr maybe not... since the old api keys are going to be non-functional. Moving to NR for now.
Comment #9
devwebcms CreditAttribution: devwebcms commentedI'm receiving the error message "The "Client ID" or "Client secret" is not valid." Please let me know if the patch (tmgmt_microsoft-azure-congnitive-api-update-2840876-6.patch) is included with 7.x-1.x-dev or 7.x-1.0-alpha2 or if it has to be applied. Thank you very much.
Comment #10
jollysolutionsPlease apply ASAP
Comment #11
heddnNeeds an update path. Marking as NW. Or a @TODO and an opened issue to add an update path.
Comment #12
jollysolutionsWhat update path? They are completely different systems with different keys.
Comment #13
BerdirAgreed that an upgrade path is not possible.
I worked a bit on this to fix/update tests and also quite a bit of cleanup, the code was getting pretty strange with 3 different api methods implemented but everything except the new API is no longer working, so there's no point in trying to support them still.
Comment #15
miro_dietikerA commit without status change?
Does this need 8.x care?
Comment #16
BerdirLooks like my comment got lost.
Comment #17
paulmartin84 CreditAttribution: paulmartin84 at Inviqa commentedThis gets it working in d8, I haven't had time to adjust the tests yet.
Comment #18
GrimreaperHello,
I wanted to test tmgmt with Microsoft, so I applied patch from comment 17. It fixed the issue.
Thanks.
Comment #19
BerdirComment #21
sealionking CreditAttribution: sealionking commentedpatched the #17 patch
but
Client error: `GET http://api.microsofttranslator.com/v2/Http.svc/GetLanguagesForTranslate` resulted in a `400 Bad Request` response:
Argument Exception
Method: GetLanguagesForTranslate()
Parameter:
Message: The API ty (truncated...)
Comment #22
k_zoltan CreditAttribution: k_zoltan at Cylex commentedCheckout the back-port of the #17 patch for he 7.x version #2962022: Microsoft data market is closed, Moving to Microsoft Azure CognitiveServices
Comment #23
heddnLet's see if this fixes the tests.
Comment #24
heddnComment #26
heddnHmm, this seems to use v2, which is already deprecated. If we are going to land this, wouldn't it be better to use V3? https://docs.microsoft.com/en-us/azure/cognitive-services/translator/ref...
Here's a sample example in PHP:
https://github.com/MicrosoftTranslator/Text-Translation-API-V3-PHP/blob/...
Comment #27
heddnThere's still some test failures, but less.
Comment #28
heddnManual testing, this worked. Not to get all the automated tests working.
Comment #30
heddnTests passed on local.
Comment #32
heddnFix up a few more CS things. Tried to reproduce the bugs, but not sure I was able to. I tested locally against 8.5 and 8.6, just to be sure it wasn't a core thing.
Comment #34
heddnSome debugging added to figure out what is displayed on the testbot.
Comment #36
heddnComment #37
heddnComment #40
heddnComment #42
heddnOK, let's forget simpletest and try a proper functional test. This one also passes on local, but so did the simpletest. Fingers crossed.
For reviewers, the test is basically a straight port to functional w/ as little changed as possible.
Comment #44
heddnCode standards + possibly we are facing concurrency? Let's try that.
Comment #46
heddndrupal_static? Let's see.
Comment #48
heddnI think tests are currently failing. Let's see.
Comment #49
heddnComment #51
heddnI give up. Tests pass just fine on local. I was hoping I could get this to pass tests, but I need to move on. I'll just keep using the patch.
Comment #52
mpp CreditAttribution: mpp at AmeXio for District09 commentedThanks for the patch and your perseverance :-)
Why are we testing PHP 5.5, it's deprecated. Let's see what 5.6 and 7.2 make of it.
Comment #53
mpp CreditAttribution: mpp at AmeXio for District09 commentedCannot get languages from the translator: Server error: `GET http://php-apache-jenkins-drupal8-contrib-patches-29014/subdirectory/tmg...` resulted in a `500 Internal Server Error` response: 500 Internal Server Error < (truncated...)
The "Azure API Key" is not valid.
Have a look at the test output on https://dispatcher.drupalci.org/job/drupal8_contrib_patches/29014/artifa...
Comment #54
heddnMore details hopefully with these test additions.
Comment #56
heddnComment #58
heddnComment #60
mpp CreditAttribution: mpp at AmeXio for District09 commentedYou're getting there!
Comment #61
heddnDifferent approach to things. Big interdiff.
Comment #62
heddnCleaned up things I spotted.
Comment #64
heddnComment #66
heddnComment #68
heddnComment #70
heddnComment #72
heddnFor some reason, the following returns empty string on the testbot. Any suggestions, would be much appreciated.
Comment #75
heddnThe most simple test possible.
Comment #77
heddnToo slimmed down.
Comment #79
heddnComment #81
heddnSo, after consulting with mixologic and berdir in slack, we figured out it was an issue with how run-tests.sh does things vs phpunit. Its something to do with `BROWSERTEST_OUTPUT_DIRECTORY` being set in run-tests.sh as an env var when the test is executed.
Ignore all the chatter in between 68 and 81. It was just trying to pin down what the issue was. This should now pass.
Comment #82
heddnYeah. Tests pass green.
Comment #83
mpp CreditAttribution: mpp commentedWhoohoo!!! @heddn, you win a gold medal for this one, heck I'd give you a diamond one if I could :-)
Big thanks to mixologic and berdir as well.
Comment #84
Peacog CreditAttribution: Peacog as a volunteer commentedThanks for the patch! I've tweaked it slightly to change the max supported characters to 5000 as per the current API specification.
Comment #86
jjwfcd CreditAttribution: jjwfcd commented3ks you guys
the patch applied,
And need help to make it work when a node body exceeds 5000 characters
Comment #87
jacktonkin CreditAttribution: jacktonkin at ISSUP commentedI think #84 failed because TMGMT was broken on 8.7 at the time. Setting back to needs review.
Comment #88
bceyssensEven with patch #84, we couldn't connect the provider. Apparently we need to use a regional service URL: https://docs.microsoft.com/azure/cognitive-services/translator/reference....
Comment #90
heddnEveryone, thanks for your contributions.