GithubHelp home page GithubHelp logo

microsoft / vscode-azurefunctions Goto Github PK

View Code? Open in Web Editor NEW
290.0 36.0 131.0 48.1 MB

Azure Functions extension for VS Code

Home Page: https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions

License: MIT License

TypeScript 97.45% C# 2.23% Shell 0.09% JavaScript 0.24%
vscode azure functions serverless

vscode-azurefunctions's Introduction

Azure Functions for Visual Studio Code

Version Installs Build Status

Use the Azure Functions extension to quickly create, debug, manage, and deploy serverless apps directly from VS Code. Check out the Azure serverless community library to view sample projects.

Visit the wiki for more information about Azure Functions and how to use the advanced features of this extension.

Sign up today for your free Azure account and receive 12 months of free popular services, $200 free credit and 25+ always free services πŸ‘‰ Start Free.

Create your first serverless app

  1. Select the button to create a new project in the Azure Functions explorer

    createNewProject

  2. Select a new, empty folder to contain your project

  3. Select your desired programming language

  4. Select "HTTP trigger" for your project's first function

  5. Use "HttpTrigger1" as the function name

  6. Select "Anonymous" for the authorization level, which enables anyone to call your function endpoint without a key.

    To learn more about authorization levels, see here.

  7. If the selected folder is not already open, select "Open in current window" to open it

Run the serverless app locally

This extension integrates with the Azure Functions Core Tools to let you run your project locally before publishing to Azure.

  1. To start your project, press F5 or the "play" button

    debug

  2. If you do not have the Azure Functions Core Tools installed, you will be automatically prompted to install. Follow the specified instructions, or skip to the "Deploy" step if you would rather deploy without running locally.

    TIP: The "Terminal" panel should pop up automatically and you know your project is running if you see output

  3. Expand your local project in the Azure Functions explorer to copy your function's url

    debug2

  4. Navigate to a browser, paste the url, and append ?name=world

    TIP: Your url should look like this: http://localhost:7071/api/HttpTrigger1?name=world

  5. A response of "Hello world" is returned in the browser and you know your function worked!

  6. Select the "Detach" button to stop your project from running locally

    debug3

Deploy to Azure

  1. Sign in to your Azure Account by clicking "Sign in to Azure..." in the Azure Functions explorer

    If you don't already have an Azure Account, click "Create a Free Azure Account"

  2. Select the 'plus' button to open the "Create Resource" menu

    Create resource

  3. Choose "Create Function App in Azure..."

    Create Function App in Azure

  4. Enter a globally unique name for your Function App

  5. If multiple versions of your language's runtime are supported (i.e. Node.js 10 and Node.js 12), select your desired version (the latest is recommended)

  6. Select a location

  7. Wait for your Function App to be created. Progress will be shown in the Activity Log panel

    deploy2

  8. Once your Function App has been created, reveal the resource in the Resources view.

    Finished creating Function App

  9. Right click your Function App and select "Deploy to Function App"

    Deploy to Function App

  10. Once deployment is complete, expand your subscription in the Azure Functions explorer to copy your deployed function's url

    deploy3

  11. Navigate to a browser, paste the url, and append ?name=world

    TIP: Your url should look like this: https://<function app name>.azurewebsites.net/api/HttpTrigger1?name=world

  12. A response of "Hello world" is returned in the browser and you know your function worked!

Contributing

