Skip to content

Instantly share code, notes, and snippets.

@christopheranderson
Last active November 21, 2017 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christopheranderson/cdde001020fb15271e3f6b9fd6fab154 to your computer and use it in GitHub Desktop.
Save christopheranderson/cdde001020fb15271e3f6b9fd6fab154 to your computer and use it in GitHub Desktop.
Use Functions in Visual Studio

How to use Functions in Visual Studio

This is super hacky, but just wanted to leave the notes somewhere reusable that isn't official documentation. This isn't "recommended", but it is possible. :)

  1. Create your Functions via the Azure Functions portal UX is the easiest way. Otherwise, just follow the file format rules on the Azure Functions located here.
  2. Download them via your scm site - {function app name}.scm.azurewebsites.net -> DebugConsole -> cd ./site -> click on the "download" button for wwwroot
  3. Open Visual Studio, create a new Website, choose your unzipped wwwroot folder.
  4. Now you should see all your Functions in a directory in your Visual Studio. You can edit them here. etc.
  5. To Publish - Just right-click->publish on the project, choose an existing Web App (even though it's a function app, it speaks Web App apis, so it shows up here). Then publish with your changes. If might fail, just click on the "App Service Publishing" box at the bottom of VS and click "publish" from there. That should work.

Caveats

  1. You need App Settings for various secrets/connection strings. These can't be modified except via Azure API calls. The best is to do this via the portal still. You can update via an ARM template if you need to do something locally.
  2. You cannot run locally, easily. You can potentially download the script runtime locally and set up local env variables for the secrests, etc. Find more about that here - https://github.com/Azure/azure-webjobs-sdk-script/wiki

Feedback

This is clearly not great, but it's possible. Feel free to leave comments here or tweet @crandycodes with any feedback on the tooling story. We'll be getting some better stuff rolling around tooling very soon. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment