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
29
votes
3 answers

Why do I need both APPINSIGHTS_INSTRUMENTATIONKEY and APPLICATIONINSIGHTS_CONNECTION_STRING in my Azure Function configuration?

APPINSIGHTS_INSTRUMENTATIONKEY contains the instrumentation key for Application Insights. APPLICATIONINSIGHTS_CONNECTION_STRING contains the instrumentation key for Application Insights prefixed with InstrumentationKey=. That seems pointless unless…
Niels Brinch
  • 3,033
  • 9
  • 48
  • 75
29
votes
10 answers

Could not load file or assembly Microsoft.Extensions.Logging.Abstractions

I'm using VS2019 Pro v16.3.5 I have a solution containing an Azure functions project which references several class library projects. The top-level project fails to compile with the following error: System.IO.FileNotFoundException: Could not load…
Rob Bowman
  • 7,632
  • 22
  • 93
  • 200
29
votes
4 answers

How to test .NET Standard 2 library with either NUnit, xUnit or MSTest from either Rider or VS 2017?

I have a project where I use Azure Durable Functions, and they are available only on .NET Standard 2. So, it defines which class library can be used in testing projects. But, I cannot put together a library where either xUnit, NUnit or MSTest is…
AndrasCsanyi
  • 3,943
  • 8
  • 45
  • 77
28
votes
2 answers

Azure Functions - What is the purpose of having host.json and local.settings.json

I can see two json files(host.json and local.settings.json) has been added in Azure Function directory. host.json { "version": "2.0", "logging": { "applicationInsights": { "samplingExcludedTypes": "Request", …
Rakesh Kumar
  • 2,701
  • 9
  • 38
  • 66
28
votes
7 answers

How to get the GET Query Parameters in a simple way in Azure Functions?

I tried the following: /// /// Request the Facebook Token /// [FunctionName("SolicitaFacebookToken")] [Route("SolicitaToken/?fbAppID={fbAppID}&fbCode={fbCode}&fbAppSecret={fbAppSecret}")] public static async…
Tony
  • 16,527
  • 15
  • 80
  • 134
28
votes
1 answer

Azure Functions: ICollector vs IAsyncCollector

What's the difference between ICollector and IAsyncCollector in Azure Functions when writing C# functions (also applies to WebJobs)? I understand from the samples that these are interfaces I can use to bind a function parameter to an output…
Chris Gillum
  • 14,526
  • 5
  • 48
  • 61
28
votes
3 answers

Azure Function logging using TraceWriter in external library

How can I reuse the TraceWriter object available in an Azure Function to log information in an externally referenced library? I tried passing in the object using the constructor and referencing the TraceWriter class (web.http.tracing). I didn't have…
Lance
  • 592
  • 2
  • 7
  • 13
28
votes
4 answers

Compare AWS-lambda, Azure functions and Google Cloud Function

I want to develop a serverless project by selecting aws-lambda, azure function or google cloud function. Then I want to compare each one in order to select the best one for my project. I need to select the most stable serverless technology for my…
user7090677
28
votes
2 answers

How do Azure Functions scale out?

The scaling documentation for Azure Functions is a bit light on details for how Azure Functions decide when to add more instances of an app. Say for example I have a function that is triggered by a Github webhook. 10,000 people simultaneously…
Adrian Hofman
  • 1,421
  • 1
  • 11
  • 24
27
votes
5 answers

Testing an Azure Function in .NET 5

I've started developing Azure Functions and now I want to create my first unit/integration test, but I'm completely stuck. Although I have a very simple Function with an HTTP Trigger and HTTP and Storage Queue output, it seems ridiculously complex…
Vincent Bitter
  • 1,000
  • 1
  • 6
  • 15
26
votes
5 answers

Can't get query parameter from HttpRequestData

I'm upgrading my code from .NET 3.0 to .NET 5.0, this changes the sintaxis quite a bit. In my previous code, which is a http request build in AZURE FUNCTIONS .NET 5.0 isolate, builds an GET api that takes parameters. This is my previous code from…
26
votes
3 answers

How to disable Read Only mode in Azure Function App?

I create a new Function App (v2) from Azure portal. Then I initiate a new app on my local computer with help of Azure Functions Core Tools v2.3, and publish it to my new app on portal: func init func new func azure functionapp publish…
Mahdi
  • 1,089
  • 1
  • 14
  • 27
25
votes
4 answers

Azure Functions: Singleton for expensive object

I've created some very simple Azure functions. They read and write data from Couchbase (which is running in Azure on a VM). I'm concerned about the connection(s) that I make to Couchbase in an Azure Function. I create a Cluster object each time.…
Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
25
votes
6 answers

How to get current user identity in Azure Function with Azure Authentication?

I have created a new Function App, enabled App Service Authentication / Authorization for it ("Use Authentication / Authorization to protect your application and work with per-user data") and disabled non-authenticated requests. Everything seems to…
25
votes
6 answers

How to return a JSON object from an Azure Function with Node.js

With Azure Functions, what do you need to do to return a JSON object in the body from a function written in node.js? I can easily return a string, but when I try to return a json object as shown below I appear to have nothing returned. context.res…
Chris Dellinger
  • 2,292
  • 4
  • 25
  • 33