Hello chaps.
I’ve got a c# azure function. Can I use this to invoke the prefect cloud to schedule a job? Or rather invoke a job?
b
Bianca Hoch
04/13/2023, 5:20 PM
Hello! You could make an an API call to Prefect from your C# Azure Function. It would look something like this:
1. Retrieve an API key from Prefect, which is needed to authenticate your requests.
2. Include a reference to
System.Net.Http
in your C# Azure Function for making HTTP requests.
3. Instantiate an
HttpClient
, and set the required headers, with the API key as a Bearer token.
4. Create a JSON string representing a POST request to create a new flow run (use the flow's ID).
5. Send the POST request to the Prefect REST API and verify the response.
You can read the REST API documentation at https://app.prefect.cloud/api/docs.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.