Azure function in Java, http layer generated based on openapi - azure

I saw https://azure.microsoft.com/en-in/updates/generate-a-new-function-app-from-an-openapi-specification/
so in VSCode v1.63.2, azure functions plugin v1.6.0
but when I go to azure extension and then "Create new project" when I select Java I dont have any option to choose template ( http trigger ) but in Java I dont see this option ..
Anyone had maybe similar issue ?
thanks

To create a Java Azure Function with HTTP Trigger in VS CODE we need to configure as our environment as given here .
Java Development Kit, version 11 or 8.
Apache Maven, version 3.0 or above.
Visual Studio Code on one of the supported platforms.
The Java extension pack
The Azure Functions extension for Visual Studio Code.
As we have already configured the same in our environment, We have created One Azure Function using java which is using HTTP trigger.
In VS CODE for java when you will follow this Microsoft Documentation you can able to Create an Azure function using java with http trigger by providing the details.
SCREENSHOT FOR REFERENCE:-
For more information please refer this MICROSOFT DOCUMENTATION: Develop Azure Functions by using Visual Studio Code

Related

How to debug a legacy Azure function

I've been given the task to debug an Azure function on VS 2022 targeting .Net Framework 4.8. While its straight forward to debug it in .Net Core 3.0 or later, I keep getting the error - A project with an Output Type of Class Library cannot be started directly, when I try to run it by pressing F5. Looking around, I followed this link to download Azure functions core tools; https://github.com/Azure/azure-functions-core-tools but it hasn't worked even after restarting VS.The function has following properties:
While I can run and debug functions written in .Net Core 3.1 and .Net 6 but I'm struggling with this legacy function. Any help is really appreciated.
We have tried to create Azure function with .net framework 4.8 and successfully tested in our local by using visual studio 2022.
We have installed azure function core tool 4x on our local. Make sure that only one azure function core tool has installed on our local.
Created one azure function with http trigger by selecting .net framework and targeting it to version 4.8.
Able to debug successfully as shown below
For more information please refer this MICROSOFT DOCUMENTATION

VS2017: why cannot select Azure Functions for NetCore?

So I researched a lot about trying to create an Azure Functions project. Downloaded latest extensions, updated my VS2017 community, etc.
I still only get two options NetFw and NetStandard.
How can I use NetCore as the target?
For now .Net Core TargetFramework is not supported yet.
See the comment from Azure Functions team.
We expect to have manual steps that you can try by mid October, and our goal is to have all relevant template/tooling updates complete and deployed by the end of October.
Update
v2 Function project with .NET Core TargetFramework(netcoreapp2.1) support has been available, make sure VS >= 15.8(right now 15.8.8) and Azure Function and Web Jobs Tools(On VS menus>Tools>Extensions and Updates) is latest(15.10.2046 right now).

Google Cloud Module disappeared

After updating to Android Studio 3.0.1 I see there is no option to add a Google Cloud module, as you would to add a backend module for building endpoints using Objectify. Any tutorial tells you to add this module. Do we have to create it manually now or is there a completely different way to communicate with Appengine?
You must use Cloud Tools for IntelliJ now:
https://cloud.google.com/tools/android-studio/docs/
https://cloud.google.com/tools/intellij/docs/
Note: Creating App Engine-based cloud backends is not supported in Android Studio 3.0; however, your existing projects with cloud backends will continue to work in Android Studio.
To create a new App Engine Java project, you can use either Cloud Tools for Intellij or Cloud Tools for Eclipse.

Target .NET Core 2.0 with Azure Functions in Visual Studio 2017

