microsoft / DurableFunctionsMonitor

A monitoring/debugging UI tool for Azure Durable Functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Isolated] Login failed. Failed to load auth config. Request failed with status code 404

mdddev opened this issue · comments

Hi,

I want to host a separate function app to monitor the df task hub of another function app. I am using the injected mode of dfmon, in a NET8 application. When I run locally/or remote, and open the monitor in a browser. I am getting an error. The EasyAuth config cannot be found (which is for remote Auth for AAD) .

image

local.settings.json

{
    "IsEncrypted": false,
    "Values": {
        "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",

        "AzureFunctionsJobHost__extensions__durableTask__hubName": "hubName",
        "AzureFunctionsJobHost__extensions__durableTask__storageProvider__connectionStringName": "dfHubStorage",
        
        "AzureWebJobsStorage": "UseDevelopmentStorage=true",
        "dfHubStorage": "UseDevelopmentStorage=true",
        
        "DFM_ALLOWED_USER_NAMES": "me@biz.io",
        "DFM_ALLOWED_APP_ROLES ": "role.name",
        "DFM_HUB_NAME": "hubName",
        "DFM_CLIENT_CONFIG": "{\"theme\":\"dark\"}"
    }
}

Program.cs

using DurableFunctionsMonitor.DotNetIsolated;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace tst.func.dfmon;

public class Program
{
    public static async Task Main()
    {
        var host = new HostBuilder()
            .ConfigureFunctionsWorkerDefaults(workerApplication =>
            {
                workerApplication.UseDurableFunctionsMonitor((a,b) =>
                {
                    a.DisableAuthentication = true;
                });
            })
            .ConfigureAppConfiguration((HostBuilderContext ctx, IConfigurationBuilder builder) => 
            {
                builder
                    .SetBasePath(Directory.GetCurrentDirectory())
                    .AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
                    .AddEnvironmentVariables();
            })
            .ConfigureServices((HostBuilderContext ctx, IServiceCollection services) => {})
            .Build();

        await host.RunAsync();
    }
}

csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <TargetFramework>net8.0</TargetFramework>
    <LangVersion>12.0</LangVersion>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <OutputType>Exe</OutputType>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="DurableFunctionsMonitor.DotNetIsolated" Version="6.3.0-beta6" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.19.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.16.4" OutputItemType="Analyzer" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.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>

There's an issue in DurableFunctionsMonitor.DotNetIsolated 6.3.0-beta6 that causes this to happen.
Downgrading to 6.3.0-beta1 would fix this.

But you do not have to build your own separate app to monitor your existing Durable Functions Isolated project. Especially you are not required to deal with beta versions.

Just use DfMon Standalone or DfMon as a VsCode extension.

Thanks for reaching out. The reason why I am using a separate function app is this issue I have opened earlier. Downgrading to beta-1 solved the problem, thank you!