Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method not foundMicrosoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services() since .Net Core 3.1 release #32

Closed
FrankGagnon opened this issue Dec 5, 2019 · 48 comments

Comments

@FrankGagnon
Copy link

FrankGagnon commented Dec 5, 2019

Hi,

When updating our nuget packages like
Microsoft.Extensions.DependencyInjection.Abstractions
and
Microsoft.Extensions.Configuration
to version 3.1.0 released with .Net Core 3.1 yesterday, the Function host fails to start with the following error : Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services()'

I'm using the latest VS version, 16.4.0 and the v3 preview function runtime.

Thanks,
Frank

@hiiru
Copy link

hiiru commented Dec 6, 2019

I also have this issue with .NET Core 3.1 and Microsoft.Extensions.* 3.1.0 packages.
It only occurs if [assembly: FunctionsStartup(typeof(Startup))] is set (or [assembly: WebJobsStartup(typeof(Startup))] when using the WebJobs SDK to configure DI).

I think it's a similar issue as #29 back with .NET Core 3.0.

My current workaround is using Microsoft.Extensions.* packages in version 3.0.0.

@eliashdezr
Copy link

eliashdezr commented Dec 10, 2019

I'm getting a similar error while trying to do a GET on a HttpTrigger function:

Microsoft.Extensions.DependencyInjection.Abstractions: Unable to resolve service for type

This is my current setup:

  • Visual Studio 16.5.0 Preview 1
  • azure-functions-core-tools@3.0.1740
  • npm@v13.2.0

And this is my .csproj

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="3.1.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.1" />
    <PackageReference Include="Utf8Json" Version="1.3.7" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

Startup.cs file:

using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using Demo.Domain.Interfaces.Repository;

namespace Demo.Functions
{
    public class Startup : FunctionsStartup
    {
        public override void Configure(IFunctionsHostBuilder builder)
        {
            builder.Services.AddSingleton<IDemoRepo, DemoRepo>();
        }
    }
}

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "FUNCTIONS_EXTENSION_VERSION": "~3"
  }
}

host.json

{
  "version": "2.0",
  "healthMonitor": {
    "enabled": true,
    "healthCheckInterval": "00:00:10",
    "healthCheckWindow": "00:02:00",
    "healthCheckThreshold": 6,
    "counterThreshold": 0.80
  },
  "functionTimeout": "00:10:00"
}

This might be related #5

@IGx89
Copy link

IGx89 commented Dec 11, 2019

Also just ran into this issue upgrading a working function app from v3-preview/ASP.NET Core 3.0 to v3/ASP.NET Core 3.1. Guess we're not upgrading to 3.1 yet!

@IGx89
Copy link

IGx89 commented Dec 11, 2019

FYI I fixed my issue updating azure-functions-core-tools from 3.0.1740 to 3.0.1975. It just came out two days ago, so none of you above would have had it yet.

@eliashdezr
Copy link

FYI I fixed my issue updating azure-functions-core-tools from 3.0.1740 to 3.0.1975. It just came out two days ago, so none of you above would have had it yet.

Same error, with azure-functions-core-tools@3.0.1975 issue doesn't go away.

@StefanSchoof
Copy link

Updating to 3.0.1975 solved this for me also. But only if I start the function from command line. Starting in Visual Studio the error still occurs. I think VS has an older version of the runtime , which still is on dotnet core 3.0, bundled.

@eliashdezr
Copy link

Updating to 3.0.1975 solved this for me also. But only if I start the function from command line. Starting in Visual Studio the error still occurs. I think VS has an older version of the runtime , which still is on dotnet core 3.0, bundled.

That resolved my issue too.

@fabiocav
Copy link
Member

fabiocav commented Jan 8, 2020

@FrankGagnon can you validate with the latest version and let us know if this is still an issue?

@ghost
Copy link

ghost commented Jan 13, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@laurentlbm-rc
Copy link

laurentlbm-rc commented Jan 14, 2020

I am not getting this error when developing, but I am when the function is published to Azure:

The function runtime is unable to start. AzureFunctions.Test: Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services()'.

Session Id: 05fd31eb4d364d95b0ae80d281dbc38d

Timestamp: 2020-01-14T16:30:42.146Z

Here is my .csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DefineConstants>DEBUG;TRACE</DefineConstants>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
    <PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.0" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
    <PackageReference Include="Microsoft.Extensions.Options" Version="3.1.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.2" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

