Skip to content

Commit 031f376

Browse files
committed
Sync documentation of main branch
1 parent 09461bc commit 031f376

File tree

3 files changed

+163
-141
lines changed

3 files changed

+163
-141
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[source,bash,subs=attributes+, role="primary asciidoc-tabs-sync-cli"]
2+
.CLI
3+
----
4+
ifdef::dev-additional-parameters[]
5+
quarkus run {dev-additional-parameters}
6+
endif::[]
7+
ifndef::dev-additional-parameters[]
8+
quarkus run
9+
endif::[]
10+
----
11+
ifdef::devtools-wrapped[+]
12+
ifndef::devtools-no-maven[]
13+
[source,bash,subs=attributes+, role="secondary asciidoc-tabs-sync-maven"]
14+
.Maven
15+
----
16+
ifdef::dev-additional-parameters[]
17+
./mvnw quarkus:run {dev-additional-parameters}
18+
endif::[]
19+
ifndef::dev-additional-parameters[]
20+
./mvnw quarkus:run
21+
endif::[]
22+
----
23+
endif::[]
24+
ifdef::devtools-wrapped[+]
25+
ifndef::devtools-no-gradle[]
26+
[source,bash,subs=attributes+, role="secondary asciidoc-tabs-sync-gradle"]
27+
.Gradle
28+
----
29+
ifdef::dev-additional-parameters[]
30+
./gradlew --console=plain --info --no-daemon quarkusRun {dev-additional-parameters}
31+
endif::[]
32+
ifndef::dev-additional-parameters[]
33+
./gradlew --console=plain --info --no-daemon quarkusRun
34+
endif::[]
35+
----
36+
endif::[]

_versions/main/guides/azure-functions-http.adoc

Lines changed: 64 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -35,35 +35,15 @@ While only Jakarta REST is provided as an example, you can easily replace it wit
3535

3636
== Creating the Maven/Gradle Project
3737

38-
You can generate the example code from Quarkus's online application generator at https://code.quarkus.io/d?e=azure-functions-http&cn=code.quarkus.io[this link].
38+
First, we need a new project. Create a new project with the following command:
3939

40-
You can also generate this example with the Quarkus CLI:
40+
:create-app-artifact-id: azure-functions-http-quickstart
41+
:create-app-extensions: quarkus-azure-functions-http
42+
:create-app-code:
43+
include::{includes}/devtools/create-app.adoc[]
4144

42-
[source,bash,subs=attributes+]
43-
----
44-
quarkus create app --extension=quarkus-azure-functions-http
45-
----
46-
47-
Add the `--gradle` switch if you want to generate a gradle project.
48-
49-
== Login to Azure
50-
51-
If you don't log in to Azure you won't be able to deploy.
52-
53-
[source,bash,subs=attributes+]
54-
----
55-
az login
56-
----
57-
58-
== Quarkus dev mode
59-
60-
Quarkus dev mode works by just running your application as a HTTP endpoint. In dev mode
61-
there is no special interaction with the Azure Functions local runtime.
62-
63-
[source,bash,subs=attributes+]
64-
----
65-
./mvnw clean package quarkus:dev
66-
----
45+
This command generates a project structure importing the Quarkus Azure Functions HTTP extension.
46+
It includes an example.
6747

6848
== Examining the project
6949

@@ -73,10 +53,10 @@ The `quarkus-azure-functions-http` extension is the integration point between
7353
Quarkus and Azure Functions.
7454

7555
The current implementation of the `quarkus-azure-functions-http` extension no longer requires the
76-
`azure-functions-maven-plugin` or gradle equivalent. Local development and Azure Functions packaging and
56+
`azure-functions-maven-plugin` or Gradle equivalent. Local development and Azure Functions packaging and
7757
deployment is now all done by Quarkus.
7858

79-
Build configuration is now all within `application.properties`. The only required configuration switch
59+
Build configuration is all within `application.properties`. The only required configuration switch
8060
is `quarkus.azure-functions.app-name`.
8161

8262
== Azure Deployment Descriptors
@@ -92,41 +72,31 @@ The default route prefix for an Azure Function is `/api`. All of your Jakarta R
9272
explicitly take this into account. In the generated project this is handled by the
9373
`quarkus.http.root-path` switch in `application.properties`
9474

95-
== Login to Azure
96-
97-
If you don't log in to Azure you won't be able to deploy.
98-
99-
[source,bash,subs=attributes+]
100-
----
101-
az login
102-
----
103-
10475
== Quarkus dev mode
10576

106-
Quarkus dev mode does not work currently with Azure Functions.
77+
Quarkus dev mode works by just running your application as a HTTP endpoint. In dev mode,
78+
there is no special interaction with the Azure Functions local runtime.
79+
80+
include::{includes}/devtools/dev.adoc[]
10781

10882
== Run locally in Azure Functions local environment
10983

