Getting exception Method 'AsPages' in type 'Azure.Data.AppConfiguration.AsyncConditionalPageable' from assembly 'Azure.Data.AppConfiguration,' does not have an implemetation

Sneha N. Patil 25 Reputation points
2025-01-16T17:13:47.98+00:00

I am implementing blob trigger azure function in dot net 8. I have added azure app config and key vault configuration. On local, function runs successfully. But when I deploy it, I am getting below error:

2025-01-16T16:51:07.643 [Information] Starting JobHost

2025-01-16T16:51:07.645 [Information] Starting Host (HostId=id-dv-functions, InstanceId=e1561a9e-6000-47fe-9f94-e64cb16c3524, Version=4.1036.3.23284, ProcessId=28164, AppDomainId=1, InDebugMode=True, InDiagnosticMode=False, FunctionsExtensionVersion=~4)

2025-01-16T16:51:07.670 [Information] Loading functions metadata

2025-01-16T16:51:13.014 [Error] Unhandled exception. System.TypeLoadException: Method 'AsPages' in type 'Azure.Data.AppConfiguration.AsyncConditionalPageable' from assembly 'Azure.Data.AppConfiguration, Version=1.4.1.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' does not have an implementation.

2025-01-16T16:51:13.014 [Information] at Azure.Data.AppConfiguration.ConfigurationClient.GetConfigurationSettingsAsync(SettingSelector selector, CancellationToken cancellationToken)

2025-01-16T16:51:13.014 [Information] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.<>c__DisplayClass34_1.<<LoadSelectedKeyValues>b__1>d.MoveNext()

2025-01-16T16:51:13.014 [Information] --- End of stack trace from previous location ---

2025-01-16T16:51:13.014 [Information] at Microsoft.Extensions.Configuration.AzureAppConfiguration.TracingUtils.CallWithRequestTracing(Boolean tracingEnabled, RequestType requestType, RequestTracingOptions requestTracingOptions, Func`1 clientCall)

2025-01-16T16:51:13.014 [Information] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.LoadSelectedKeyValues(ConfigurationClient client, CancellationToken cancellationToken)

2025-01-16T16:51:13.016 [Information] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.<>c__DisplayClass33_0.<<InitializeAsync>b__0>d.MoveNext()

2025-01-16T16:51:13.017 [Information] --- End of stack trace from previous location ---

2025-01-16T16:51:13.017 [Error] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.<>c__DisplayClass46_0.<<ExecuteWithFailOverPolicyAsync>b__0>d.MoveNext()

2025-01-16T16:51:13.017 [Information] --- End of stack trace from previous location ---

2025-01-16T16:51:13.017 [Error] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.ExecuteWithFailOverPolicyAsync[T]

2025-01-16T16:51:13.017 [Error] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.ExecuteWithFailOverPolicyAsync(IEnumerable`1 clients, Func`2 funcToExecute, CancellationToken cancellationToken)

2025-01-16T16:51:13.017 [Information] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.InitializeAsync(IEnumerable`1 clients, CancellationToken cancellationToken)

2025-01-16T16:51:13.017 [Information] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.TryInitializeAsync(IEnumerable`1 clients, List`1 startupExceptions, CancellationToken cancellationToken)

2025-01-16T16:51:13.017 [Error] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.LoadAsync(Boolean ignoreFailures, CancellationToken cancellationToken)

2025-01-16T16:51:13.017 [Information] at Microsoft.Extensions.Configuration.AzureAppConfiguration.AzureAppConfigurationProvider.Load()

2025-01-16T16:51:13.017 [Information] at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)

2025-01-16T16:51:13.017 [Information] at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()

2025-01-16T16:51:13.017 [Information] at Microsoft.Extensions.Hosting.HostBuilder.BuildAppConfiguration()

2025-01-16T16:51:13.017 [Information] at Microsoft.Extensions.Hosting.HostBuilder.Build()

2025-01-16T16:51:13.017 [Information] at Identifi.CareFunctions.Functions.Program.Main()  

Program.cs

public static void Main()
{
    var host = new HostBuilder()
    .ConfigureFunctionsWorkerDefaults()
    .ConfigureServices(services =>
    {
        var appSettingsAssemblies = new[]
        {
            typeof(IdpSettings).Assembly
        };

        var types = (from assembly in appSettingsAssemblies
                     from type in assembly.GetTypes()
                     where !type.IsAbstract && type.IsClass && typeof(ICareNoteAppSettings).IsAssignableFrom(type)
                     select type).ToList();
        var config = services.BuildServiceProvider().GetService<IConfiguration>();

        foreach (var type in types)
        {
            var settingObj = Activator.CreateInstance(type);
            config.Bind(type.Name, settingObj);
            services.AddSingleton(type, settingObj);
        }

        services.AddHttpClient<IResourceOwnerTokenService, ResourceOwnerTokenService>();
        services.AddHttpClient<ICareNoteService, CareNoteService>();
    })
    .ConfigureAppConfiguration((ctx, configurationBuilder) =>
    {
        configurationBuilder.AddAzureAppConfiguration(option => option.Connect(new Uri(Environment.GetEnvironmentVariable("ConfigurationStoreUrl")), new ManagedIdentityCredential()));

        var secretClient = new SecretClient(
            new Uri(Environment.GetEnvironmentVariable("KeyStoreUrl")),
            new ManagedIdentityCredential());
        configurationBuilder.AddAzureKeyVault(secretClient, new KeyVaultSecretManager());
    })
    .Build();

    host.Run();
}

Could you please help me to resolve this issue?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,331 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,036 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. LeelaRajeshSayana-MSFT 16,946 Reputation points
    2025-01-16T23:47:35.7766667+00:00

    Hi @Sneha N. Patil Thank you for posting the question here.

    This seems to be an issue in the platform caused by mismatched references of the assemblies during the deployment. There is a GitHub issue reported on these where different possible solutions have been discussed. Here is the link to the issue Assembly conflict in Azure in process function v4

    Here are few of the possible fixes for the issue

    1. https://github.com/Azure/azure-functions-host/issues/9127#issuecomment-1810305548
    2. https://github.com/Azure/azure-functions-host/issues/9127#issuecomment-1690085621
    3. https://github.com/Azure/azure-functions-host/issues/9127#issuecomment-1628946487

    Please give them a try and let us know if any of the suggestions help resolve this issue

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.