Questions tagged [azure-functions]

Azure Functions is an event-driven serverless compute platform in Azure and Azure Stack. Its open-source runtime also works on multiple destinations including Kubernetes, Azure IoT Edge, on-premises, and other clouds.

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. You can write just the code you need for the problem at hand, without worrying about a whole application or the infrastructure to run it. Functions can make development even more productive, and you can use your development language of choice, such as C#, F#, Node.js, Java, or PHP. Pay only for the time your code runs and trust Azure to scale as needed. Azure Functions lets you develop serverless applications on Microsoft Azure.


###Getting Started

15299 questions
16
votes
1 answer

Warning publishing Azure service bus queue trigger can't find named value in local.settings.json

I have a Azure service bus queue trigger function and when I created it it asked me 3 fields, access rights, connection and queue name. I put in listen for the access rights. For the connection I used the the 'primary connection' name given in the…
16
votes
1 answer

Azure Function Http Trigger validating body data

Is there a way currently to validate objects in Azure functions using something similar to Data Annotations and Model State in the MVC framework? Or what is the standard approach to data validation and error response in Functions?
tokyo0709
  • 1,897
  • 4
  • 28
  • 49
16
votes
4 answers

Missing ProviderName when debugging AzureFunction as well as deploying azure function

I have an issue getting a DbContext to correctly pull my connection string from my local.settings.json Context: This is an Azure function project The main problem code is in System.Data.Entity.Internal.AppConfig Although I have a…
Adrian
  • 3,332
  • 5
  • 34
  • 52
16
votes
2 answers

Azure Function run code on startup

I am trying to find a way to run some code one time (where I set connection strings, DI, and other configs) when my Azure function starts. So right now, it calls a Run method as the entrypoint with this in the generated function.json: "entryPoint":…
Shawn
  • 2,355
  • 14
  • 48
  • 98
16
votes
2 answers

How can I do Routing in Azure Functions?

I know that I can use url parameters like this: "myfunction?p=one&p2=two" and in code that becomes request.query.p = "one"; but I would prefer to get it like this (express routing style): "myfunction/:myvalue" and use this…
contractorwolf
  • 438
  • 1
  • 3
  • 14
15
votes
1 answer

Getting error when upgrading from Serilog.Sinks.ApplicationInsights v3.1 to v4.0

I have an Azure Function that uses Serilog to write to AppInsights with Serilog AppInsights sink v3.1. The code in Startup.cs looks like this Log.Logger = new LoggerConfiguration() .ReadFrom.Configuration(config) …
Alex Monkey
  • 1,427
  • 1
  • 14
  • 16
15
votes
1 answer

Using Azure Function .NET5 and HttpRequestData, how to handle file upload (form data)?

The older Azure Function gives access to HttpRequest, which allows us to access the uploaded files via req.Form.Files etc. The isolated .NET5 Azure Function uses HttpRequestData instead, which does not give access to the Form. How do I extract the…
thankyoussd
  • 1,875
  • 1
  • 18
  • 39
15
votes
2 answers

Upgrading Azure Function From 3.1 to .Net 5 Give "GenerateFunctionMetadata" task could not be loaded

I'm trying to update Azure Function from 3.1 to .Net 5. I am following the below article https://codetraveler.io/2021/02/12/creating-azure-functions-using-net-5/ I created a new Time Triggered Function version 3.1 and followed the above…
Sid.Hart
  • 151
  • 1
  • 5
15
votes
10 answers

Azure Function in Java does not work locally

I am trying to run Azure function locally on my mac with IntelliJ. I did everything, step by step in this tutorial: https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-maven-intellij but when I start the project console show me…
Mário Jaroš
  • 433
  • 1
  • 3
  • 11
15
votes
5 answers

Azure function V3 could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0 with EF core 5.0-rc1

Case We are creating azure function v3 with .netcore 3.1. Using EF core 5.0-rc1 and Depdency Injection 1) DependecyInjection [assembly: FunctionsStartup(typeof(xxxxx.Startup))] namespace xxxxx { public class Startup : FunctionsStartup { …
15
votes
2 answers

Complex object app settings in Azure Function

I have these entries in my local.settings.json { "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "whateverstorageaccountconnectionstring", "FUNCTIONS_WORKER_RUNTIME": "dotnet" }, "BusinessUnitMapping": { …
Alan B
  • 2,219
  • 4
  • 32
  • 62
15
votes
3 answers

Global exception handler for Azure Functions

Is it possible to have a global exception handler for Azure Functions .Net C# project? We'd like to have a centralized place to log exceptions to Rollbar.
Pavel Chuchuva
  • 22,633
  • 10
  • 99
  • 115
15
votes
3 answers

Weird exception when trying to use Dependency Injection in an Azure Function

Given a File->New->Azure Functions v2 App, I'm trying to get a reference to either an ILoggerFactory or an ILogger. I'm doing this in the StartUp.cs class which is ran on the function app start. Given the following code a weird exception is…
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
15
votes
5 answers

Azure Function - System.Data.SqlClient is not supported on this platform

I'm running the following insert code within my azure function into an azure sql server 2014 database: private static void Command(SqlConnection sqlConnection, string query) { var sqlCommand = new SqlCommand(query, sqlConnection); …
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
15
votes
2 answers

Configure LogLevel of Azure Function using environment variables

As per the Azure documentation, Functions V2 uses the .NET Core logging filter hierarchy for configuration. In the following example, an instance of ILogger is injected into the Run method of the function. [FunctionName("MyFunction")] public static…
Alasdair Stark
  • 1,227
  • 11
  • 32