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

Functions Tooling is incompatible with Azure SDK 3.0.0 #203

Closed
meikelenboom opened this issue Mar 8, 2017 · 56 comments

Comments

Projects
None yet
@meikelenboom
Copy link

commented Mar 8, 2017

I was using the preview project template in Visual Studio 2015 as part of a presentation I'm giving next week.

Today I've updated the Azure 2.9.6 .NET SDK to version 3.0.0 and I've updated my VS 2017 RC to RTM. With these updates, the project template has gone missing. And I can't seem te get it back. I tried to revert the SDK back to 2.9.6 and I've reinstalled the preview tools again. Unfortunately that doesn't seem to work.

Any suggestions or alternatives?

@GenesisCoast

This comment has been minimized.

Copy link

commented Mar 9, 2017

@meikelenboom I am having the same problem to, any luck yet?

@meikelenboom

This comment has been minimized.

Copy link
Author

commented Mar 9, 2017

No luck so far. Had a chat with Andrew Hall on twitter (@AndrewBrianHall), although he's very helpful, it's not solved yet.

@GenesisCoast did you do any of the updates I did?

@GenesisCoast

This comment has been minimized.

Copy link

commented Mar 10, 2017

Yep, I upgraded the Azure SDK to 3.0.0 and installed VS 2017 and then the project template went missing and VS refused to open any existing function projects. Tried reinstalling VS, Tools, SDK etc... But nothing has currently made a difference.

@GenesisCoast

This comment has been minimized.

Copy link

commented Mar 10, 2017

I just tried completely nuked the entire VS installation. Still no luck. I am wondering if it has something to do with the recent Azure SDK release 3.0?

@meikelenboom

This comment has been minimized.

Copy link
Author

commented Mar 10, 2017

I reverted the SDK back to 2.9.6 (the version recommended in the blog post) and that didn't solve it either.

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2017

We're trying to find a workaround, I'll update this thread shortly.

@lindydonna lindydonna changed the title Visual Studio 2015 Tooling missing Functions Tooling is incompatible with Azure SDK 3.0.0 Mar 10, 2017

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2017

Here's the workaround:

  1. Close VS 2015

  2. Uninstall Microsoft Azure App Service Tools v3.0.0 from the Windows "uninstall or change a program dialog". This does not uninstall the rest of the Azure SDK 3.0, just the App Service parts.

    image

  3. Reinstall the Azure Functions Tooling: https://aka.ms/azfunctiontools

@mikeeager

This comment has been minimized.

Copy link

commented Mar 10, 2017

That workaround doesn't seem to work either.

@GenesisCoast

This comment has been minimized.

Copy link

commented Mar 10, 2017

Same for me.

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2017

@mikeeager The only other advice I can offer is to restart the machine and try running devenv setup from an admin developer command prompt. /Setup (devenv.exe)

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2017

@GenesisCoast and @mikeeager Did reinstalling the Functions Tools work without errors?

@mikeeager

This comment has been minimized.

Copy link

commented Mar 10, 2017

@lindydonna ...it was a clean install without errors.
broken

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2017

@mikeeager Try the devenv /setup command then from my previous comment

@GenesisCoast

This comment has been minimized.

Copy link

commented Mar 10, 2017

I have tried the above command. Reinstalling, Reinstall with Force. Removing all Visual studio Components and Doing a Clean install. I haven't had any luck with any possible workaround so far...

@nk-gears

This comment has been minimized.

Copy link

commented Mar 11, 2017

Same Issue. Azure Functions are missing even in VS 2015.

The following options doesn't work

  • UnInstalled VS 2015, Restarted and Installed Fresh Copy
  • UnInstalled Azure SDK 3.0
  • Tried devnev /resetsettings, devenv /installvstemplates, devenv /setup. : None of this resolved the Issue.
  • UnInstalled Azure SDK 2.9.6 and Re-Installed
  • Copied the Project Templates from Peer and Copied to ProjectTemplates Cache. But the error says "The template location not found"
  • Explored the Registry Package to check whether that ClassId (AzureFunctions) is registered. But i can't see one
@GenesisCoast

This comment has been minimized.

Copy link

commented Mar 13, 2017

I have just tried a clean windows install on a VM. Azure Functions Preview Installed fine. However if the Azure SDK 3.0 is installed or has been previously installed at any point on the machine, you will not be able to use the Azure Functions Preview at all.

@nk-gears

This comment has been minimized.

Copy link

commented Mar 14, 2017

Any Luck or Temporary Workaround?

@Intranoggin

This comment has been minimized.

Copy link

commented Mar 14, 2017

