Azure function - jak za pomocą curl zrobić request?

0

Cześć,
Jestem kompletnie zielony w tej tematyce..
https://docs.microsoft.com/en-us/azure/developer/python/tutorial-vs-code-serverless-python-06
Mam:

Http Functions:
         DigitsOfPi: [GET] http://localhost:7071/api/DigitsOfPi
         HttpExample: [GET,POST] http://localhost:7071/api/HttpExample

Utknąłem na punkcie:
In a browser, or from curl, make a request to http://localhost:7071/api/DigitsOfPi?digits=125 and observe the output. (You might notice that the code's algorithm isn't entirely accurate, but we'll leave the improvements to you!) Stop the debugger when you're finished.

PS C:\Users\PanKomputer\Lingaro\HttpExample> curl http://localhost:7071/api/DigitsOfPi -d digits=12345
0

I co jaki jest wynik?

0

@lion137:

PS C:\Users\PanKomputer\Lingaro\HttpExample> curl --header "Content-Type: application/json" --request POST --data {"""name""":"""Visual Studio Code"""} http://localhost:7071/api/HttpExample
At line:1 char:81
+ ... n" --request POST --data {"""name""":"""Visual Studio Code"""} http:/ ...
+                                         ~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token ':"""Visual Studio Code"""' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

Ale juz znalazlem inny sposob, po prostu przez przegladarke:

http://localhost:7071/api/DigitsOfPi?digits=125
0

Utknąłem w innym miejscu. A mianowicie w "Add a storage binding for Azure Functions in Python". Problemem jest plik: local.settings.json oraz "AzureWebJobsStorage". Jeżeli uzyje funkcji: Azure Functions: Download Remote Settings i ustawiony zostanie wartość: "AzureWebJobsStorage": taka jak w konfiguracji na portal.azure to requesty kończą się timeoutem.

[2020-12-13T0803.172Z] Starting worker process failed
[2020-12-13T0803.179Z] The operation has timed out.
[2020-12-13T0803.210Z] Starting worker process failed
[2020-12-13T0803.216Z] The operation has timed out.
[2020-12-13T0803.234Z] Exceeded language worker restart retry count for runtime:python. Shutting down and proactively recycling the Functions Host to recover

1 użytkowników online, w tym zalogowanych: 0, gości: 1