Try the new version of the workflow: Alfred JetBrains
Now, extend your function by.Since 2019.1 versions, the behaviour of JetBrains bin change. You've created a Java project with an HTTP triggered function, run it on your local machine, and deployed it to Azure. Right click on the package and select New -> Azure Function Class.įill in the class name HttpTest and select HttpTrigger in the create function class wizard, click OK to create, in this way, you can create new functions as you want. Right click on your HttpTrigger-Java function app, and select Trigger Function, you will see that the browser is opened with the trigger URL. You can manage your function apps with Azure Explorer in your IDEA, click on Function App, you will see all your function apps here.Ĭlick to select on one of your function apps, and right click, select Show Properties to open the detail page. Click OK and the new function app you just created will be automatically selected. Type in the function app name and choose proper platform, here we can simply accept default. If you don't have any Function App yet, click + in the Function line. Right click your project in IntelliJ Project explorer, select Azure -> Deploy to Azure Functions Stop the debug session by click the stop button. If you don't see the toolbar, enable it by choosing View > Appearance > Toolbar.Ĭlick on line 20 of the file src/main/java/org/example/functions/HttpTriggerFunction.java to add a breakpoint, access the endpoint again, you will find the breakpoint is hit, you can try more debug features like step, watch, evaluation.
To debug the function code in your project locally, select the Debug button in the toolbar. The log is also printed out in your IDEA, now, stop the function app by clicking the stop button. You can try the function by accessing the printed endpoint from browser, like Beside the line 17, you will notice that there is a green Run button, click it and select Run 'azure-function-exam.', you will see that your function app is running locally with a few logs.
Navigate to src/main/java/org/example/functions/HttpTriggerFunction.java to see the code generated. Select Http Trigger, then click Next and follow the wizard to go through all the configurations in the following pages confirm your project location then click Finish Intellj IDEA will then open your new project. Open IntelliJ Welcome dialog, select Create New Project to open a new Project wizard, select Azure Functions. Later in this article, you'll publish your function code to Azure. In this section, you use Azure Toolkit for IntelliJ to create a local Azure Functions project. In the Select Subscriptions dialog box, select the subscriptions that you want to use, and then click Select. In the browser, paste your device code (which has been copied when you click Copy&Open in last step) and then click Next. In the Azure Sign In window, select Device Login, and then click Sign in ( other sign in options).Ĭlick Copy&Open in Azure Device Login dialog. To sign in to your Azure account, open sidebar Azure Explorer, and then click the Azure Sign In icon in the bar on top (or from IDEA menu Tools/Azure/Azure Sign in). After installed, click Restart to activate the plugin. Then, find the Azure Toolkit for IntelliJ in the Marketplace and click Install. In IntelliJ IDEA's Settings/Preferences dialog (Ctrl+Alt+S), select Plugins.
To create and publish Java functions to Azure using IntelliJ, install the following software:
If you don't have an Azure subscription, create a free account before you begin.
How to create an HTTP-triggered Java function in an IntelliJ IDEA project.