SKARVA Bodavula
SKARVA Bodavula

Reputation: 957

Azure Function in Consumption Plan Not Triggering (But Works in Premium)

Azure Function in Consumption Plan Not Triggering (But Works in Premium) I'm working with an Azure Function app that utilizes the Consumption plan. The function seems to execute flawlessly when deployed to the Premium plan, but it doesn't trigger at all in Consumption. I've verified the function code itself works as expected.

Here's what I've tried so far:

Manual Invocation: I've manually triggered the function through the Azure portal and it executes successfully in both Consumption and Premium plans. This suggests the function code itself is functional. Trigger Configuration: I've double-checked the trigger configuration (e.g., Blob storage connection string) and ensured it's accurate for both plans. Trigger Source Testing: I've simulated the trigger event from the source (e.g., uploaded a test blob) to see if the function fires in Consumption, but there's no response. Has anyone encountered this behavior with Azure Functions in Consumption plans? Any insights or suggestions on troubleshooting steps would be greatly appreciated!

Upvotes: 0

Views: 580

Answers (3)

SKARVA Bodavula
SKARVA Bodavula

Reputation: 957

The Azure Functions Consumption Plan doesn't come with a Service Level Agreement (SLA). This is because it's a serverless model where Azure automatically adjusts resources based on demand. You only pay for what you use. Since resources are allocated dynamically, there's no guarantee on availability or performance.

The plan is flexible and cost-effective but has some trade-offs. Your app runs on shared infrastructure, so performance can vary, especially if it hasn't been used recently or if demand is high. Azure scales your app based on traffic, but there could be delays during high demand.

While Azure aims for high availability, it doesn't guarantee it for the Consumption Plan. If your app has been idle, there might be a delay when it starts processing a new request.

If you need guaranteed availability and performance, consider other Azure Functions pricing plans that offer SLAs.

Upvotes: -1

Badd Speler
Badd Speler

Reputation: 13

I've experienced the exact same thing today. When deploying from the exact same repository to premium plan, and configuring identical settings, my python app functions perfectly, with the single http trigger function detected and showed as active. It is then callable by http.

When deploying from the exact same vscode window, and exact same workspace and repo, to a consumption plan app, with the exact same environmental variables configured, and role assignment for its managed identity, the function is not detected, and the app files view and others error out.

Upvotes: 1

Dasari Kamali
Dasari Kamali

Reputation: 3649

When using a Blob Storage trigger function, ensure that:

  • The storage account for the trigger is configured correctly.
  • The function app possesses the appropriate access rights to the storage account.
  • No firewall rules or network security groups are blocking access.
  • The blob events are being properly raised and consumed by the function app.

I tried a sample blob trigger function code to upload a test blob to the Azure storage container with an Azure Function in a windows based consumption plan. The code works fine locally in Visual Studio 2022 and in the Azure Portal.

Code :

Function1.cs :

using System;
using System.IO;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;

namespace FunctionApp111
{
    public class Function1
    {
        [FunctionName("Function1")]
        public void Run([BlobTrigger("<container_name>/{name}", Connection = "")]Stream myBlob, string name, ILogger log)
        {
            log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
        }
    }
}

local.settings.json :

{
    "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "<StorageConne_string>",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
  }
}

Local Output :

enter image description here

I successfully published the project to the Azure Function app as follows:

enter image description here

Function app output in Azure Portal :

enter image description here

Upvotes: 0

Related Questions