@ghost ghost removed the no recent activity label Jan 14, 2020
@fabiocav
Copy link
Member

@laurentlbm-rc is your Function App version on Azure set to 3.0? (~3)?

Can you please share an invocation ID, region and timeframe so we can look at some details?

@laurentlbm-rc
Copy link

@fabiocav Ah, I feel stupid, that was the issue, it's working fine now. I'm not the one who created the function app and I didn't think to look at that.

@robertracz
Copy link

robertracz commented Jan 14, 2020

I am having the same issue in production:

Error:
The function runtime is unable to start. DsInternal.Functions: Method not found: >'Microsoft.Extensions.DependencyInjection.IServiceCollection
Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services()'.
Session Id: 393e6f10d28544d9ab1e49f44286e178
Timestamp: 2020-01-14T23:14:26.600Z

Everything is fine locally, however in the function app i am getting the same exception on startup. My Function App is referencing two netstandard2.1 libraries which might has to do something with it... FUNCTIONS_EXTENSION_VERSION is set ti ~3.

Function app:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>V3</AzureFunctionsVersion>
    <LangVersion>8.0</LangVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.2" />
    <PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.10" />
    <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
  </ItemGroup>
  .
  . 
  .
</Project>

class libraries:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
    <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.0" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.0" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.0" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="3.1.0" />
    <PackageReference Include="Microsoft.Extensions.Options" Version="3.1.0" />
    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.0" />
    <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
  </ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="AutoMapper" Version="9.0.0" />
    <PackageReference Include="CsvHelper" Version="12.2.2" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
</Project>

Wondering if EF Core reference is the issue although it should not be? I had issues before locally but not since upgrading to dotnet core 3.1.

Regards,

Robert

@itorian
Copy link

itorian commented Jan 16, 2020

Same issue when upgraded from netcoreapp3.0 to netcoreapp3, when i run it locally i get below error:

Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services()'.
Value cannot be null. (Parameter 'provider')

I've following packages and settings in place

<PropertyGroup>
  <TargetFramework>netcoreapp3.1</TargetFramework>
  <AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
  <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.2" />
  <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
  <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.1" />
  <PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.3.101.111" />
</ItemGroup>

Then I create a brand new project and moved all my *.cs files one by one and i was able to run it locally. So I have no idea, why above error appeared, during troubleshooting I cleared all bin and obj, and couple of other things and no success.

Once I had this working in brand new project, then I tried to publish function app on azure. I'm using Visual Studio 16.4.3 publish wizard 'Azure App Service Plan Linux' option, then clicked on 'Select Existing' radio. Then I was prompted to select my existing function app, at the end clicked on 'Publish'.

I received publish success message:

2>Publishing C:\Users\abhimanyu\source\repos\app1-tfs\App1.Function.Core.New\obj\Release\netcoreapp3.1\PubTmp\App1.Function.Core.New - 20200116184741772.zip to https://xxxxfunctionpoc1.scm.azurewebsites.net/api/zipdeploy...
========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

When I opened this on azure portal, there is no function item, however everything worked well locally.
image

FUNCTIONS_EXTENSION_VERSION is set to ~3 | Location: Central US

@ghost ghost added the no recent activity label Jan 20, 2020
@ghost
Copy link

ghost commented Jan 20, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@kevinbrydon
Copy link

For anyone still having issues. What worked for me was changing the AzureFunctions entry in my projct file from v2 to v3

My project file now looks like this

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netcoreapp3.1</TargetFramework>
        <AzureFunctionsVersion>v3</AzureFunctionsVersion>
    </PropertyGroup>
    <ItemGroup>
        <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
        <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventGrid" Version="2.1.0" />
        <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.2" />
    </ItemGroup>
    <ItemGroup>
      <ProjectReference Include="..\My.Namespace\My.Namespace.csproj" />
        ...
    </ItemGroup>
    <ItemGroup>
        <None Update="host.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Update="local.settings.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
            <CopyToPublishDirectory>Never</CopyToPublishDirectory>
        </None>
    </ItemGroup>
</Project>

All my referenced projects are netstandard2.1

Hope that helps

@ghost
Copy link

ghost commented Jan 27, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@moklas
Copy link

moklas commented Jan 28, 2020

@kevinbrydon thanks for the tip regarding AzureFunctionsVersion in the project file.

@ghost ghost removed the no recent activity label Jan 28, 2020
@eliashdezr
Copy link

I'm still having my issue described above:
#32 (comment)

Only when I run the function with the cli func start --build works.

