Upgrade azure artifacts and update docs

This commit is contained in:
Bruno Borges
2018-05-29 17:06:20 -07:00
committed by Dave Syer
parent d322643433
commit 37d0d9500d
8 changed files with 55 additions and 107 deletions

View File

@@ -0,0 +1,32 @@
You can run this sample locally, just like the other Spring Cloud Function samples:
----
mvn spring-boot:run
----
and `curl -H "Content-Type: text/plain" localhost:8080/function -d '{"value": "hello foobar"}'`.
To run locally on top of Azure Functions, and to deploy to your live Azure environment, you will need the Azure Functions Core Tools installed along with the Azure CLI (see https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven for more details).
Run Azure Function locally:
----
mvn azure-functions:run
----
To deploy the function on your live Azure environment:
----
$ az login
$ mvn azure-functions:deploy
----
On another terminal try this: `curl https://<azure-function-url-from-the-log>/api/uppercase -d '{"value": "hello foobar!"}'`. Please ensure that you use the right URL for the function above. Alternatively you can test the function in the Azure Dashboard UI (click on the function name, go to the right hand side and click "Test" and to the bottom right, "Run").
The input type for the function in the Azure sample is a Foo with a single property called "value". So you need this to test it with something like below:
----
{
"value": "foobar"
}
----

View File

@@ -23,6 +23,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<functionAppName>function-sample-azure</functionAppName>
<functionAppRegion>westus</functionAppRegion>
<functionResourceGroup>java-function-group</functionResourceGroup>
<reactor.version>3.1.2.RELEASE</reactor.version>
<start-class>example.Config</start-class>
</properties>
@@ -37,12 +38,6 @@
<artifactId>spring-cloud-starter-function-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-java-core</artifactId>
<version>1.0.0-beta-2</version>
<scope>provided</scope>
</dependency>
<!-- Test -->
<dependency>
@@ -74,7 +69,7 @@
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<version>0.1.6</version>
<version>1.0.0-beta-1</version>
</plugin>
</plugins>
</pluginManagement>
@@ -91,7 +86,7 @@
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-functions-maven-plugin</artifactId>
<configuration>
<resourceGroup>java-functions-group</resourceGroup>
<resourceGroup>${functionResourceGroup}</resourceGroup>
<appName>${functionAppName}</appName>
<region>${functionAppRegion}</region>
<appSettings>

View File

@@ -8,7 +8,6 @@
"direction": "in",
"authLevel": "anonymous",
"methods": [
"get",
"post"
]
},