Azure / azure-functions-dotnet-worker

Azure Functions out-of-process .NET language worker
MIT License
431 stars 184 forks source link

.NET 9 Azure Functions Isolated: Visual Studio Publish to Azure, no functions #2865

Closed jaliyaudagedara closed 2 days ago

jaliyaudagedara commented 2 days ago

Description

I have a simple Azure Function App that was using .NET Isolated.

Decided to update to .NET 9 and after everything is updated deployed through existing GitHub pipeline. My functions are not displayed in Azure Portal and all I can see was WarmupTrigger.

So started simple.

  1. Created Azure Function App with a HTTP trigger targeting .NET 9 Isolated Confirmed it's running locally: Image

  2. Visual Studio Publish

  3. Created necessary resources via Visual Studio (Linux/Consumption)

  4. Published

My function doesn't come up. Image

Image

CSPROJ,

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <OutputType>Exe</OutputType>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
    <!-- Application Insights isn't enabled by default. See https://aka.ms/AAt8mw4. -->
    <!-- <PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" /> -->
    <!-- <PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="2.0.0" /> -->
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.0.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.0" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext" />
  </ItemGroup>
</Project>

App Settings,

[
  {
    "name": "AzureWebJobsStorage",
    "value": "<REDACTED>",
    "slotSetting": false
  },
  {
    "name": "FUNCTIONS_EXTENSION_VERSION",
    "value": "~4",
    "slotSetting": false
  },
  {
    "name": "FUNCTIONS_WORKER_RUNTIME",
    "value": "dotnet-isolated",
    "slotSetting": false
  },
  {
    "name": "SCM_DO_BUILD_DURING_DEPLOYMENT",
    "value": "0",
    "slotSetting": false
  },
  {
    "name": "WEBSITE_USE_PLACEHOLDER_DOTNETISOLATED",
    "value": "1",
    "slotSetting": false
  }
]

Confirmed it Uses 64bit. Image

Shouldn't this be working without any issues, I mean this is the very basic.

jaliyaudagedara commented 2 days ago

Sometimes I am seeing the WarmUp trigger, not always though. (that's a separate issue I guess) Image

fabiocav commented 2 days ago

@jaliyaudagedara Linux Consumption .NET 9 support is still rolling. Have you tried different SKUs?

You can track progress here: https://github.com/Azure/azure-functions-dotnet-worker/issues/2817 And here: https://github.com/Azure/azure-functions-host/issues/10602

Thank you!

jaliyaudagedara commented 2 days ago

ah, Thanks @fabiocav, I wasn't aware it's still rolling.

Will move to a different SKU and see

fabiocav commented 2 days ago

No worries, we're working through the deployments in those environments as fast, and safely, as possible.

milen-denev commented 2 days ago

Same issue, rollbacked to .net 8 until MS rolls out .net 9 to Azure Functions Consumption tier.

jaliyaudagedara commented 2 days ago

Deployed as a container to be on the safe side, all good.