There are a couple of ways you can contribute to this repo:

  • Ideas, feature requests and bugs: We are open to all ideas and we want to get rid of bugs! Use the Issues section to either report a new issue, provide your ideas or contribute to existing threads.
  • Documentation: Found a typo or strangely worded sentences? Submit a PR!
  • Code: Contribute bug fixes, features or design changes:
    • Clone the repository locally and open in VS Code.
    • Run "Extensions: Show Recommended Extensions" from the command palette and install all extensions listed under "Workspace Recommendations"
    • Open the terminal (press CTRL+ `) and run npm install.
    • To build, press F1 and type in Tasks: Run Build Task.
    • Debug: press F5 to start debugging the extension.

Legal

Before we can accept your pull request you will need to sign a Contribution License Agreement. All you need to do is to submit a pull request, then the PR will get appropriately labelled (e.g. cla-required, cla-norequired, cla-signed, cla-already-signed). If you already signed the agreement we will continue with reviewing the PR, otherwise system will tell you how you can sign the CLA. Once you sign the CLA all future PR's will be labeled as cla-signed.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Telemetry

VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don’t wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.

Lifecycle

The Azure Functions extension for VS Code follows the Modern Lifecycle Policy. Follow instructions here to get the latest updates of the extension.

Support Dates

Version Start Date Retirement Date
1.x 10/20/2020 In Support

License

MIT

vscode-azurefunctions's People

Contributors

alexweininger avatar anthonychu avatar bwateratmsft avatar chrisdias avatar dependabot[bot] avatar ejizba avatar fiveisprime avatar flanker32 avatar francisco-gamino avatar github-actions[bot] avatar hazhzeng avatar hossam-nasr avatar jasonyemsft avatar jdneo avatar mattchenderson avatar microfish91 avatar microsoftopensource avatar motm32 avatar mrayermannmsft avatar mrcrane avatar msftjade avatar msimecek avatar nturinski avatar nvolcz avatar philliphoff avatar stephenweatherford avatar tony-xia avatar tylerleonhardt avatar v-wuzhai avatar whiskeyjay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-azurefunctions's Issues

Fix entry points for zip deploy

My first iteration of zip deploy has two entry points (command palette and functions explorer) with the same "Deploy as Zip Package" label.

Ideally we should have three entry points with a context-specific label for each. Initial proposal:

  1. Command palette "Deploy as zip package"
  2. Functions explorer: "Deploy here as zip package"
  3. File explorer: "Deploy to Function App as zip package"

Create Azure Function App

This is for creating a function app in Azure (as opposed to creating a function app project locally)

Add CosmosDB trigger to 'verified' list of templates

This should be working, but I still need to validate. Plus, I think the user has to install something separately, so we need to make sure the error message is helpful if they don't have that tool installed.

Probably worth checking all Core templates to see if any other ones can be added to the 'Verified' category as well

Show slots in explorer

Slots (preview)

The user has to set some environment variable to enable slots. We should handle that appropriately (warn the user or something)

Open In Portal command doesn't work

Hi team,
When I use the command pallette to run the "Open in Portal" command from the Azure Functions extension, nothing happens. I'm already logged in to my Azure Subscription and I have successfully published a Function but I'm unable to use the command to Open the Azure Portal.
Is this still not feature-complete?

F5 doesn't work on Node <v8.0

Today we're hard-coding the debug protocol to be 'inspector' which only works on Node 8.0+.

Ideally we remove the protocol and VSCode auto-detects whether it needs to use "legacy" or "inspector" protocol - however that wasn't working for me on Node 8.0+
screen shot 2017-10-05 at 1 51 57 pm

VSCode checks this url to detect the version http://localhost:5858/json/version. It's possible that url isn't up until after Job host started is printed.

This could also be related (the func cli does not use the default 9229 port for debugging v8.0+): Azure/azure-functions-core-tools#261

Include function URL in logs

Love this extension! Thank you for creating it.

Right now when publishing a new function to Azure the logs will give you the link to the function app but not for the individual functions. So this means that in order to test that my function has been deployed successfully I still need to go open the portal and copy manually the URL. Would be great to have the function url included in the logs.

Show Proxies in Explorer

Open in portal isn't possible at the moment for proxies. We have to figure out a basic command that we can do to warrant showing these in the explorer

Add support for C# scripts

Was just testing the extension and it looks like when adding a new function it add for js only. Would be good to see it also support C#.

remove "zip" from deploy command naming

Since zip deploy is the only way to deploy (right now) I suggest we remove the zip references from the commands. For example, when i right click on a function i see Deploy here as zip. Can we change this to Deploy Function to Azure.

Same for right clicking in the Explorer, we can say Deploy Function to Azure

and in the command palette, i would change it to say Deploy Function to Azure

i'll open a similar issue on the app service extension

Show Function App details

Show Functions and Proxies for a Functions App on Azure in the tree. We should ignore Slots for now since they require extra setup while in preview. Show the following options for each resource

Function

  • Show (stream) logs
  • Copy URL
  • Show in Portal

Proxy

  • Show in Portal

Deploy as Zip is not deploying node_modules

When using the deploy as zip feature, it is not deploying the node_modules folder to the destination. As a result, the function is missing the modules. You'd have to manually go into the server through Kudu and run npm i. In comparison, the Function cli copies all folders (including node_modules) when doing publish.

Steps to reproduce:

  1. Create function app in Code
  2. Add node modules, e..g npm install redis
  3. Add reference to redis in function code
  4. Deploy as zip from Code
  5. Check function in Azure: node_modules is not present.

Support add Java Function into Java Function Project

May include following steps:

  • select project folder
  • if contains pom.xml, treat as Java project, otherwise treat as Javascript
  • Using Maven command (leveraging maven function plugin) to add function (in the future may change to use function cli)

Creating a new function app on deploy doesn't refresh tree

Repro:
Initialize a local function app; add a function; run "deploy to function app" (either command pallet or blue deploy arrow); choose to create a new app, run through the prompts and let it deploy.

Expected:
Treeview to reload and contain the new app

Actual:
Treeview does not reload at all.

0.3.0 Java Support Endgame

Features:

Bug fixes and improvements:

Please refer to https://github.com/Microsoft/vscode-azurefunctions/milestone/4 for details.

Test plan:

On MacOS @Eskibear

  • Can create Java function project
  • Can add Java function
  • Can deploy Java function project to cloud
  • Can local debug Java function through Java Extension Pack

On Windows @adashen

  • Can create Java function project
  • Can add Java function
  • Can deploy Java function project to cloud
  • Can local debug Java function through Java Extension Pack

On Linux @bsaby

  • Can create Java function project
  • Can add Java function
  • Can deploy Java function project to cloud
  • Can local debug Java function through Java Extension Pack

Refactor the java project creation logic when HTTP API is ready.

Currently, since there is no host endpoint that can provide Java Azure Functions templates. To get the Java function metadata, we are leveraging other language's metadata to create a new Java function.

Code here needs to change when java project creation logic when HTTP API is ready.

Decrease package size

Today we package up the entire extension folder in our vsix

Ideally we use a .vscodeignore file or the files attribute of package.json to reduce the size of our extension on user's machine

We could also consider reducing the size of our gifs

Support deploy Java Function

May contain following steps:

  • select folder
  • if not contains pom.xml, zip and upload
  • if contains pom.xml, treat as Java Function Project, list folders under ./target/azure-functions(which are output of the mvn package command)
  • select a folder, zip and deploy

Java HttpTrigger fails to build

There is an error when build an added Java function:

Erics-MacBook-Pro:aa ericjizba$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Azure Java Functions 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ aa ---
[INFO] Deleting /Users/ericjizba/TestRepos/aa/aa/target
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ aa ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/ericjizba/TestRepos/aa/aa/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ aa ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/ericjizba/TestRepos/aa/aa/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING :
[INFO] -------------------------------------------------------------
[WARNING] /Users/ericjizba/TestRepos/aa/aa/src/main/java/com/function3/Function.java: Some input files use unchecked or unsafe operations.
[WARNING] /Users/ericjizba/TestRepos/aa/aa/src/main/java/com/function3/Function.java: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/ericjizba/TestRepos/aa/aa/src/main/java/com/function/HttpTriggerJava.java:[23,55] incompatible types: java.lang.Object cannot be converted to java.lang.String
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.962 s
[INFO] Finished at: 2017-11-27T13:22:25-08:00
[INFO] Final Memory: 16M/298M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project aa: Compilation failure
[ERROR] /Users/ericjizba/TestRepos/aa/aa/src/main/java/com/function/HttpTriggerJava.java:[23,55] incompatible types: java.lang.Object cannot be converted to java.lang.String
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.