question

suvrajyoti-2505 avatar image
0 Votes"
suvrajyoti-2505 asked ChaitanyaNaykodiMSFT-9638 answered

Maintaining lookup in Azure Durable Functions

Hi All,

Using Azure Durable Functions, I have created an Orchestrator that calls an Activity function in a loop. The loop count would be around 800. Here 800 is the no of Accounts having subscription to our Products and this details is stored in Cosmod DB. The Activity Function fetches the API usage in the API Management Instance using API Management Reports REST APIs for the same :

https://docs.microsoft.com/en-us/rest/api/apimanagement/2019-12-01/reports/list-by-operation#reportcollection

I need the callCountTotal for each API Operation Name so using the above. Calling the above above does not give me the API Name, so i need to fetch the same using :

https://docs.microsoft.com/en-us/rest/api/apimanagement/2020-06-01-preview/apis/get

Now the no of APIs would be lets say around 100. In each loop we can be querying https://docs.microsoft.com/en-us/rest/api/apimanagement/2020-06-01-preview/apis/get for the same API id. So was thinking of having a lookup in which the Key will be API id and Value will be API Name, so that we don't have to hit the https://docs.microsoft.com/en-us/rest/api/apimanagement/2020-06-01-preview/apis/get above for every loop.

Some of the links i referred is a s below:

https://markheath.net/post/sharing-state-between-azure-functions
https://raunaknarooka.medium.com/azure-functions-and-caching-sometimes-its-a-tricky-situation-985c7cceb1d5

In these various options such as MemCache etc, Disk Storage, Redis Cache etc is stored.

What would be a good cost effective solution for my requirement keeping in mind that activity functions in Durable function can scale out to multiple vm's. The function app in my case would be deployed in App Service Plan(ASE).

Thanks,
SuvraJyoti

azure-functionsazure-api-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ChaitanyaNaykodiMSFT-9638 avatar image
0 Votes"
ChaitanyaNaykodiMSFT-9638 answered

Hello @suvrajyoti-2505, Thank you for reaching out.
I think leveraging Azure Table storage will be a better option in this scenarios. As durable functions already uses Azure table storage for status and history of orchestrator and entity functions, and as storage account is already provisioned you won't have to maintain another external entity to achieve this functionality.
You can leverage Table Storage input and output binding to fetch or write data as per the logic required.
You can use this calculator to estimate the cost incurred.
Please let me know if there are any concerns. Thank you!



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.