2

I'm exploring Azure Static App with dotnet API (Functions) as a Backend.

Unfortunately, my functions are failing to start, probably due to a configuration issue. I have a couple of functions that are bound to Table Storage.

        [FunctionName("BlameFunction")]
        [return: Table("Blames", Connection = "StorageConnectionAppSetting")]
        public static Blame Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = "blame")] HttpRequest req,
            ILogger log)
        {
            string query = req.Query["query"];

            log.LogInformation($"BlameFunction({query})");
            if (!string.IsNullOrEmpty(query))
            {
                return new Blame { PartitionKey = "Http", RowKey = Guid.NewGuid().ToString(), Query = query };
            }

            return null;
        }

Locally everything works fine, but when I publish my HTTP function calls respond with the Function host is not running. error.

All I see in linked application insights are exceptions: System.FormatException at DryIoc.Microsoft.DependencyInjection.DryIocAdapter+<>c__DisplayClass3_0.<RegisterDescriptor>b__0

and error events: A host error has occurred during startup operation '10d4cacd-0f87-4bcc-ac38-8308c27acc5e'.

local SDK

[api] Azure Functions Core Tools
[api] Core Tools Version:       4.0.4829 Commit hash: N/A  (32-bit)
[api] Function Runtime Version: 4.11.2.19273

nuget

 <ItemGroup>
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.0.1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Tables" Version="1.0.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.1" />
    <PackageReference Include="RestSharp" Version="108.0.2" />
  </ItemGroup>

web app SDK

- sdkVersion azurefunctions: 4.13.0.19486
xakpc
  • 1,709
  • 13
  • 27
  • How you are deploying your Azure Function ? – Harshitha Nov 04 '22 at 09:42
  • 1
    @Harshitha it was deployed from GitHub actions as a part of Azure Static App Service. I made a workaround: removed output bindings, and used a client to work with table storage directly – xakpc Nov 09 '22 at 15:50
  • 1
    Could you please post your solution as an answer so that it will be beneficial for other community members. – Harshitha Nov 10 '22 at 12:23

0 Answers0