shibayan / keyvault-acmebot

Automated ACME SSL/TLS certificates issuer for Azure Key Vault (App Service / Container Apps / App Gateway / Front Door / CDN / others)
Apache License 2.0
891 stars 233 forks source link

Excessive Storage Account Usage #695

Closed tank104 closed 5 months ago

tank104 commented 5 months ago

Describe the bug Firstly - absolutely love this tool.

I have noticed though that I spend around USD $8 a month on storage for this Azure Function. Is this to be expected? I don't see it barely running often at (see both screenshots).

I assume others have the same issue? Anyway to fix it? When I turn off the function the usage goes to zero usage.

image image

To Reproduce Happens when app is running

Additional context

I see lots of this in the app insight logs:

2024-04-04T19:46:09Z [Verbose] sslgennhfaecht-control-02: ownership lease renewal with token 0e0f0fc0-c56b-49eb-bd50-c2040dfbe341 succeeded 2024-04-04T19:46:15Z [Verbose] There are currently 0 orchestration(s) and 0 activities loaded into memory on this worker 2024-04-04T19:46:17Z [Verbose] sslgennhfaecht-applease: Starting app lease renewal with token 43eb347a-0000-0000-0000-000000000000 2024-04-04T19:46:17Z [Verbose] sslgennhfaecht-applease: app lease renewal with token 43eb347a-0000-0000-0000-000000000000 succeeded 2024-04-04T19:46:18Z [Verbose] sslgennhfaecht-control-00: Starting intent lease renewal with token 365ce876-fe4a-4a18-8e71-5df76503a215 2024-04-04T19:46:18Z [Verbose] sslgennhfaecht-control-02: Starting intent lease renewal with token 63d456fd-c17d-4ea4-a77f-b2f3a02d56ad 2024-04-04T19:46:18Z [Verbose] sslgennhfaecht-control-03: Starting intent lease renewal with token 8b248e96-66a4-4da9-9722-d98af59545a1 2024-04-04T19:46:18Z [Verbose] sslgennhfaecht-control-01: Starting intent lease renewal with token a49858de-6063-4e00-9d0e-22fbaf754ba8 2024-04-04T19:46:18Z [Verbose] sslgennhfaecht-control-00: intent lease renewal with token 365ce876-fe4a-4a18-8e71-5df76503a215 succeeded 2024-04-04T19:46:18Z [Verbose] sslgennhfaecht-control-03: intent lease renewal with token 8b248e96-66a4-4da9-9722-d98af59545a1 succeeded 2024-04-04T19:46:18Z [Verbose] sslgennhfaecht-control-01: intent lease renewal with token a49858de-6063-4e00-9d0e-22fbaf754ba8 succeeded 2024-04-04T19:46:18Z [Verbose] sslgennhfaecht-control-02: intent lease renewal with token 63d456fd-c17d-4ea4-a77f-b2f3a02d56ad succeeded 2024-04-04T19:46:19Z [Verbose] sslgennhfaecht-control-00: Starting ownership lease renewal with token eb799e73-43cb-47d7-9da6-7423bb9a17b4 2024-04-04T19:46:19Z [Verbose] sslgennhfaecht-control-02: Starting ownership lease renewal with token 0e0f0fc0-c56b-49eb-bd50-c2040dfbe341 2024-04-04T19:46:19Z [Verbose] sslgennhfaecht-control-03: Starting ownership lease renewal with token 3ab00513-948a-4ae0-8932-217f0c9d35f8 2024-04-04T19:46:19Z [Verbose] sslgennhfaecht-control-01: Starting ownership lease renewal with token 99a403ee-d13c-407b-96e3-7e6f48217d31 2024-04-04T19:46:19Z [Verbose] sslgennhfaecht-control-00: ownership lease renewal with token eb799e73-43cb-47d7-9da6-7423bb9a17b4 succeeded 2024-04-04T19:46:19Z [Verbose] sslgennhfaecht-control-03: ownership lease renewal with token 3ab00513-948a-4ae0-8932-217f0c9d35f8 succeeded 2024-04-04T19:46:19Z [Verbose] sslgennhfaecht-control-02: ownership lease renewal with token 0e0f0fc0-c56b-49eb-bd50-c2040dfbe341 succeeded 2024-04-04T19:46:19Z [Verbose] sslgennhfaecht-control-01: ownership lease renewal with token 99a403ee-d13c-407b-96e3-7e6f48217d31 succeeded

shibayan commented 5 months ago

I have confirmed that the entire Azure resource I have for verification purposes is less than $1 per month, including storage.

Although constant requests for storage are inevitable due to the way Azure Functions work, we assume that the cost will not increase that much. However, if the Account Kind of Azure Storage is GPv2, the cost may be 10 times higher.

https://stackoverflow.com/questions/65881860/why-is-azure-functions-creating-v1-storage-accounts

tank104 commented 5 months ago

I am using storage v1, but I upgraded to the latest v4 function and version and it looks like the usage on storage might have tapered off massively versus v3. Will keep monitoring.

tank104 commented 5 months ago

Thanks for taking the time to reply too.