You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Flex Consumption]|[Supported](./flex-consumption-plan.md#supported-language-stack-versions)| Not supported |
46
+
| .NET Aspire |[Preview](dotnet-isolated-process-guide.md#net-aspire-preview)| Not supported |
46
47
47
48
<sup>1</sup> When you need to interact with a service using parameters determined at runtime, using the corresponding service SDKs directly is recommended over using imperative bindings. The SDKs are less verbose, cover more scenarios, and have advantages for error handling and debugging purposes. This recommendation applies to both models.
// The Application Insights SDK adds a default logging filter that instructs ILogger to capture only Warning and more severe logs. Application Insights requires an explicit override.
135
+
// Log levels can also be configured using appsettings.json. For more information, see https://learn.microsoft.com/azure/azure-monitor/app/worker-service#ilogger-logs
// The Application Insights SDK adds a default logging filter that instructs ILogger to capture only Warning and more severe logs. Application Insights requires an explicit override.
134
-
// Log levels can also be configured using appsettings.json. For more information, see https://learn.microsoft.com/azure/azure-monitor/app/worker-service#ilogger-logs
ApplicationInsightsintegrationisnotenabledbydefaultinallsetupexperiences. SometemplateswillcreateFunctionsprojectswiththenecessarypackagesandstartupcodecommentedout. IfyouwanttouseApplicationInsightsintegration, youcanuncommenttheselinesin `Program.cs` andtheproject's `.csproj` file. The instructions in the rest of this section also describe how to enable the integration.
-Intheapphost's `Program.cs`, you must also include the project by calling `AddAzureFunctionsProject<TProject>()` on your `IDistributedApplicationBuilder`. This method is used instead of the `AddProject<TProject>()` that you use for other project types. If you just use `AddProject<TProject>()`, the Functions project will not start properly.
1149
+
-IntheFunctionsproject:
1150
+
-Youmustreferencethe [2.xversions](#version-2x-preview) of [Microsoft.Azure.Functions.Worker] and [Microsoft.Azure.Functions.Worker.Sdk]. Youmustalsoupdateanyreferencesyouhaveto `Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore` tothe2.xversionaswell.
-IfyouwanttouseyourAspireservicedefaults, youshouldincludeaprojectreferencetotheservicedefaultsproject. Beforebuildingyour `IHostApplicationBuilder` in `Program.cs`, youshouldalsoincludeacallto `builder.AddServiceDefaults()`.
1153
+
-Youshouldn't keep configuration in `local.settings.json`, aside from the `FUNCTIONS_WORKER_RUNTIME` setting, which should remain "dotnet-isolated". Other configuration should be set through the app host project.
ThisdoesnotincludethedefaultApplicationInsightsconfigurationthatyouseeinmanyoftheother `Program.cs` examplesinthisarticle. Instead, Aspire's OpenTelemetry integration is configured through the `builder.AddServiceDefaults()` call.
1184
+
1185
+
### Considerations and best practices for .NET Aspire integration
- TriggerandbindingconfigurationthroughAspireiscurrentlylimitedtospecificintegrations. See [ConnectionconfigurationwithAspire](#connection-configuration-with-aspire) fordetails.
-AspireusesOpenTelemetryformonitoring. YoucanconfigureAspiretoexporttelemetrytoAzureMonitorthroughtheservicedefaultsproject. InmanyotherAzureFunctionscontexts, youmightincludedirectintegrationwithApplicationInsightsbyregisteringthetelemetryworkerservice. ThisisnotrecommendedinAspireandcanleadtoruntimeerrorswithversion 2.22.0 of `Microsoft.ApplicationInsights.WorkerService`. YoushouldremoveanydirectApplicationInsightsintegrationsfromyourFunctionsproject when using Aspire.
-DonotconfiguretheStorageemulatorforanyconnectionsin `local.settings.json`. ManyFunctionsstartertemplatesincludetheemulatorasadefaultfor `AzureWebJobsStorage`. However, emulatorconfigurationcanpromptsomeIDEstostartaversionoftheemulatorthatcanconflictwiththeversionthatAspireuses.
1195
+
1196
+
### Connection configuration with Aspire
1197
+
1198
+
AzureFunctionsrequiresa [hoststorageconnection (`AzureWebJobsStorage`)](./functions-reference.md#connecting-to-host-storage-with-an-identity) forseveralofitscorebehaviors. Whenyoucall `AddAzureFunctionsProject<TProject>()` inyourapphostproject, adefault `AzureWebJobsStorage` connectioniscreatedandprovidedtotheFunctionsproject. ThisdefaultconnectionusestheStorageemulatorforlocaldevelopmentrunsandautomaticallyprovisionsastorageaccount when deployed. For additional control, you can replace this connection by calling `.WithHostStorage()` on the Functions project resource.
Youcanconfigureboth `WithReference()` and `WithEnvironment()` ifyouwantaconnectiontobeusedbothbyAspireclientintegrationsandthetriggersandbindingssystem.
1247
+
1248
+
Forsomeresources, thestructureofaconnectionmightbedifferentbetweenwhenyourunitlocallyandwhenyoupublishittoazure. Inthepreviousexample, `otherIntegration` couldbearesourcethatrunsasanemulator, so `ConnectionStringExpression` wouldreturnanemulatorconnectionstring. However, whentheresourceispublished, Aspiremightsetupanidentity-basedconnection, and `ConnectionStringExpression` wouldreturntheservice's URI. In this case, to set up [identity based connections for Azure Functions](./functions-reference.md#configure-an-identity-based-connection), you might need to provide a different environment variable name. The following example uses `builder.ExecutionContext.IsPublishMode` to conditionally add the necessary suffix:
Consulteachbinding's [reference pages](./functions-triggers-bindings.md#supported-bindings) for details on the connection formats it supports and the permissions those formats require.
1258
+
1133
1259
## Debugging
1134
1260
1135
1261
WhenrunninglocallyusingVisualStudioorVisualStudioCode, you're able to debug your .NET isolated worker project as normal. However, there are two debugging scenarios that don'tworkasexpected.
@@ -1300,6 +1426,15 @@ Keep these considerations in mind when using Functions with preview versions of
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-service-bus.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,8 @@ Functions 1.x apps automatically have a reference the [Microsoft.Azure.WebJobs](
67
67
68
68
This version allows you to bind to types from [Azure.Messaging.ServiceBus](/dotnet/api/azure.messaging.servicebus).
69
69
70
+
This version supports configuration of triggers and bindings through [.NET Aspire integration](./dotnet-isolated-process-guide.md#connection-configuration-with-aspire).
71
+
70
72
Add the extension to your project by installing the [NuGet package](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.ServiceBus), version 5.x.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-bindings-storage-blob.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,8 @@ Functions 1.x apps automatically have a reference the [Microsoft.Azure.WebJobs](
78
78
79
79
This version allows you to bind to types from [Azure.Storage.Blobs](/dotnet/api/azure.storage.blobs). Learn more about how these new types are different from `WindowsAzure.Storage` and `Microsoft.Azure.Storage` and how to migrate to them from the [Azure.Storage.Blobs Migration Guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/storage/Azure.Storage.Blobs/AzureStorageNetMigrationV12.md).
80
80
81
+
This version supports configuration of triggers and bindings through [.NET Aspire integration](./dotnet-isolated-process-guide.md#connection-configuration-with-aspire).
82
+
81
83
Add the extension to your project by installing the [Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs NuGet package], version 5.x or later.
0 commit comments