@fabiocav Is there some action already to make it work with Visual Studio again? I'm using the latest VS preview version.

@kevinbrydon
Copy link

@plazav Can you ensure the following things

Your .csproj file PropoertyGroup looks like this

...
<PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>
...

Your host.json should be

{
    "version": "2.0"
}

In Azure Portal, your functions Runtime version is set to ~3.

If the above is all correct, it might be worth deleting and recreating your function in azure. Upgrade it to ~3 before deploying anything to it.

@plazav
Copy link

plazav commented Jan 31, 2020

Hi @kevinbrydon, The settings that you have provided are correct.
I have just recreated Function App (with new application name) and even have updated it to version 3 before publishing, but result is still same.
Application is running on Linux and App Service Plan is used (not consumption plan), but I don't think that it could play any role.

@kevinbrydon
Copy link

@plazav Just to be clear. You're having the Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Azure.Functions.Extensions.DependencyInjection.IFunctionsHostBuilder.get_Services() issue and not the Ubuntu issues? You're developing on a windows 10 machine?

Currently the only difference between me and you is that I am using the consumption plan.

If you are able to share your source code, pipeline script and function template then that might help.

@plazav
Copy link

plazav commented Jan 31, 2020

@kevinbrydon Yes, I am having the issue
"Method not found: 'Microsoft.Extensions.DependencyInjection.IServiceCollection Microsoft.Extensions.DependencyInjection.OptionsConfigurationServiceCollectionExtensions.Configure(Microsoft.Extensions.DependencyInjection.IServiceCollection, Microsoft.Extensions.Configuration.IConfiguration)'."

And yes, I am developing on Windows 10.
Can provide some parts of my code (but what exactly?). Pipeline is not so much important as when I am publishing from VS result is the same.

Could it be that this issue happens because I have reference to
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
in one of my projects?
By the way the difference could be that I have multiple projects in my solution.

@kevinbrydon
Copy link

@plazav That error you are getting is different to the one being discussed in this thread. I don't think any of the solutions posted will help you. If it was me, I'd start from scratch. Simple function, no constructor, empty Startup (or a public override void Configure(IFunctionsHostBuilder builder) that does nothing) and try publish that. If it works, build it up from there until you hit the error.

Startup.cs

using Microsoft.Azure.Functions.Extensions.DependencyInjection;

[assembly: FunctionsStartup(typeof(My.Namespace.FunctionApp.Startup))]

namespace My.Namespace.FunctionApp
{
    public class Startup : FunctionsStartup
    {
        public override void Configure(IFunctionsHostBuilder builder)
        {
        }
    }
}

@JohnGalt1717
Copy link

@kevinbrydon @plazav The bug you're getting is documented elsewhere and prevents overwritting IConfiguration within DI for things like loading Azure Keyvault. Do a search and you'll find the topic. Worked in 2.1, doesn't work in 3.1. There's a VERY ugly work around.

@ghost ghost added the no recent activity label Feb 4, 2020
@ghost
Copy link

ghost commented Feb 4, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@linzomsft
Copy link

@kevinbrydon @plazav The bug you're getting is documented elsewhere and prevents overwritting IConfiguration within DI for things like loading Azure Keyvault. Do a search and you'll find the topic. Worked in 2.1, doesn't work in 3.1. There's a VERY ugly work around.

Do you mind share What is work around? Thanks!

@plazav i am getting exactly the same issue you are getting during publish, nerver found it to be an issue running at my local environment.

@ghost ghost removed the no recent activity label Feb 4, 2020
@leighghunt
Copy link

@leighghunt Doesn't work :<

Hi @JohnGalt1717, I managed to get v3 of func working in a Ubuntu container.

I've tested this in a vanilla docker container (bionic image, so it's 18.04), so this should cover everything needed, and many steps probably not needed for you - just the last few.

I fire up the container like so:

docker run -ti ubuntu /bin/bash

Then, in that session, I run the following:

apt-get update
apt-get install -y wget unzip
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get update
apt-get install -y dotnet-runtime-3.1
wget https://github.com/Azure/azure-functions-core-tools/releases/download/3.0.2009/Azure.Functions.Cli.linux-x64.3.0.2009.zip
unzip -d azure-functions-cli Azure.Functions.Cli.linux-x64.3.0.2009.zip
cd azure-functions-cli
chmod +x func
./func

More info:

  • No apt-get cache, so update that
apt-get update
  • We need wget in next step, and unzip a few later on....
