How to do it...

We will create a simple Azure Java project as follows:.

  1. Create a new directory for the project and run the mvn archetype:generate command, given as follows:
mvn archetype:generate 
-DarchetypeGroupId=com.microsoft.azure
-DarchetypeArtifactId=azure-functions-archetype


Note: If you are using Windows, you may replace  with ^.

Provide values for the variables, as follows:

    • Define the value for the 'groupId': tech.heartin.books.serverless-cookbook  property 
    • Define the value for the 'artifactId' : helloworld-azure-fn  property 
    • Define the value for the 'version' 1.0-SNAPSHOT : : property 
    • Define the value for the 'package': tech.heartin.books.serverlesscookbook property 
    • Define the value for the 'appName' : HelloWorldAzureFn property 
    • Define the value for the 'appRegion' 'westus': property 
    • Define the value for the 'resourceGroup' java-functions-group: : property 
    • Confirm the properties configuration using:Y::

This will create a project in the helloworld-azure-fn directory that is the  same as our artifact ID.

  1. Go inside the project directory and run mvn clean package
  2. Next, run mvn azure-functions:run

We should see the following within the output:

  1. Invoke the following URL: http://localhost:7071/api/HttpTrigger-Java?name=Heartin

We should see the response in the browser as follows:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.104.183