Since Microsoft has released .NET Core 2.0 for Azure Functions a few days ago, I'm trying to understand how to create a new Functions project in VS2017 targeting .NET Core.
I've tried many configurations and still ended up with .NET 4.7.
Did anyone manage to create a new Function targeting .NET Core?
Thanks.
This is supported with the 1.0.5 release of the Microsoft.NET.Sdk.Functions package.
In your Azure Functions Project, do the following:
Update the Microsoft.NET.Sdk.Functions package version to 1.0.5
Right click on your project, click the Edit <projectname>.csproj option and modify the TargetFramework element value to netstandard2.0
This will should generate .NET Standard 2.0 assemblies with all the artifacts created by the Azure Functions tooling.
As of today I have been able to target .Net Standard 2.0 in a "reasonably" intuitive way and without editing any .csproj files.
You need a reasonably recent version of Visual Studio. I'm using Visual Studio Professional 15.5.3 (although I would guess that community would work).
You need to have the Azure development workload installed. This will install an extension called Azure Functions and Web Jobs Tools.
So far so plain vanilla. There were 2 additional bits that were to me not at all intuitive but ended up being very easy to do - easy when you know how!
You need to make sure that the Azure Functions and Web Jobs Tool is 15.0.31114.0 or greater - that's when they added .net core 2.0 support (see https://github.com/Azure/Azure-Functions/blob/master/VS-AzureTools-ReleaseNotes.md). You can update this using Tools/Extensions and Updates, or see https://marketplace.visualstudio.com/items?itemName=VisualStudioWebandAzureTools.AzureFunctionsandWebJobsTools
Even when you've done that, Visual Studio is a tiny bit weird about letting you create Azure Functions that target .net 2.0. When you go File/New Project, nothing has changed in the list of available project types, and if you select Azure Functions, the list of Frameworks just shows .NET Framework *, no .NET Standard, no .NET Core.
But if at this point you persevere and select Azure Functions, you then get a new dialog I hadn't seen before, which allows you to select Azure Functions v2 Preview (.NET Core).
Now, when I then look at the project properties, it turns out it is targeting .NET Standard 2.0, which in turn seems to contain Microsfot.NETCore.Platforms (1.1.0). So is this .net core 2.0 or not? Not quite sure but its' good enough for my purposes so now going to tuck into some coding.
Cheers!
For now, it's a manual process. You need to create .NET Standard 2.0 library, add function.json manually and run it with core tools.
the package Microsoft.NET.Sdk.Functions does not yet support .NET Standard 2.0 class libraries. This is the package that identifies a project as Functions project to Visual Studio and generates function.json from attributes during build.
You can still author C# class libraries that target .NET Standard 2.0, but you must use a manually-authored function.json. The templates for C# class libraries aren’t yet available in the Core Tools, but you can get a sample from GitHub.
from Develop Azure Functions on any platform
Update: 1.0.5 version of SDK should now support it, as mentioned by Fabio.

How do I transfer a Azure Function script to Visual Studio?

If I create an Azure Function in the Azure portal, how do I grab the script and edit it in Visual Studio? I know I can copy the C# code from the script window but that's only part of the Function. How do I grab everything - the code, triggers, outputs, etc. - and take that into Visual Studio?
There's a button right in the Function App blade in Azure that allows you to download the contents of the function app:
You can even choose to download the Content and the Visual Studio project so you can directly import it into VS. However, as Travis mentioned you should really be doing this the other way around and keeping your development in VS and then using one of the various deployment options to push your functions to Azure.
You can use FTP or Kudu(.scm.azurewebsites.net) to download the app contents.
Generally speaking though if you want to work in Visual Studio it's better to do your work there and then deploy to the app with one of the several deployment options.
Once your migrate the files (as noted in the other answers), you'll also note that Visual Studio encourages a different programming model than the portal:
Precompile *.cs instead of .csx
Instead of Function.json, you use the attributes (ala WebJobs SDK).
So to fully work in VS and leverage the VS build system (and unit tests, and other VS features), you'll need to migrate your code.
See https://blogs.msdn.microsoft.com/webdev/2017/05/10/azure-function-tools-for-visual-studio-2017/ for more detail on webjobs.

Resources