presetOverride when creating Azure Media Services v3 Job - azure

When creating an Azure Media Services Job via the REST API, I cannot set a presetOverrides property on the JobOutputAsset as defined in the documentation: https://learn.microsoft.com/en-us/rest/api/media/jobs/create#joboutputasset
My request body is:
{
"properties": {
"input": {
"#odata.type": "#Microsoft.Media.JobInputAsset",
"assetName": "inputAsset"
},
"outputs": [
{
"#odata.type": "#Microsoft.Media.JobOutputAsset",
"assetName": "outputAsset",
"label": "en-US",
"presetOverride": {
"#odata.type": "#Microsoft.Media.AudioAnalyzerPreset",
"audioLanguage": "en-US",
"mode": "Basic"
}
}
],
"priority" : "Normal"
}
}
The error message thrown is:
{
"error": {
"code": "InvalidResource",
"message": "The property 'presetOverride' does not exist on type 'Microsoft.Media.JobOutputAsset'. Make sure to only use property names that are defined by the type."
}
}
When removing the presetOverride data, everything works as expected. The official documentation clearly states that the Microsoft.Media.JobOutputAsset does have a presetOverride property though. What am I doing wrong?

It is important to select the correct API version when communicating with the Azure Media Services REST API.
In this case, api version 2020-05-01 from the Azure Media Services Postman examples was used. But the presetOverride option is only available starting with version 2021-06-01.
Setting api-version=2021-06-01 as a GET parameter enables Preset Overrides.

couple of concerns here Rene. I would not recommend using the raw REST API directly for any Azure services. Reason being is that there are a lot of built-in retry scenarios and retry policies that are already rolled into the client SDKs. We've had many customers try to roll their own REST API library but run into massive issues in production because they failed to read up on how to handle and write their own custom retry policy code.
Unless you are really familiar with rolling your own retry policies and how Azure Resource Management gateway works, try to avoid it and just use the official client SDKs - see here - https://learn.microsoft.com/en-us/azure/architecture/best-practices/retry-service-specific#general-rest-and-retry-guidelines
Now, to answer your specific question - try using my sample here in .NET and see if it answers your question.
https://github.com/Azure-Samples/media-services-v3-dotnet/blob/3ab85647cbadd2b868aadf175afdede67b40b2fd/AudioAnalytics/AudioAnalyzer/Program.cs#L129
I can also provide a working sample of this in Node.js/Typescript in this repo if you like. It is using the latest 10.0.0 release of our Javascript SDK.
I'm working on samples in this repo today - https://github.com/Azure-Samples/media-services-v3-node-tutorials
UPDATE: Added basic audio in Typescript sample.
https://github.com/Azure-Samples/media-services-v3-node-tutorials/blob/main/AudioAnalytics/index.ts
Shows how to use the preset override per job.

Related

AzureMfaProtocolProvider - UserMessageIfBadReputation

As part of MFA in a custom policy we're using AzureMfaProtocolProvider to send one-time codes via SMS.
For some users we're seeing the following error:
{
"Key": "Exception",
"Value": {
"Kind": "Handled",
"HResult": "80131500",
"Message": "ErrorCodes: UserMessageIfBadReputation",
"Data": {
"IsPolicySpecificError": false
}
}
}
I can't seem to find any information regarding this error in the docs.
How can I figure out what triggers this and why it was triggered for that specific user?
PhoneReputation service is integrated with Azure MFA to provide a near-real time determination which tracks tracks the usage and reputation of phone numbers as they are used across various Microsoft services.
Any particular browser user agent having the issue, few days back i worked on a similar issue where latest version of firefox reported this kind of issue reference: https://learn.microsoft.com/en-us/answers/questions/1090554/azure-b2c-unblock-phone-number.html?childToView=1097185#comment-1097185
Also where are the users located who reported this error ? any specific region/country code users reported this issue.