11084
If you want to try this example within the local Azure Functions environment, you can
111-
use this command
112-
113-
[source,bash,subs=attributes+]
114-
----
115-
./mvnw quarkus:run
116-
----
85+
use this command:
11786

118-
or
119-
120-
[source,bash,subs=attributes+]
121-
----
122-
./gradlew --info --no-daemon quarkusRun
123-
----
87+
include::{includes}/devtools/run.adoc[]
12488

89+
[TIP]
90+
====
12591
Gradle is a bit quirky with process management, so you need the `--no-daemon` switch or control-c will not
12692
destroy the process cleanly and you'll have open ports.
93+
====
12794

128-
Note that you must have the https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local#v2[Azure Functions Core Tools]
129-
installed for this to work!
95+
[NOTE]
96+
====
97+
You must have the https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local#v2[Azure Functions Core Tools]
98+
installed for this to work.
99+
====
130100

131101
The URL to access the example would be:
132102

@@ -137,59 +107,75 @@ http://localhost:8081/api/hello
137107
You can implement integration tests using `@QuarkusIntegrationTest` functionality. When these
138108
integration tests run, the local Azure Functions environment will be spun up for the duration of integration testing.
139109

140-
141-
For maven:
142-
[source,bash,subs=attributes+]
110+
[source,bash,subs=attributes+,role="primary asciidoc-tabs-sync-maven"]
111+
.Maven
112+
----
113+
./mvnw verify
143114
----
144-
./mvnw -DskipITs=false verify
115+
[source,bash,subs=attributes+,role="secondary asciidoc-tabs-sync-gradle"]
116+
.Gradle
117+
----
118+
./gradlew --info quarkusIntTest
145119
----
146120

147-
Make sure any integration tests you execute with maven use the `*IT.java` file pattern so that regular builds do not execute
121+
[TIP]
122+
====
123+
Make sure any integration tests you execute with Maven use the `*IT.java` file pattern so that regular builds do not execute
148124
the test.
125+
====
126+
127+
[TIP]
128+
====
129+
Make sure any integration tests you execute with Gradle are located within `src/integrationTest/java`. Integration
130+
tests that exist in `src/test` will run with normal build and fail.
131+
====
132+
133+
== Login to Azure
134+
135+
To be able to deploy your application to Azure, log in to Azure:
149136

150-
For Gradle:
151137
[source,bash,subs=attributes+]
152138
----
153-
./gradlew --info quarkusIntTest
139+
az login
154140
----
155141

156-
Make sure any integration tests you execute with Gradle are located within `src/integrationTest/java`. Integration
157-
tests that exist in `src/test` will run with normal build and fail.
158-
159142
== Deploy to Azure
160143

161-
The `quarkus-azure-functions-http` extension handles all the work to deploy to Azure. By default,
162-
Quarkus will use the Azure CLI in the background to authenticate and deploy to Azure. If you have
144+
The `quarkus-azure-functions-http` extension handles all the work to deploy to Azure. By default,
145+
Quarkus will use the Azure CLI in the background to authenticate and deploy to Azure. If you have
163146
multiple subscriptions associated with your account, you must set the `quarkus.azure-functions.subscription-id`
164147
property in your `application.properties` file to the subscription you want to use.
165-
For other authentication mechanisms and deployment options see our config properties xref:all-config.adoc[here].
148+
For other authentication mechanisms and deployment options see <<#configuration-reference>>.
166149

167-
To run the deploy, after you build your project execute:
150+
To deploy your application, after you built your project, execute:
168151

169-
[source,bash,subs=attributes+]
152+
[source,bash,subs=attributes+,role="primary asciidoc-tabs-sync-maven"]
153+
.Maven
170154
----
171155
./mvnw quarkus:deploy
172156
----
173-
174-
or
175-
176-
[source,bash,subs=attributes+]
157+
[source,bash,subs=attributes+,role="secondary asciidoc-tabs-sync-gradle"]
158+
.Gradle
177159
----
178160
./gradlew --info deploy
179161
----
180162

181-
If deployment is a success, Quarkus will output the endpoint URL of the example function to the console
182-
For Gradle, you must use the `--info` switch to see this output!
163+
[TIP]
164+
====
165+
For Gradle, you must use the `--info` switch to see this output.
166+
====
167+
168+
If deployment is a success, Quarkus will output the endpoint URL of the example function to the console:
183169

184-
i.e.
185170
[source]
186171
----
187172
[INFO] HTTP Trigger Urls:
188173
[INFO] HttpExample : https://{appName}.azurewebsites.net/api/{*path}
189174
----
190175

191-
The URL to access the service would be something like
192-
193-
https://{appName}.azurewebsites.net/api/hello
176+
The URL to access the service would be something like: `https://{appName}.azurewebsites.net/api/hello`.
194177

178+
[[configuration-reference]]
179+
== Azure Functions Configuration Reference
195180

181+
include::{generated-dir}/config/quarkus-azure-functions.adoc[leveloffset=+1, opts=optional]

0 commit comments

Comments
 (0)