I've gone so far as to uninstall both VS 2017 and VS 2015 and all their related components. After reinstalling just the VS2015 Azure SDK 2.9.6, and the function tools, I'm in worse shape. I see the function project available, but when i try to create a new one, or open an existing function project, it throws a VsProjectFault.txt file into the appdata/local/temp directory. The log always contains this message:
3/14/2017 8:31:08 AM
Recoverable
System.Exception: The following error occurred during discovery of project files on disk. The operation was canceled..
at Microsoft.VisualStudio.Web.WindowsAzure.AzureFunctions.ProjectSystem.FileMirroring.SourceItemsInMemoryProject.d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Web.WindowsAzure.AzureFunctions.ProjectSystem.FileMirroring.SourceItemsInMemoryProject.d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.AutoLoadMethodStateMachine.<b__6_0>d.MoveNext()
VsProjectFault_5445d7f3-b4b6-40b4-80af-0874637a7ccc.failure.txt

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2017

@Intranoggin Thanks for reporting, and sorry to hear you're having so much trouble.

Here's a workaround: you can instead create a Web Application project and customize the "Start Action" to run the Functions CLI, which will attach a debugger. Here are the steps: https://github.com/lindydonna/CoderCardsv2#local-debugging-in-visual-studio

I'll have a blog post in a few days that walks through from start to finish.

@nk-gears

This comment has been minimized.

Copy link

commented Mar 15, 2017

Finally able to resolve temporarily in a Harsh way

  • UnInstalled SDK 3.0, Installed again the SDK 2.9.6
  • Added Missing Entries in Registry
  • Copied the Necessary Packages and DLL's to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools Azure
    azurefunctions
@Intranoggin

This comment has been minimized.

Copy link

commented Mar 15, 2017

@lindydonna Unfortunately still no luck. I tried cloning that project on two machines and couldn't get it running on either.

1 machine still has VS 2017 installed. After reading host.json, this one says "ScriptHost initialization failed. Microsoft.WindowsAzure.storage: unable to connect to the remote server. System: unable to connect to the remote server. System: no connection could be made the target machine actively refused it 127.0.0.1:10000

The other machine has on vs 2015 installed (but had 2017 installed and removed). This one launches the functions cli, which then immediately crashes. A red message appears just before it crashes, but is not there long enough to read. No logs are being generated that I can locate.

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2017

@Intranoggin It's probably an issue with the Functions CLI not being able to open a port. Can you launch the Functions CLI directly from a command prompt? Use func host start. If that doesn't work, try running from an elevated prompt.

@Intranoggin

This comment has been minimized.

Copy link

commented Mar 15, 2017

@lindydonna
The VS 2017 machine still gives the connection actively refused message.

With this method, I can now read the error on the VS 2015 machine. It says HTTP could not register URL http://+:7071 because TCP port 7071 is being used by another application."

Changing to an elevated prompt didn't seem to alter the behavior, possibly because I had already opened VS as the administrative user.

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2017

@Intranoggin Ah yes, there is a situation where the port handle can be allocated to an app that is no longer running. In the CLI we have a bug to use a new port if the existing one is taken.

Try passing an explicit port via "-p 7072" for instance. Visual Studio always uses 7071.

@Intranoggin

This comment has been minimized.

Copy link

commented Mar 16, 2017

@lindydonna , Using the Compiled function method you linked to, I was able to get it running from VS 2017!

The port issue you pointed to was solved with the -p as you indicated.

The System: no connection could be made the target machine actively refused it 127.0.0.1:10000 issue was because I had not yet initialized the Azure Storage Emulator (I had reinstalled it).

On my VS 2015 install, my web deploy is now broken, but if i can get it working in VS 2017 that won't be an issue.

Where I'm at now is trying to create the hello world http triggered function. The code from the sample function uses HttpRequestMessage.GetQueryNameValuePairs and req.CreateResponse(HttpStatusCode.OK, "Hello " + name);

From what I can tell, those come from extension methonds in system.net.http and are sourced from the system.web.http.dll. However, I can't seem to locate that .dll in my VS2017 references or in Nuget. Any ideas how I can add that reference?

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2017

I've posted a blog with detailed instructions on how to use precompiled functions in VS, which is the direction we'll take with the new tooling: https://aka.ms/precompiled-functions

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 16, 2017

@Intranoggin Afaik it's Microsoft.AspNet.WebApi.Client as specified in packages.config: https://github.com/lindydonna/FunctionsAsWebProject/blob/master/FunctionsAsWebProject/packages.config#L3

However, you may also need to install one of the ASP.NET SDKs on your machine. Docs on HttpRequestMessageExtensions.GetQueryNameValuePairs in case it helps.

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2017