apt-get install -y wget unzip
  • Install 18.04 packages from Microsoft so we can install DotNet runtime
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get update
apt-get install -y dotnet-runtime-3.1
  • Get azure-functions-core-tools binaries (these need DotNet runtime to execute, hence previous step)
wget https://github.com/Azure/azure-functions-core-tools/releases/download/3.0.2009/Azure.Functions.Cli.linux-x64.3.0.2009.zip
unzip -d azure-functions-cli Azure.Functions.Cli.linux-x64.3.0.2009.zip
cd azure-functions-cli
chmod +x func
./func

I end up with:

root@c7f039870911:/azure-functions-cli# ./func

                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %

Azure Functions Core Tools (3.0.2009 Commit hash: 77395527a4e9c28da8400dcfd1a450f4e0d0c36c)
Function Runtime Version: 3.0.12930.0
Usage: func [context] [context] <action> [-/--options]

Contexts:
azure       Commands to log in to Azure and manage resources
durable     Commands for working with Durable Functions
extensions  Commands for installing extensions
function    Commands for creating and running functions locally
host        Commands for running the Functions host locally
kubernetes  Commands for working with Kubernetes and Azure Functions
settings    Commands for managing environment settings for the local Functions host
templates   Commands for listing available function templates

Actions: 
start   Launches the functions runtime host  
    --port [-p]        Local port to listen on. Default: 7071
    --cors             A comma separated list of CORS origins with no spaces. Example: https://functions.azure.com,https://functions-staging.azure.com
    --cors-credentials Allow cross-origin authenticated requests (i.e. cookies and the Authentication header)
    --timeout [-t]     Timeout for on the functions host to start in seconds. Default: 20 seconds.
    --useHttps         Bind to https://localhost:{port} rather than http://localhost:{port}. By default it creates and trusts a certificate.
    --cert             for use with --useHttps. The path to a pfx file that contains a private key
    --password         to use with --cert. Either the password, or a file that contains the password for the pfx file
    --language-worker  Arguments to configure the language worker.
    --no-build         Do no build current project before running. For dotnet projects only. Default is set to false.
    --enableAuth       Enable full authentication handling pipeline.
    --functions        A space seperated list of functions to load.

new     Create a new function from a template. Aliases: new, create
    --language [-l] Template programming language, such as C#, F#, JavaScript, etc.
    --template [-t] Template name
    --name [-n]     Function name
    --csx           use old style csx dotnet functions

init    Create a new Function App in the current folder. Initializes git repo.  
    --source-control       Run git init. Default is false.
    --worker-runtime       Runtime framework for the functions. Options are: dotnet, node, python, powershell
    --force                Force initializing
    --docker               Create a Dockerfile based on the selected worker runtime
    --docker-only          Adds a Dockerfile to an existing function app project. Will prompt for worker-runtime if not specified or set in local.settings.json
    --csx                  use csx dotnet functions
    --language             Initialize a language specific project. Currently supported when --worker-runtime set to node. Options are - "typescript" and "javascript"
    --managed-dependencies Installs managed dependencies. Currently, only the PowerShell worker runtime supports this functionality.

logs    Gets logs of Functions running on custom backends  
    --platform Hosting platform for the function app. Valid options: kubernetes
    --name     Function name

@JohnGalt1717
Copy link

@leighghunt Thanks. That's ultimately what I ended up doing too. It's really ugly and the only platform that makes you go through such hoops.

And if you look at the official approach, it's also at least 1 version of V2 behind for over a week as well.

This needs to be addressed so that packages are both released at the same time as everyone else gets them, and there's an easy and managed way to get beta channel releases. (especially when Azure Functions is so far behind in releasing current versions for .NET Core and the last version supported (.net 2.2) is no longer supported by MS forcing us all to use beta versions of Azure Functions or have major issues.

I'd suggest moving to npm like on Windows. Or Snaps with channels.

@ghost ghost added the no recent activity label Feb 9, 2020
@ghost
Copy link

ghost commented Feb 9, 2020

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost ghost closed this as completed Feb 12, 2020
@eliashdezr
Copy link

This should not be closed...

@ghost ghost removed the no recent activity label Feb 12, 2020
@JohnGalt1717
Copy link

Ya, this should be reopened because the issue is still there: This needs to be addressed by the team so that it's possible to actually get these on linux etc.

@VQuery
Copy link

VQuery commented Feb 17, 2020

Issue still exists in latest version.

@jeffhollan
Copy link

