All Questions
Tagged with .net-core azure-functions
629
questions
59
votes
14
answers
95k
views
Could not load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=5.0.0.0 in Azure Functions
I have an API and a separate Azure Functions app. I upgraded my API app to .NET 5 and it's working fine. In the API app's solution, I have class library projects that I also reference in my Azure ...
58
votes
9
answers
33k
views
Azure Functions: There was an error performing a read operation on the Blob Storage Secret Repository
In testing Azure Functions locally, I am receiving this error:
"There was an error performing a read operation on the Blob Storage
Secret Repository. Please ensure the 'AzureWebJobsStorage' ...
43
votes
3
answers
17k
views
Azure Functions: Queue Trigger is expecting Base-64 messages and doesn't process them correctly
I have this Queue Trigger. The expected is when I insert a message in the Queue, the trigger must fire and process the dequeued message.
[FunctionName("NewPayrollQueueTrigger")]
...
39
votes
12
answers
89k
views
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:...
27
votes
16
answers
69k
views
The listener for function was unable to start. Why?
I'm getting the following error when I run the azure function from visual studio.
A ScriptHost error has occurred [1/19/2018 6:40:52 AM] The listener
for function 'MyFunctionName' was unable to ...
20
votes
9
answers
24k
views
Error "Did not find functions with language [dotnet-isolated]" in Azure Function when migrating from .NET 3 to .NET 5
I'm trying to migrate an Azure Function that works perfectly on .NET 3.1 to .NET 5.
I followed Microsoft's GitHub guide and still can't get it to run or debug locally (didn't even try to publish to ...
20
votes
2
answers
10k
views
Azure Function gives error: System.Drawing is not supported on this platform
(If this question is poorly worded, could someone please help me clear it up?)
I have an Azure Function (2.0) which relies on some System.Drawing code. I've added a NuGet reference to System.Drawing....
16
votes
2
answers
9k
views
Complex object app settings in Azure Function
I have these entries in my local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "whateverstorageaccountconnectionstring",
"FUNCTIONS_WORKER_RUNTIME": ...
15
votes
5
answers
10k
views
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 ...
15
votes
3
answers
9k
views
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<T>.
I'm doing this in the StartUp.cs class which is ran on the function app ...
14
votes
4
answers
13k
views
Azure function app deploy and release pipeline error
I pushed my .net core function application using visual studio and now setting up release pipeline. I can publish and execute the application just fine and it works great on the Azure portal. However ...
14
votes
5
answers
10k
views
How to use IOptions pattern in Azure Function V3 using .NET Core
My requirement is to read values from local.settings.json using IOptions pattern
My localsettings.json:
{
"IsEncrypted": false,
"Values": {
"MyOptions:MyCustomSetting": "Foobar",
"...
13
votes
1
answer
16k
views
.Net 5 Azure Function App with use of Startup class
I have created an HTTP trigger-based .Net 5 Azure FunctionApp and trying to configure the database connection strings and dependency injections for my service classes but, I don't know how to call my ...
13
votes
3
answers
8k
views
How to migrate Azure Functions v3 to .net core 5.0
I have upgraded all assemblies in an Azure Function v3 project to version 5.0 but I am unable to run the function. Here it is my function's csproj file's partial definition:
<PropertyGroup>
&...
12
votes
1
answer
5k
views
ASP.NET Core 2.1 on full .NET Framework
Is it possible to use ASP.NET Core 2.1 and still run on the full .NET Framework 4.7.1?
I'm currently using ASP.NET Core 2.0 on .NET 4.7.1 and i'm also using Azure Functions v1 on 4.7.1 and share ...
12
votes
3
answers
4k
views
WebJobsStartup in Azure Functions v2 not working when targeting netcoreapp2.1
I have an Azure Function v2 app, that I originally targeted netcoreapp2.1.
I then have a Startup.cs class, annotated with [assembly: WebJobsStartup(typeof(Startup))] to set up dependency injection, ...
11
votes
2
answers
9k
views
Azure functions configure timer trigger from Azure App Configuration
I'm doing an Azure Function that is timer triggered. I want to be able to change the timer, i.e the cron expression, without having to do a re-deploy. I'm getting my other settings from an App ...
11
votes
1
answer
17k
views
Using Azure Function (.NET Core) to Download a file
I have created and HTTP Triggered Azure Function (v2) using .NET Core with the hopes that I can execute the function while passing in some info in the request body and then have the function return/...
11
votes
4
answers
26k
views
How to configure environment variables in Azure DevOps pipeline?
I have an Azure Function (.NET Core) that is configured to read application settings from both a JSON file and environment variables:
var configurationBuilder = new ConfigurationBuilder()
...
10
votes
2
answers
6k
views
Enable Synchronous IO in Azure Function
I am building a HTTPTriggered Azure Function, targeting netcoreapp3.0, that is running a GraphQL .NET server. GraphQL .NET requires that AllowSynchronousIO is set to true, but I can't figure out how ...
10
votes
1
answer
16k
views
In Azure Functions, how to use route parameter inside an output binding
Below is an http triggered function. For the route, I have specified a variable user. Now, I want this variable user to be consumed in any other output binding. Now working code shown with Blob as an ...
10
votes
2
answers
729
views
Inexplicable storage transactions from Azure Functions
I have a project with a couple of .NET Core based Azure Functions running on a schedule. One of them runs once every 10 minutes and serves to update view counts similar to how SO tracks question views ...
10
votes
1
answer
3k
views
How can I use ILogger<T> from an Azure Functions V2 function?
I have some services that were initially designed to be called from my ASP.NET Core 2.1 web application. They have dependencies injected to their constructors using Microsoft.Extensions....
9
votes
2
answers
8k
views
How can I debug Azure Functions using .NET 5 (isolated process) in Visual Studio?
I've recently migrated from .NET Core 3.1 to .NET 5.0 (using isolated/out-of-process runtime) for an Azure Function project in C#. Everything is working as expected. However, whenever I debug, none of ...
9
votes
3
answers
10k
views
EF Core Migrations in Azure Function startup
According to https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection the service provider should not be used until AFTER the startup has completed running. Indeed,...
9
votes
3
answers
6k
views
.NET Core 2.2 Azure Function v2 Dependency Injection
I am having an issue registering a singleton using Microsoft.Extensions.DependencyInjection. I have created a Startup class (which is definitely working) and created an ITestService with ...
9
votes
4
answers
10k
views
Runing a functions project locally
I am truing to get a existing .Net functions app runing locally. It has been developed on Windows with Visual Studio, but I am on a Mac (M1 CPU) and using VS Code. I am pretty new to .Net I am ...
9
votes
2
answers
13k
views
Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0
In my azure function app project, I receive an assembly not found runtime error Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0. However, the assembly is included in multiple ...
9
votes
1
answer
2k
views
Include filename and line number in stacktrace from ASP.NET Core
In .NET full framework, it is possible to include the filename and line number in a stacktrace generated from a release build, by including debug info in the output and setting Debug info to pdb-only ...
8
votes
2
answers
4k
views
Azure Functions still “Cold Start” in Consumption plan when keep alive request sent per 4 mins
I already read Understanding Serverless Cold Start | Azure App Service Team Blog article. One the the comments said You can avoid cold start in consumption plan also by calling function from Azure ...
8
votes
1
answer
2k
views
Fiddler with dotnet-isolated Az Function - Error starting gRPC call
I have a C# dotnet 5 Azure Function in VS2019 configured with "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated".
If I run the function in the dev environment (ctrl + F5) while Fiddler ...
8
votes
7
answers
7k
views
Visual Studio 2019 - Unable to debug Azure functions - (Desktop CLR (.NETFramework) versus Managed (CoreCLR)' debugger
I have installed the Visual Studio 2019 community version 16.4.4 on a brand new laptop
OS:- Windows 10 Home Single Language
The following are the .NET Core SDKS installed in my laptop
The ...
8
votes
1
answer
7k
views
How to configure HttpClient in Azure functions
Like many I'm using the HttpClient in some of my Azure functions (v3.x). The issue is that Azure function host uses the HttpClient as a singleton. This means that if I set the headers in one ...
8
votes
2
answers
2k
views
Running .Net Core based Azure Function in Docker Container on Apple Silicon
I am trying to run a .Net Core based Azure Function inside a Docker container on a M1 Macbook without success so far.
Originally I used the Azure Function Core Tools CLI to create the function with ...
8
votes
1
answer
2k
views
Durable Azure Functions and Integration Tests
I'm trying to test (integration tests) my Azure Durable Function v3 with SpecFlow and MSTest.
Functions are initialized with DI and Startup class:
[assembly: FunctionsStartup(typeof(Startup))]
...
7
votes
3
answers
6k
views
Why is an Azure Function on .NET 6 looking for System.ComponentModel Version 6.0.0.0?
I am deploying an Azure Function called "Bridge" to Azure, targeting .NET 6. The project is referencing a class library called "DBLibrary" that I wrote, and that library is ...
7
votes
1
answer
3k
views
How do I mock/stub HttpRequestMessage in .NET Core?
I have a function that I'm porting from Azure Functions v1 to v2, and as part of that I've run into an issue updating my unit tests which create a stubbed HttpRequestMessage. Here's the code that ...
7
votes
2
answers
8k
views
How To Access Azure Function App ConnectionString Using dotnet Standard
My Azure Function App has a ConnectionString defined. I want to retrieve it from a C# function written in dotnet standard 2.0. I have tried adding System.Configuration.ConfigurationManager to the ...
7
votes
4
answers
8k
views
Dependency Injection not working in local Azure Function
Dependency Injection fails to initialize for me even though it seems to work for my team members. To test this, I've created a bare bones project that includes dependency injection (using this guide) ...
7
votes
2
answers
12k
views
The current .NET SDK does not support targeting .NET 7.0. Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0
Note: This is not a duplicate question despite the title seems like the similar ones.
I am trying to build a docker image to support an Azure Function in .NET 7.0 that works in .NET 6.0 by docker. I ...
7
votes
1
answer
6k
views
How to use ConfigurationBuilder staticly in an Azure Function v2 (core)?
While porting an Azure Function from v1 to v2 there is a change in how the configuration manager is used to read the local.settings.json.
Previously, I used the following code to enable redis ...
7
votes
2
answers
2k
views
Inject ILogger when adding a Singleton for Azure Functions 3.0
I have a redisprovider class in my Azure Function:
public RedisCacheProvider(ILogger<RedisCacheProvider> logger,
IConnectionMultiplexer connectionMultiplexer)
{
...
7
votes
2
answers
376
views
Azure Function Targeting .NET Standard Showing Warning
Just installed Visual Studio 15.5 Preview so that I can create an Azure Function targeting .NET Core. Without making any changes, I'm seeing a warning -- see below -- that reads:
Package Microsoft....
7
votes
1
answer
2k
views
C# HttpClient POST requests from Azure Function with Authorization tag intended for third-party API are stripped of Headers and Body
UPDATE
I was able to get a working request posted. The third-party API has us sending the Token (which is basically a Guid) as a bearer token. Azure appears to do some sort of pre-validation on this. ...
7
votes
1
answer
1k
views
Diagnose 'Function host is not running.' in docker
I am trying to migrate several of our dotnet based function-apps (v3) to docker containers. For this we use images from mcr.microsoft.com/azure-functions/dotnet as a base
When testing locally using ...
7
votes
0
answers
648
views
Azure function Service bus topic trigger sleeps
I am working on Service bus topic trigger function. we have used consumption plan. It is observed that the function goes to sleep after inactivity and it does not wake up when there is new message on ...
7
votes
0
answers
1k
views
Swashbuckle with Azure functions - defining query parameters
I've found little to no info on Swashbuckle on azure functions, but I managed, and the only thing I'm missing is defining query parameters on my function.
I usually just get them by using request....
6
votes
1
answer
5k
views
ILogger does not log to Application Insights when using Azure Function V2 Durable functions
Can someone, please explain how to force ILogger to actually log something into Application insights when using Azure Function V2 (.net Core)?
We have Application Insights configured and it shows ...