You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/tutorial-java-quarkus-postgresql-app.md
+15-17Lines changed: 15 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,14 +223,14 @@ The creation wizard generated the connectivity variables for you already as [app
223
223
:::row:::
224
224
:::column span="2":::
225
225
**Step 2: Create a subnet for securing Key Vault**
226
+
The virtual network already has two existing subnets, but one is already delegated to App Service and the other is already delegated to Azure Database for PostgreSQL. You create another one for secure access to Key Vault with a private endpoint (for more information, see [Network security for Azure Key Vault](/azure/key-vault/general/network-security)).
226
227
1. In the left menu of the App Service page, select the **Overview** tab.
227
228
1. Select the resource group of the app.
228
229
1. Select the virtual network in the resource group.
229
230
1. In the left menu of the virtual network, select **Settings > Subnets**.
230
231
1. Select **+ Subnet**.
231
232
1. In **Name**, type **subnet-keyvault**. Accept the defaults.
232
233
1. Select **Add**.
233
-
The virtual network already has two existing subnets, but one is already delegated to App Service and the other is already delegated to Azure Database for PostgreSQL. The new subnet you create is used for secure access to Key Vault with a private endpoint (for more information, see [Network security for Azure Key Vault](/azure/key-vault/general/network-security)).
234
234
:::column-end:::
235
235
:::column:::
236
236
:::image type="content" source="./media/tutorial-java-quarkus-postgresql-app/azure-portal-secure-connection-secrets-2.png" alt-text="A screenshot showing how to create a subnet in the virtual network." lightbox="./media/tutorial-java-quarkus-postgresql-app/azure-portal-secure-connection-secrets-2.png":::
@@ -562,13 +562,13 @@ The dev container already has the [Azure Developer CLI](/azure/developer/azure-d
562
562
azd auth login
563
563
```
564
564
565
-
1. Create the necessary Azure resources with the `azd up` command. Follow the prompt to selectthe desired subscription and location for the Azure resources.
565
+
1. Create the necessary Azure resources with the `azd provision` command. Follow the prompt to selectthe desired subscription and location for the Azure resources.
566
566
567
567
```bash
568
-
azd up
568
+
azd provision
569
569
```
570
570
571
-
The `azd up`command takes about 15 minutes to complete (the Redis cache takes the most time). Later, you'll modify your code to work with App Service and deploy the changes with `azd deploy`. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure.
571
+
The `azd provision`command takes about 15 minutes to complete (the Redis cache takes the most time). Later, you'll modify your code to work with App Service and deploy the changes with `azd deploy`. While it's running, the command provides messages about the provisioning and deployment process, including a link to the deployment in Azure.
572
572
573
573
This AZD template contains files (*azure.yaml* and the *infra* directory) that generate a secure-by-default architecture with the following Azure resources:
574
574
@@ -584,15 +584,7 @@ The dev container already has the [Azure Developer CLI](/azure/developer/azure-d
584
584
- **Azure Cache for Redis**: Accessible only from behind its private endpoint.
585
585
- **Key vault**: Accessible only from behind its private endpoint. Used to manage secrets for the App Service app.
586
586
587
-
Once the command finishes creating resources and deploying the application code the first time, the deployed sample app doesn't work yet because you must make small changes to make it connect to the database in Azure.
588
-
589
-
Having issues? Check the [Troubleshooting section](#troubleshooting).
590
-
591
-
## 3. Use the database connection string
592
-
593
-
The AZD template you use generated the connectivity variables for you already as [app settings](configure-common.md#configure-app-settings) and outputs the them to the terminal for your convenience. App settings are one way to keep connection secrets out of your code repository.
594
-
595
-
1. In the AZD output, find the setting `AZURE_POSTGRESQL_CONNECTIONSTRING`. To keep secrets safe, only the setting names are displayed. They look like this in the AZD output:
587
+
1. Once provisioning finishes, find the setting `AZURE_POSTGRESQL_CONNECTIONSTRING`in the AZD output. To keep secrets safe, only the setting names are displayed. They look like this in the AZD output:
596
588
597
589
<pre>
598
590
App Service app has the following connection settings:
@@ -602,11 +594,17 @@ The AZD template you use generated the connectivity variables for you already as
602
594
- AZURE_KEYVAULT_SCOPE
603
595
</pre>
604
596
605
-
1. For your convenience, the AZD template shows you the direct link to the app's appsettings page. Find the link and open it in a new browser tab.
597
+
The AZD template you use generated the connectivity variables for you already as [app settings](configure-common.md#configure-app-settings) and outputs the them to the terminal for your convenience. App settings are one way to keep connection secrets out of your code repository. You can also find the direct link to the app settings page for the created App Service app.
606
598
607
599
Having issues? Check the [Troubleshooting section](#troubleshooting).
608
600
609
-
## 4. Modify sample code and redeploy
601
+
## 3. Modify sample code and redeploy
602
+
603
+
Once the command finishes creating resources the first time, you must make some changes to make it to your application code and then deploy it:
604
+
605
+
- Quarkus listens to port 8080 by default. In production, it needs to be configured to listen to the port specified by the `PORT` environment variable in App Service.
606
+
- Your deployed Java package must be an [Uber-Jar](https://quarkus.io/guides/maven-tooling#uber-jar-maven).
607
+
- For simplicity of the tutorial, you'll disable tests during the deployment process. The GitHub Actions runners don't have access to the PostgreSQL database in Azure, so any integration tests that require database access will fail, such as is the case with the Quarkus sample application.
610
608
611
609
# [With GitHub Copilot](#tab/copilot)
612
610
@@ -638,7 +636,7 @@ Having issues? Check the [Troubleshooting section](#troubleshooting).
638
636
```
639
637
640
638
> [!NOTE]
641
-
> If you run `azd up`, it combines `azd package`, `azd provision`, and `azd deploy`.
639
+
> If you run `azd up`, it combines `azd package`, `azd provision`, and `azd deploy`. The reason you didn't do it at the beginning was because you didn't have the PostgreSQL connection settings to modify your code with yet. If you ran `azd up` then, the deploy stage would stall because the Quarkus app wouldn't be able to start without the changes you made here.
642
640
643
641
-----
644
642
@@ -669,7 +667,7 @@ Azure App Service can capture console logs to help you diagnose issues with your
669
667
670
668
The sample application includes standard JBoss logging statements to demonstrate this capability as shown below.
0 commit comments