Repository navigation
chore(samples): move the Azure Functions sample to Azure.Functions.Sdk and net11.0 #5752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
050ae18
6291d56
db0e2b9
72a532f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,18 +1,14 @@ | |||||||||||||||||
| <Project Sdk="Microsoft.NET.Sdk"> | |||||||||||||||||
| <Project Sdk="Azure.Functions.Sdk"> | |||||||||||||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explanation for reviewers
l
Package reference vs SDKThe old setup did roughly the same work, but delivered it as an ordinary package,
jamescrosswell marked this conversation as resolved.
|
|||||||||||||||||
| <!-- This repository pins the Azure.Functions.Sdk version under "msbuild-sdks" in its root global.json. | |||||||||||||||||
| If you copy this project, add that entry to your own global.json, or the build fails with MSB4236. --> | |||||||||||||||||
| <PropertyGroup> | |||||||||||||||||
| <!-- Stays on net10.0: the Azure Functions Worker SDK does not support .NET 11 yet - | |||||||||||||||||
| both 2.0.7 and the current 2.1.0 fail with "Invalid combination of TargetFramework | |||||||||||||||||
| and AzureFunctionsVersion is set." Bump this once Functions supports .NET 11. --> | |||||||||||||||||
| <TargetFramework>net10.0</TargetFramework> | |||||||||||||||||
| <AzureFunctionsVersion>v4</AzureFunctionsVersion> | |||||||||||||||||
| <OutputType>Exe</OutputType> | |||||||||||||||||
| <TargetFramework>net11.0</TargetFramework> | |||||||||||||||||
| </PropertyGroup> | |||||||||||||||||
|
|
|||||||||||||||||
| <ItemGroup> | |||||||||||||||||
| <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.51.0" /> | |||||||||||||||||
| <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.52.0" /> | |||||||||||||||||
| <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.3.0" /> | |||||||||||||||||
| <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" /> | |||||||||||||||||
| <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.7" /> | |||||||||||||||||
| <PackageReference Include="OpenTelemetry" Version="1.18.0" /> | |||||||||||||||||
| <PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.18.0" /> | |||||||||||||||||
| <PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.18.0" /> | |||||||||||||||||
|
|
|||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit annoying that we have to include this in the
global.jsonfile, for a single sample project, but there doesn't seem to be a way around that.<Project Sdk="Azure.Functions.Sdk">creates an extension project as an intermediate artefact of the build process, which has no version... Without this inglobal.jsonNuGet fails withMSB4236. Because it's done via an SDK reference, there's no way to do this as a build property :-(msbuild-sdksinglobal.jsonis where the resolver looks when a project gives no version, so pinning it here covers both the sample project and the intermediate extension project.There's a suggestion to fix this upstream:
azure_functions.g.csprojoutside the outer build fails with MSB4236 instead of AZFW0109 Azure/azure-functions-dotnet-worker#3506There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, but fair.
I've added a comment, maybe we just mention this on the code as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Covered by the comment now at the top of the sample project (db0e2b9), which is where someone copying the sample will look.
global.jsonitself stays comment-free.🤖 Addressed by Claude Code