I'm trying to receive a webhook from an Autodesk Forge workflow.transition event but they aren't firing

I've been experimenting with the Fusion Lifecycle webhooks in Forge and have been successful using the item created/updated events but the workflow transition webhooks aren't firing.
The webhooks are created in Forge according to the Docs, as you can see below, but none of the transitions performed in the workspace will trigger the call.
They were created using a three-legged token associated with a Fusion Lifecycle user that has the proper workflow permissions on the workspace.
The following JSON excerpt is the workflow. transition webhook as returned from developer.api.autodesk.com/webhooks/v1/hooks endpoint on Forge showing it was indeed created.
​
{
"hookId": "909fd040-4e34-11ea-a842-651c9013b5e8",
"tenant": "TENANTNAMEREMOVED4SO",
"callbackUrl": "callbackurl removed for SO",
"createdBy": "46FGNL6DBN6D",
"event": "workflow.transition",
"createdDate": "2020-02-13T07:43:45.988+0000",
"system": "adsk.flc.production",
"creatorType": "O2User",
"status": "active",
"scope": {
"workflow.transition": "urn:adsk.plm:tenant.workspace.workflow.transition:TENANTNAMEREMOVED4SO.119.1.765"
},
"hookAttribute": {
"creator": "D3 Forge Playground",
"notification": {
"class": "alert-danger",
"system": "flc"
}
},
"urn": "urn:adsk.webhooks:events.hook:909fd040-4e34-11ea-a842-651c9013b5e8",
"__self__": "/systems/adsk.flc.production/events/workflow.transition/hooks/909fd040-4e34-11ea-a842-651c9013b5e8"
}
I've pushed the workflow through the transition events numerous times and no webhook is being fired and no failed requests on our webhook receiving server either. if I mimic the payload for the workflow. transition event and post it to our endpoint, it is received as expected.
I have yet to see a live example of the workflow. transition webhook being fired and can't find any sample code from Autodesk using them. Not sure the service is even working as expected at this point even though the item.created and item.updated webhook events seem to work fine.
Has anyone successfully received a workflow. transition webhook from Autodesk Forge? If yes, could you provide some guidance on how?
Seems to be working fine on my end in a Production tenant. This is the payload I used to create the webhook:
{
"callbackUrl": "https://webhook.site/SOME_ID",
"scope": {
"workflow.transition": "urn:adsk.plm:tenant.workspace.workflow.transition:TENANT.107.1.421"
}
}
Does it look like the payload you used when creating the hook?
Greg, any chance you can try to trigger it again, and send me the date/time stamp with tenant name via a private message? I just tried it again in my Production tenant, and it seems to be working just fine when I perform the operation from both a v3 API call, and the UI. Feel free to file a support case if you want, too, and let me know the case number. I'd like to help you out here in understanding what's going on, because overall it looks OK from your side.

Azure Search, listAdminKeys, ARM output error (does not support http method 'POST')

