In my previous question Azure Media Services Encoding Job Callback to URL it is suggested that Azure Media Services "Notifications features which supports WebHooks" can be made to callback to a URL when an encoding job is completed. I'm having a bit of trouble getting this to work.
Steps taken:
- Created and tested an Azure function which is capable of sending a POST request to my arbitrary callback URL.
- Used REST API to create a NotificationEndPoint and retrieved the Id (which is something like
nb:nepid:UUID:e9203dcb-b6a0-4b44-3cc6-69c4a573bb8d). - Now trying to get the notification added to my encoding job. My JSON payload for the Job create REST API call is as follows:
{
"Name": "TestJob",
"InputMediaAssets" : [
{
"__metadata" : {"uri" : "https://media.windows.net/api/AssetsAssets('nb%3Acid%3AUUID%3A3679cd1f-74ba-4374-8d4b-8c26feba4e1d')"}
}
],
"JobNotificationSubscriptions": [
{
"NotificationEndPointId": "nb:nepid:UUID:e9203dcb-b6a0-4b44-3cc6-69c4a573bb8d",
"TargetJobState": 1
}
],
"Tasks": [
{
"Configuration": "Adaptive Streaming",
"MediaProcessorId": "nb:mpid:UUID:fa4df505-d219-42b0-bc17-a481c1441e56",
"TaskBody": "<?xml version=\"1.0\" encoding=\"utf-8\"?><taskBody><inputAsset>JobInputAsset(0)</inputAsset><outputAsset>JobOutputAsset(0)</outputAsset></taskBody>"
}
]
}
That works without the JobNotificationSubscriptions section but with it, I simply get the response:
"error": {
"code": "",
"message": {
"lang": "en-US",
"value": "An error occurred while processing this request."
}
}
How can I get my notification working with my job?