Azure/azure-functions-durable-extension

FLEX Consumption plan, Cannot stop functions, (They keep running), although Portal says stopped

Opened this issue · 2 comments

Description

For a consumption plan I expect no charges if the functions are stopped. (But you cannot really stop them)

Expected behavior

When I stop a function app in the portal I expect the function app to stop.

Actual behavior

In the portal it seems the application is stopped. But the application is not stopped at all. I can see this because the logging keeps logging startup information to log analytics. (In the constructor of a singleton I log some data to a data collection endpoint. (DCE). I can see the constructor is firing all the time even though in the portal everything is stopped.)

Relevant source code snippets

No real source code example.......

Known workarounds

None

App Details

If relevant I will supply this.

Screenshots

While the functions were STOPPED they almost consumed my entire subscription credits.

image

If deployed to Azure

It is deployed on Azure

Hi @well0549 - sorry you came across this problem. Can you tell me what function you tried to stop and how you did it? Note that if you stop an orchestration function, that doesn't stop the activity functions started by the orchestration. These inflight activity functions will continue to run until they're finished. This may explain what you're seeing.

I used the portal, selected all flex functions based on the name and stopped the functions.

so i used the button in the portal.

And the one in the picture flex-cleanup has a queue and a timer trigger (every 20 minutes to clean up completed orchestration) and a queue triggered orchestration that does the actual work. Since no other functions were processing date, the cleanup had nothing to do.

But still i could see that all the functions were regularly starting. The startup sequence is logged to application insights.

below is a sample (not from the flex plan) but i could see this message quite regularly in the logs.
If i stop my functions on a normal consumption plan, the constructor will not fire and this message will not appear.

2024-08-14 18:45:32 --> Start creating Configuration Instance.
2024-08-14 18:45:32 --> Default Config Prefix [XXXXXXX_CONFIG_PREFIX]  ei
2024-08-14 18:45:32 --> Managed Identity from [XXXXXXX_CLIENT_ID]  XXXXXXX-0241-43a9-8bef-6b635b4e5e08
2024-08-14 18:45:32 --> Trying Managed Identity from Settings
2024-08-14 18:45:33 --> Reading Configuration from URL : https://XXXXXXX-portal.azurewebsites.net/api/XXXXXXX/GetXXXXXXXConfiguration
2024-08-14 18:45:33 --> Managed identity in XXXXXXX App Configuration is the same as the managed identity we assumed earlier : XXXXXXX-0241-43a9-8bef-6b635b4e5e08
2024-08-14 18:45:33 --> Created App configuration client with Managed credentials : [XXXXXXX-0241-43a9-8bef-6b635b4e5e08]
2024-08-14 18:45:33 --> LogAnalytics_WorkspaceId XXXXXXX-7aad-4547-825f-6e77ae96f9f2
2024-08-14 18:45:33 --> LogAnalytics_LogName XXXXXXX_claimpointeraudit
2024-08-14 18:45:33 --> LogAnalytics_DebugLogName XXXXXXX_claimpointerlogging
2024-08-14 18:45:33 --> ServicePrincipal_CLientSecret XXXXXXX~
2024-08-14 18:45:33 --> UseNagleAlgorithm True
2024-08-14 18:45:33 --> StorageAccount_TemplatePartitionName XXXXXXXtemplates
2024-08-14 18:45:33 --> StorageAccount_BlobGuardPartitionName XXXXXXXblobguards
2024-08-14 18:45:33 --> StorageAccount_ProcessGuardPartitionName XXXXXXXrocessguards
2024-08-14 18:45:33 --> StorageAccount_DurableGuardPartitionName eidurableguards
2024-08-14 18:45:33 --> ServiceBus_DefaultNamespace XXXXXXXintergrationsharedservicebus.servicebus.windows.net
2024-08-14 18:45:33 --> ServiceBus_OnRampQueue ei_onramp
2024-08-14 18:45:33 --> DefaultRouter_URL (not found) set to :
2024-08-14 18:45:33 --> UseManagedIdentity : True
2024-08-14 18:45:33 --> Creating Container Clients with Managed Identity Credentials
2024-08-14 18:45:33 --> Created ClaimPayloadContainer client with Managed Identity credentials XXXXXXX-0241-43a9-8bef-6b635b4e5e08
2024-08-14 18:45:33 --> Creating Table Clients with managed Identity
2024-08-14 18:45:33 --> Created Table clients with Managed credentials XXXXXXX-0241-43a9-8bef-6b635b4e5e08
2024-08-14 18:45:33 --> Creating ServiceBus Clients with managed Identity
2024-08-14 18:45:33 --> Deduplication for queue :ei_onramp is turned off.
2024-08-14 18:45:33 --> All queues should be present.
2024-08-14 18:45:33 --> Completed creating Configuration Instance. (945.2723 ms.)
2024-08-14 18:45:33 --> Running on a system with 2 processors.