I am using this bit of code as an output object in my ARM template,
"[listAdminKeys(variables('searchServiceId'), '2015-08-19').PrimaryKey]"
Full text sample of the output section:
"outputs": {
"SearchServiceAdminKey": {
"type": "string",
"value": "[listAdminKeys(variables('searchServiceId'), '2015-08-19').PrimaryKey]"
},
"SearchServiceQueryKey": {
"type": "string",
"value": "[listQueryKeys(variables('searchServiceId'), '2015-08-19')[0]]"
}
I receive the following error during deployment (unfortunately, any error means the template deployment skips output section):
"The requested resource does not support http method 'POST'."
Checking the browser behavior seems to validate the error is related to the function (and, it using POST).
listAdminKeys using POST
How might I avoid this error and retrieve the AzureSearch admin key in the output?
Update: the goal of doing this is to gather all the relevant bits of information to plug into other scripts (.ps1) as parameters, since those resources are provisioned by this template. Would save someone from digging through the portal to copy/paste.
Thank you
You error comes from listQueryKeys, not admin keys.
https://learn.microsoft.com/en-us/rest/api/searchmanagement/adminkeys/get
https://learn.microsoft.com/en-us/rest/api/searchmanagement/querykeys/listbysearchservice
you wont be able to retrive those in the arm template, it can only "emulate" POST calls, not GET
With the latest API version, it's possible to get the query key using this:
"SearchServiceQueryKey": {
"type": "string",
"value": "[listQueryKeys(variables('searchServiceId'), '2020-06-30').value[0].key]"
}

Youtube API v3, topicId recovery

Youtube API v3 enables developers to retrieve specific information regarding a particular video, among the returned data a part called topicDetails can be requested as per the following example:
Request:
https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&part=snippet,topicDetails
Response:
{
"kind": "youtube#videoListResponse",
"etag": "\"r3ahjFekUqNiL0By9B5wQ2uTZHM/i4Bt9XfY8YZ1ctSlg8BWcLD8HFQ\"",
"items": [
{
"id": "7lCDEYXw3mM",
"kind": "youtube#video",
"etag": "\"r3ahjFekUqNiL0By9B5wQ2uTZHM/hYUGsnkhqATV4OXNG43HIObqlyw\"",
"snippet": {
"title": "Google I/O 101: Q&A On Using Google APIs",
[ some properties have been omitted here ],
"categoryId": "28"
},
"topicDetails": {
"topicIds": [
"/m/045c7b",
"/m/0z5n",
"/m/04136kj"
]
}
}
]
}
The topicIds field comes machine encoded and topic information can be retrieved through the Freebase API (using this identifiers) which is being deprecated. I was unable to locate any update on YouTube documentation regarding the impact of freebase API deprecation and as I manage a large node.js code base that relies heavily on YouTube topicDetails I would like to ask if there is any known programatic alternative to recover topic information from stable sources other than Freebase?
As part of the Freebase retirement announcement, Google said that they would be offering a couple of new Knowledge Graph APIs and that there would be a 3 month overlap between the availability of these new services and the shutdown of Freebase.
Presumably Google services like YouTube which depend on Freebase MIDs will transition to these new services will transition to the new API (perhaps with unchanged identifiers), but not much is known concretely because a) Google is overdue with the new APIs and b) they haven't said anything else about the transition process.
UPDATE: The Google Knowledge Graph Search API became available in December 2015 and provides support for looking things up by KG ID (which is the same as the old Freebase ID used by YouTube).

gcloud pubsub on node.js - how to set IAM policy

Could someone walk me through setting an IAM policy in node.js using gcloud's pubsub?
I've looked through this page: https://developers.google.com/gmail/api/guides/push
And based on what I understood, I've saved this file as a .json:
POST "https://pubsub.googleapis.com/v1beta2/projects/gmail_push_project/topics/gmail_push_topic:setIamPolicy"
Content-type: application/json
{
"policy": {
"bindings": [{
"role": "roles/pubsub.publisher",
"members": ["serviceAccount:gmail-api-push#system.gserviceaccount.com"],
}],
}
}
And then, after creating a topic and subscribing to it, I've made this call in my .js script: pubsub.projects.topics.setIamPolicy('pubsub_policy.json');, however, I'm getting an error cannot read property "topics" of undefined.
Thanks for your help!
As of v0.19.0 IAM methods are supported, you can find the documentation for them on the official gcloud-node docs.
Unfortunately this is not supported yet. However, we're preparing to launch such API calls with a new set of documentation shortly (in weeks). Also all the APIs are public now so that gcloud-node developers can actually start implementing, so I filed an issue at:
https://github.com/GoogleCloudPlatform/gcloud-node/issues/758
As a short-term workaround, you can use the API explorer, or if you need to do it dynamically, you should be able to use the following library:
https://developers.google.com/api-client-library/javascript/?hl=en

Resources