Skip to content

Commit e40162e

Browse files
authored
Merge pull request #115785 from Flanker32/hanxiao/updateFunc
Update function gradle document
2 parents 8a25a47 + 014c375 commit e40162e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

articles/azure-functions/functions-create-first-java-gradle.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ azurefunctions {
5555
Open the new Function.java file from the *src/main/java* path in a text editor and review the generated code. This code is an [HTTP triggered](functions-bindings-http-webhook.md) function that echoes the body of the request.
5656

5757
> [!div class="nextstepaction"]
58-
> [I ran into an issue](https://www.research.net/r/javae2e?tutorial=functions-maven-quickstart&step=generate-project)
58+
> [I ran into an issue](https://www.research.net/r/javae2e?tutorial=functions-create-first-java-gradle&step=generate-project)
5959
6060
## Run the function locally
6161

@@ -88,14 +88,16 @@ curl -w "\n" http://localhost:7071/api/HttpExample --data AzureFunctions
8888
The expected output is the following:
8989

9090
<pre>
91-
Hello AzureFunctions!
91+
Hello, AzureFunctions
9292
</pre>
9393

94-
The [function key](functions-bindings-http-webhook-trigger.md#authorization-keys) isn't required when running locally.
94+
> [!NOTE]
95+
> If you set authLevel to `FUNCTION` or `ADMIN`, the [function key](functions-bindings-http-webhook-trigger.md#authorization-keys) isn't required when running locally.
96+
9597
Use `Ctrl+C` in the terminal to stop the function code.
9698

9799
> [!div class="nextstepaction"]
98-
> [I ran into an issue](https://www.research.net/r/javae2e?tutorial=functions-maven-quickstart&step=local-run)
100+
> [I ran into an issue](https://www.research.net/r/javae2e?tutorial=functions-create-first-java-gradle&step=local-run)
99101
100102
## Deploy the function to Azure
101103

@@ -123,20 +125,20 @@ This creates the following resources in Azure, based on the values in the build.
123125

124126
The deployment also packages the project files and deploys them to the new function app using [zip deployment](functions-deployment-technologies.md#zip-deploy), with run-from-package mode enabled.
125127

126-
Because the HTTP trigger we published uses `authLevel = AuthorizationLevel.FUNCTION`, you need to get the function key to call the function endpoint over HTTP. The easiest way to get the function key is from the [Azure portal].
128+
The authLevel for HTTP Trigger in sample project is `ANONYMOUS`, which will skip the authentication. However, if you use other authLevel like `FUNCTION` or `ADMIN`, you need to get the function key to call the function endpoint over HTTP. The easiest way to get the function key is from the [Azure portal].
127129

128130
> [!div class="nextstepaction"]
129-
> [I ran into an issue](https://www.research.net/r/javae2e?tutorial=functions-maven-quickstart&step=deploy)
131+
> [I ran into an issue](https://www.research.net/r/javae2e?tutorial=functions-create-first-java-gradle&step=deploy)
130132
131133
## Get the HTTP trigger URL
132134

133135
You can get the URL required to trigger your function, with the function key, from the Azure portal.
134136

135137
1. Browse to the [Azure portal], sign in, type the _appName_ of your function app into **Search** at the top of the page, and press enter.
136138

137-
1. In your function app, expand **Functions (Read Only)**, choose your function, then select **</> Get function URL** at the top right.
139+
1. In your function app, select **Functions**, choose your function, then click **</> Get Function Url** at the top right.
138140

139-
![Copy the function URL from the Azure portal](./media/functions-create-java-maven/get-function-url-portal.png)
141+
:::image type="content" source="./media/functions-create-first-java-gradle/get-function-url-portal.png" alt-text="Copy the function URL from the Azure portal":::
140142

141143
1. Choose **default (Function key)** and select **Copy**.
142144

@@ -147,17 +149,17 @@ You can now use the copied URL to access your function.
147149
To verify the function app running on Azure using `cURL`, replace the URL from the sample below with the URL that you copied from the portal.
148150

149151
```console
150-
curl -w "\n" https://fabrikam-functions-20190929094703749.azurewebsites.net/api/HttpExample?code=zYRohsTwBlZ68YF.... --data AzureFunctions
152+
curl -w "\n" http://azure-functions-sample-demo.azurewebsites.net/api/HttpExample --data AzureFunctions
151153
```
152154

153155
This sends a POST request to the function endpoint with `AzureFunctions` in the body of the request. You see the following response.
154156

155157
<pre>
156-
Hello AzureFunctions!
158+
Hello, AzureFunctions
157159
</pre>
158160

159161
> [!div class="nextstepaction"]
160-
> [I ran into an issue](https://www.research.net/r/javae2e?tutorial=functions-maven-quickstart&step=verify-deployment)
162+
> [I ran into an issue](https://www.research.net/r/javae2e?tutorial=functions-create-first-java-gradle&step=verify-deployment)
161163
162164
## Next steps
163165

21.9 KB
Loading

0 commit comments

Comments
 (0)