Reading through this issue, I think one of the problems is there seems to be a lot going on here. Everything from needing to make sure you are setting to ~3 in the cloud, using the v3 version of the core tools, and an updated version of the host that went out a few weeks back. I’m not saying there aren’t valid issues occurring, the the original post very likely could be resolved by one of those fixes (and a few others in the thread). For folks who are still hitting other issues, please feel free to open or flag a different issue. Please be sure to include as much detail as possible into what errors or issues you are hitting so we can track correctly. Want to make sure we resolve any issues that are occurring without also accidentally tracking 4 very different issues all under the same one.

@MichalKosowski
Copy link

Hi,

How about running
sudo apt-get install azure-functions-core-tools-3

That fixed the problem for me for Ubuntu on WSL (found this here: https://github.com/Azure/azure-functions-core-tools)

@leighghunt
Copy link

Hi,

How about running
sudo apt-get install azure-functions-core-tools-3

That fixed the problem for me for Ubuntu on WSL (found this here: https://github.com/Azure/azure-functions-core-tools)

Sweet - this now appears to be running, follwing Azure/azure-functions-core-tools@3f27711

My earlier test in docker container is now much shorter:

docker run -ti ubuntu /bin/bash

In that session:

apt-get update
apt-get install -y wget unzip
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get update
apt-get install azure-functions-core-tools-3

The running func:

root@702d83c30c66:/# func

                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %

Azure Functions Core Tools (3.0.2245 Commit hash: 1d094e2f3ef79b9a478a1621ea7ec3f93ac1910d)
Function Runtime Version: 3.0.13139.0
Usage: func [context] [context] <action> [-/--options]

Contexts:
azure       Commands to log in to Azure and manage resources
durable     Commands for working with Durable Functions
extensions  Commands for installing extensions
function    Commands for creating and running functions locally
host        Commands for running the Functions host locally
kubernetes  Commands for working with Kubernetes and Azure Functions
settings    Commands for managing environment settings for the local Functions host
templates   Commands for listing available function templates

Actions: 
start   Launches the functions runtime host  
    --port [-p]        Local port to listen on. Default: 7071
    --cors             A comma separated list of CORS origins with no spaces. Example: https://functions.azure.com,https://functions-staging.azure.com
    --cors-credentials Allow cross-origin authenticated requests (i.e. cookies and the Authentication header)
    --timeout [-t]     Timeout for on the functions host to start in seconds. Default: 20 seconds.
    --useHttps         Bind to https://localhost:{port} rather than http://localhost:{port}. By default it creates and trusts a certificate.
    --cert             for use with --useHttps. The path to a pfx file that contains a private key
    --password         to use with --cert. Either the password, or a file that contains the password for the pfx file
    --language-worker  Arguments to configure the language worker.
    --no-build         Do no build current project before running. For dotnet projects only. Default is set to false.
    --enableAuth       Enable full authentication handling pipeline.
    --functions        A space seperated list of functions to load.

new     Create a new function from a template. Aliases: new, create
    --language [-l] Template programming language, such as C#, F#, JavaScript, etc.
    --template [-t] Template name
    --name [-n]     Function name
    --csx           use old style csx dotnet functions

init    Create a new Function App in the current folder. Initializes git repo.  
    --source-control       Run git init. Default is false.
    --worker-runtime       Runtime framework for the functions. Options are: dotnet, node, python, powershell
    --force                Force initializing
    --docker               Create a Dockerfile based on the selected worker runtime
    --docker-only          Adds a Dockerfile to an existing function app project. Will prompt for worker-runtime if not specified or set in local.settings.json
    --csx                  use csx dotnet functions
    --language             Initialize a language specific project. Currently supported when --worker-runtime set to node. Options are - "typescript" and "javascript"
    --managed-dependencies Installs managed dependencies. Currently, only the PowerShell worker runtime supports this functionality.

logs    Gets logs of Functions running on custom backends  
    --platform Hosting platform for the function app. Valid options: kubernetes
    --name     Function name

@eliashdezr
Copy link

I posted a sample to reproduce the DependencyInjection error with the minimum stuff here:

https://github.com/Azure/azure-functions-dotnet-extensions/issues/36#issuecomment-594979004

@JohnGalt1717
Copy link

@leighghunt As previously stated, that works NOW because the final version has been released. The issue is that pre-releases cannot be pulled any other way but manually right now and it needs to be corrected so that Linux has parity with Windows and Mac.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests