Azure / azure-functions-eventhubs-extension

Event Hubs extension for Azure Functions
MIT License
20 stars 26 forks source link

Consumptionplan wont scale out if eventhub connection is managedIdentity #101

Closed bentmar closed 2 years ago

bentmar commented 2 years ago

When creating a consumption plan hosted eventhub triggered azure function with the inputtrigger connection managed by managedidentity it wont scale out. The Eventhub triggering the function has 32 partitions and millions and millions of events being retained for 7 days.

 "ehconnection__fullyQualifiedNamespace": "<namespace>.servicebus.windows.net",
 "ehconnection__credential": "managedIdentity",
 "ehconnection__clientId": "<clientId>"

SOLUTION: Changing from managedidentity to a classic connectionsstring for the connection binding makes it scale as its supposed to.

 "ehconnection": "<connectionstring>"

My setup:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Azure.Identity" Version="1.5.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="5.0.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>
cachai2 commented 2 years ago

Closing as dupe: https://github.com/Azure/azure-sdk-for-net/issues/26663