The EnvironmentCredential authentication unavailable error from within an Azure Function app can be mitigated disabling environment credentials or replacing any DefaultAzureCredential class instance with one of ManagedIdentityCredential.
To disable environment credentials:
new DefaultAzureCredential(new DefaultAzureCredentialOptions { ExcludeEnvironmentCredential = true });
Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.