@mikeeager That should work fine, I do this all the time.

Make sure that you don't have encrypted settings in appsettings.json. Also make sure the structure is correct; it has a property for whether or not the contents are encrypted.

Should look like this:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": ""
  },
  "ConnectionStrings": {}
}
@mikeeager

This comment has been minimized.

Copy link

commented Mar 21, 2017

You are a life saver!!! I've been fighting this one for awhile. All good now and thank you so much. Seems there is much to learn for others in this thread.

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2017

@mikeeager In the future, the tooling will help with these connection strings.

You can also use the Functions CLI to add and edit them. Do func settings add and func azure functionapp fetch-app-settings

@dreadeddev

This comment has been minimized.

Copy link

commented Mar 22, 2017

Ok, so following this thread all the way through it seems unless you do a lot of hacking (a post mentioned adding missing registry settings but didn't say which ones) and copy of dll's, If you've installed 3.0 of the SDK you're basically fubar'd for working with Azure Functions locally??

Is my understanding correct?

And if so, that makes me worry for creating an architecture where basic development support has been withdrawn from the latest SDK? Can someone assure me that the SDK team are working on a patch for 3.0 to put Functions back in or should we all be running away from Functions as fast as we can and redoing them as an Azure WebJob (as essentially that's all they are anyway)

@SimonLuckenuik

This comment has been minimized.

Copy link

commented Mar 22, 2017

@dreadeddev, what is broken is the Visual Studio integration, not the "working locally part". The link posted by @lindydonna above should be sufficient to work locally with Azure Functions until they release the new VS Functions Tooling: https://aka.ms/precompiled-functions

@dreadeddev

This comment has been minimized.

Copy link

commented Mar 22, 2017

Well yes @SimonLuckenuik, but that's just semantics. essentially it was all working locally, they release an update that breaks it and so we now have to move everything from the original functions project into a new project, thus loosing all history etc in source control, and then will this project then just work with the new tooling? or will we need to repeat this process again? Pretty poor experience from the developer stand point! But thanks, will do the above as I'm guessing that waiting for "until they release the new VS Functions Tooling" is, an as yet, undetermined amount of time.

@dreadeddev

This comment has been minimized.

Copy link

commented Mar 22, 2017

Also, can I just check soemthing with you @SimonLuckenuik / @lindydonna

Are you recommending that we uninstall 3.0 and install 2.96 as from some of the comments here and on the other page it seems that when you do that it causes more issues later on when you need to upgrade again? Is there any workaround that works with 3.0 installed?

@SimonLuckenuik

This comment has been minimized.

Copy link

commented Mar 22, 2017

@dreadeddev, no need to be so upset, just trying to help here...

  • Azure Functions Visual Studio support tools are tagged as Preview for a reason, it's a preview that can change (Quote: "These tools are offered as a preview release and will have some rough spots and limitations" : https://blogs.msdn.microsoft.com/webdev/2016/12/01/visual-studio-tools-for-azure-functions/).
  • It was working locally with the CLI alone, before they released the tooling to include it in Visual Studio, and today the same approach with the CLI is still working.
  • The funproj project is simply including all files found in the folder by default and doesn't contain much. You probably never modified that specific project file after initial creation. The CLI execution relies on the content of the folder with the functions, not the funproj.
  • You will keep the exact same files at the exact same location, if for some reason you decide to do differently and move the files around, most, if not all, modern source control repository support moving and renaming files, so no impact there as well on your work history.
  • The only impact I can see is that you will add a new csproj file in a the funproj folder and that will probably cover most of it and at some point they will release a final "non preview" of the tooling is out you will either upgrade your funproj to the new format or simply take 5 minutes of your time to create a new project.
@dreadeddev

This comment has been minimized.

Copy link

commented Mar 22, 2017

@SimonLuckenuik Apologies if I come across stroppy, I tend to be a little sarcastic in life generally (as anyone whose worked with me will testify) however, tongue in cheek sarcasm doesn't always come across too well when typed! I appreciate the help! Much love guys!

@timmyreilly

This comment has been minimized.

Copy link

commented Mar 24, 2017

I've found a workaround following Donna's instructions on YouTube:
https://www.youtube.com/watch?v=R7F92POLGaE

But first you need a copy of the Azure.Functions.Cli version 2.9.6 somewhere on your machine.

You'll also need to directly reference the path to func.exe during init and new.
e.g:
C:\projects\FunctionsAsWebProj\FunctionsAsWebProj> C:\user\yourpath\Azure.Functions.Cli\1.0.0-beta.91\func.exe init

Follow Donna's instructions and extract the zip and you'll be back in Visual Studio.

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 24, 2017

@timmyreilly There's an easier way, simply download the CLI and unzip, or install from npm azure-functions-cli. (FYI I'm removing your OneDrive link out since I don't really want to recommend that approach).

This URL will give you a JSON payload with the URL of the latest CLI: https://aka.ms/functions-cli. Current latest is here: https://functionscdn.azureedge.net/public/1.0.0.beta.93/Azure.Functions.Cli.zip

@ChrisGarty

This comment has been minimized.

Copy link
Member

commented Mar 31, 2017

@lindydonna Installing from https://www.npmjs.com/package/azure-functions-cli and/or running func.exe from the latest CLI... don't seem to fix up Visual Studio so that New > Project > Templates > C# > Cloud will show a Azure Function template. How do I get that Visual Studio template from 2.9.6 back?
Thanks!

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Mar 31, 2017

@ChrisGarty Right, the Functions CLI won't fix the Visual Studio template back. You can try uninstalling Azure SDK 3.0 and re-installing 2.9.6, then the Functions Preview tooling.

Alternatively, just use a Web Project and customize your start action. See https://aka.ms/precompiled-functions for details. You can also convert your csx files to .cs, but that's optional.

@feeloor

This comment has been minimized.

Copy link

commented Apr 12, 2017

Is there any headways here? I've tried to re-install 2.9.6 and Functions Tooling with no luck. I've also tried installing Azure SDK 3.0 again and uninstalling Microsoft Azure App Service Tools v3.0.0 and then installing the Functions Tooling, no luck here either.

@Intranoggin

This comment has been minimized.

Copy link

commented Apr 12, 2017

I don't think there is a way that you can get successfully back to the 2.9.6 and working templates. You'll need to switch to the pre-compiled option.

@feeloor

This comment has been minimized.

Copy link

commented Apr 13, 2017

@Intranoggin Okey, thank you. Do you/anyone know when this will be fixed? Or any workarounds?

@Intranoggin

This comment has been minimized.

Copy link

commented Apr 13, 2017

@feeloor My interpretation is that moving to the pre-compiled technique is the fix. There may be a new template in the future that streamlines the setup of bindings and pointing to the CLI for local debugging, but I'm only guessing there.

@nk-gears

This comment has been minimized.

Copy link

commented Apr 13, 2017

I have provided some notes on how i resolved this issue. This may help someone who want to get rid off this blocker. https://medium.com/@nirmal_kumar/resolving-functions-tooling-incompatibility-with-azure-sdk-3-0-0-1708f28e7cb

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2017

@Intranoggin Yes, moving to precompiled is our recommendation. Aside from a better tooling experience, you will see performance improvements for cold start. We've just released a blog post about the tooling roadmap: https://blogs.msdn.microsoft.com/webdev/2017/04/14/azure-functions-tools-roadmap/

@dreadeddev

This comment has been minimized.

Copy link

commented Apr 19, 2017

@lindydonna lindydonna added the triaged label May 1, 2017

@gabrielius

This comment has been minimized.

Copy link

commented May 3, 2017

@nirmalkumarv The link is not accessible anymore...

Is there any way to get back to Azure SDK 2.9.6? I have problems when trying to publish using Visual Studio 2015 and don't want to publish using func.

@dreadeddev

This comment has been minimized.

Copy link

commented May 4, 2017

@gabrielius Unfortunately not!! It seems the way forward is with precompiled functions! It's a bit painful as it doesn't support everything that other apps do (like assembly binding redirection, etc) but seems to be the way forward. Once you've got it set up it works okay though. Link is https://github.com/Azure/azure-webjobs-sdk-script/wiki/Precompiled-functions

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented May 9, 2017

Closing this issue, as we don't plan to support the old Functions Tooling, and instead use the class library model. Stay tuned for more announcements at BUILD.

See https://blogs.msdn.microsoft.com/webdev/2017/04/14/azure-functions-tools-roadmap/ for more details

@lindydonna lindydonna closed this May 9, 2017

@BatriderLEL

This comment has been minimized.

Copy link

commented May 19, 2017

So still no fixes for VS15\17 on AzureFunctions template?

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented May 23, 2017

@ChrisGarty

This comment has been minimized.

Copy link
Member

commented May 24, 2017

Donna, the new VS2017 tooling looks great. Upgrade time :). Thanks!

@lindydonna

This comment has been minimized.

Copy link
Contributor

commented May 31, 2017

We recommend that customers use the new VS 2017 tools. The VS 2015 tools are no longer being maintained. See https://aka.ms/vs2017functiontools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.