Azure function app to pull from queue and perform http requests
Budget: £20 – £250 GBP
Background
We have developed a WordPress/WooCommerce plugin which allows us to create/update and delete products, categories, xxx, yyy using a RESTful API. In addition when an order is created it will webhook that order information back to our system. We have a postman file with all the example calls.
What we require is two azure function apps and an example console app, all written in DotNET 6 / c#10. It is expected to have unit test coverage over all logic.
Function App 1 & Console App
This function app will use an Azure Queue (standard Table Storage queue). The console App will put a message onto the queue with a body similar to:
{
TenancyId: GUID,
DateTime: Time of entry into the queue
Action: Create/Update/Delete (as an ENUM),
Type: Product, Categories, xxx, yyy (as an ENUM),
Data: DYNAMIC
}
The above will act as an envelope. Using the postman collection as the examples, you should create a model for each of the types and then within the function app you should pull from the queue to process. You should deserialise the data to the correct model based on the action and type.
With this information you should then make the external http call to WooCommerce (POST/PATCH/DELETE) to match what the inbound message said.
If a failure occurs on the call to WooCommerce the message should not be successful. It should go back into the queue with a lock for 5 min (do not process again for 5 minutes). It should retry 500 times before going into dead letter.
Application insights should be used to log errors with stack trace on an exception. For http failures calling out we should log the status codes. TenancyId should always be in the log along with the action and the type.
Function App 2
There should be a second function app, this function app should be a http trigger. Using the example from WooCommerce (we have a demo environment) the function app should be invoked using the webhook call from our plugin. With this the function app, we must deserialise the request into a c# model.
We must then enter that into the same queue as function app 1. However this time it will be with Action: Create and Type: Order.
You should return a success to the caller if it is successfully added to the queue. If it is not added to the queue successfully you should return a 500. If the model cannot be deserialised it should return a 400.
You should then modify function app 1 to be able to process this. This will do two things:
1. Call our API (details provided later) to lookup the customer.
a. If the customer is not found, it should create the customer (examples to be given later)
2. Call our API to create the order, you should link the order then to the customerId you either created or looked up.
We have developed a WordPress/WooCommerce plugin which allows us to create/update and delete products, categories, xxx, yyy using a RESTful API. In addition when an order is created it will webhook that order information back to our system. We have a postman file with all the example calls.
What we require is two azure function apps and an example console app, all written in DotNET 6 / c#10. It is expected to have unit test coverage over all logic.
Function App 1 & Console App
This function app will use an Azure Queue (standard Table Storage queue). The console App will put a message onto the queue with a body similar to:
{
TenancyId: GUID,
DateTime: Time of entry into the queue
Action: Create/Update/Delete (as an ENUM),
Type: Product, Categories, xxx, yyy (as an ENUM),
Data: DYNAMIC
}
The above will act as an envelope. Using the postman collection as the examples, you should create a model for each of the types and then within the function app you should pull from the queue to process. You should deserialise the data to the correct model based on the action and type.
With this information you should then make the external http call to WooCommerce (POST/PATCH/DELETE) to match what the inbound message said.
If a failure occurs on the call to WooCommerce the message should not be successful. It should go back into the queue with a lock for 5 min (do not process again for 5 minutes). It should retry 500 times before going into dead letter.
Application insights should be used to log errors with stack trace on an exception. For http failures calling out we should log the status codes. TenancyId should always be in the log along with the action and the type.
Function App 2
There should be a second function app, this function app should be a http trigger. Using the example from WooCommerce (we have a demo environment) the function app should be invoked using the webhook call from our plugin. With this the function app, we must deserialise the request into a c# model.
We must then enter that into the same queue as function app 1. However this time it will be with Action: Create and Type: Order.
You should return a success to the caller if it is successfully added to the queue. If it is not added to the queue successfully you should return a 500. If the model cannot be deserialised it should return a 400.
You should then modify function app 1 to be able to process this. This will do two things:
1. Call our API (details provided later) to lookup the customer.
a. If the customer is not found, it should create the customer (examples to be given later)
2. Call our API to create the order, you should link the order then to the customerId you either created or looked up.