Azure Custom Vision API predict_image invalid status code - azure

I am trying to connect my app to Azure's Custom Vision API using the predict_image method of the predictor object(as seen in their tutorial). However it is giving me the following error: "Operation returned an invalid status code 'Not Found' ".
Screenshots Attached: Error Message Actual Code

Is there a default iteration set for the project? If the prediction endpoint is called without specifying an iteration id then that implicitly falls back to using the default iteration. But if there is no default iteration set then the service will respond with a 404. There should be more detail available in the response body.

Related

Azure Function Timer Trigger & API management - Manual execution returns 404

I have a function app with:
a few functions triggered by a Timer Trigger
and some triggered by the HTTP Trigger.
I have also an Azure API Management service set up for the function app, where the HTTP Triggered functions have their endpoints defined.
I am trying to trigger one of my timer triggered functions manually as per the guide here https://learn.microsoft.com/en-us/azure/azure-functions/functions-manually-run-non-http
I am however getting a 404 result in Postman, despite the seemingly correct URL and x-functions-key.
The function:
The key:
The request:
I also noticed that:
if I don't include the x-functions-key header, then I get 401 Unauthorized result
and if I include an incorrect key, then I get 403 Forbidden.
Could it be related to the API management service being set up for the function app?
How can I troubleshoot this further?
I have managed to solve it.
It turns out that Azure Functions timer trigger requires six parts cron expression (I was only aware of the five part style)
Without that, it does not work - sadly this is not easily noticeable in the UI.
I have realized that by investigating Application Insights logs:
The function page shows that everything is fine:
Changing the CRON format has fixed the 404 issue and I started getting 202 Accepted response.
As a bonus note, I have to add:
Even though the response was 202 Accepted, the triggering didn't work correctly, because my function return type was Task<IActionResult> which is not accepted for timer triggered functions.
Again, only ApplicationInsights showed that anything is wrong:
The 'MonkeyUserRandom' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'MonkeyUserRandom'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter '$return' to type IActionResult&. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
That's a bonus tip for a 'manual triggering of non-http function does not work'.
I test it in my side, it works fine. Please refer to the below screenshot:
Please check if you request https://xxx.azurewebsites.net/admin/functions/TimerTrigger1 but not https://xxx.azurewebsites.net/admin/functions/TimerTrigger. Note it's "TimerTrigger1".
I requst with ..../TimerTrigger at first test because the document shows us QueueTrigger, and it response 404.

Dialogflow Webhook call failed. Error: [ResourceName error] Path '' does not match template

I am using Dialogflow ES and once I got the webhook setup, I haven't been having issues. But after a few months, I just started getting a random error. It seems to be inconsistent as in sometimes I get it for a specific web call and other times it works fine. This is from the Raw API response:
"webhookStatus": {
"code": 3,
"message": "Webhook call failed. Error: [ResourceName error] Path '' does not match template 'projects/{project_id=*}/locations/{location_id=*}/agent/environments/{environment_id=*}/users/{user_id=*}/sessions/{session_id=*}/contexts/{context_id=*}'.."
}
The webhook is in GCP Functions in the same project. I have a simple "ping" function in the same agent that calls the webhook. That works properly and pings the function, records some notes in the function log (so I know the function is being called), and returns a response fine, so I know the webhook is connected and working for other intents in the same agent before and after I get the error above.
Other intents in the same agent work (and this one WAS working), but I get this error now. I also tried recreating the intent and I get the same behavior.
The project is linked to a billing account and I have been getting charged for it, so I don't think it is an issue with being on a trial or otherwise. Though the Dialogflow itself is in "trial", but the linked webhook function is billed.
Where can I find what this error means or where to look to resolve it?
After looking at this with fresh eyes, I found out what was happening.
The issue was a mal-formed output context. I was returning the bad output context sometimes (which explained why sometimes it worked and sometimes it didn't). Specifically, I was returning the parameters directly into the output context without the output context 'name' or 'parameters'. Everything looked like it was working and I didn't get any other errors, but apparently, when Dialogflow receives a bad web response, it generates the unhelpful error above.

Internal server error Azure Functions with spfx react-search-refiners

I am deploying react-search-refiner with LUIS and Azure Functions https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-search-refiners/functions
Now, I passed through various problems and finally confirmed the communication from SPFx to Function App.
My problem is when searching after deploying according to the procedure, an internal Sever error occurs after Status Code 200. And nothing error message returns.
POST https://.azurewebsites.net/api/enhanceQuery 500
(Internal Server Error) Message: [NlpService.enhanceSearchQuery()]:
Error: '{"error":{"type":"function_error","message":"Error"}}' for url
'https://.azurewebsites.net/api/enhanceQuery'
On the application log, Function App is executed and succeeded return code 0. So, it doesn't return error code.
My checking is below that does not contains in README. Would someone help me?
Set local.settings.json to environment variable.
Change authlevel "function" to "anonymous" for simplization.
Local debug is succeeded.
POSTMAN didn't check because rawQuery from HttpRequest might be
included large keys and values.

Create PeerConnection exception: Failed to construct 'RTCPeerConnection': Malformed RTCIceServer

I am using appRTC to make demo app. I have setup following things successfully but got stack with JSON format that return in response of Turn-server API.
Use SSL for secure connect to make it work on Google Chrome (Done)
Implement custom WebSockets (Done)
Develop custom API for TurnServer (Done)
I am getting following error in console log.
Create PeerConnection exception: Failed to construct 'RTCPeerConnection': Malformed RTCIceServer
Failed to start signaling: Cannot read property 'addStream' of null
I have tried following responses as ice server object
Current object:
{"iceServers":[{"urls":["stun:stun.l.google.com:19302"]},{"urls":["turn:domain.com:8080?transport=udp","turn:domain.com:8080?transport=tcp","turn:domain.com:8080"],"username":"test","credential":"password"}],"lifetimeDuration":"86400s","blockStatus":"NOT_BLOCKED","iceTransportPolicy":"all"}
Have also tried:
[{"urls":["stun:stun.l.google.com:19302"]},{"urls":["turn:domain.com:8080?transport=udp","turn:domain.com:8080?transport=tcp","turn:domain.com:8080"],"username":"test","credential":"password"}]
and also tried this one:
[{"urls":["turn:domain.com:8080?transport=udp","turn:domain.com:8080?transport=tcp","turn:domain.com:8080"],"username":"test","credential":"password"}]
You have a typo here:
[{"urls":["stun:stun.l.google.com:19302"}
trying to close urls without closing the array.
This should be
[{"urls":["stun:stun.l.google.com:19302"]}
This doesn't result in an error about malformed RTCIceServer though.
Based on your comment it seems to be a result of calling
new RTCPeerConnection({"iceServers":[{}]})
-- an empty object is not a valid RTCIceServer.
I would also recommend not passing
"lifetimeDuration":"86400s","blockStatus":"NOT_BLOCKED"
to the RTCPeerConnection as it doesn't know about these.

BadRequestObjectResult does not return detailed error message to the client

I have a Azure function with an HTTP trigger. It produces a 400 response when an input value is not specified:
if (string.IsNullOrEmpty(artistName))
{
return new BadRequestObjectResult("Artist name not specified.");
}
When the function is running locally (func host start) and the API is called incorrectly (I am using curl -X POST ...), the above error message is shown.
When deployed to Azure and called in a similar way - instead of the detailed error message - only Bad Request is returned.
Why?
How can I change this behaviour?
It's a known issue for function runtime 2.0.11888 that HttpTrigger does not return response content properly.
If you want to solve this, go to Application settings, pin your FUNCTIONS_EXTENSION_VERSION to previous runtime 2.0.11857-alpha until new version is released.
See Azure Functions Runtime 2.0.11888 Preview.
Update
This issue has already been fixed from 2.0.11933.

Resources