Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection String Modified for Order Service #184

Merged
merged 5 commits into from
Nov 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Connection String Modified for Order Service
If I configured the Connection String for Npgsql (C#).
Following error was showed and couldn't start the order service.

So I modified to be able to access to the PostgreSQL from the catalog service.

```bash
az keyvault secret set \
    --vault-name acme-fitness-kv-yoshio \
    --name "ConnectionStrings--OrderContext" \
    --value "Server=$POSTGRES_SERVER.postgres.database.azure.com;Database=$ORDER_SERVICE_DB;Port=5432;SSL Mode=Require;Trust Server Certificate=true;User ID=$POSTGRES_SERVER_USER;Password=$POSTGRES_SERVER_PASSWORD"
```

```text
Unhandled exception. System.ArgumentException: To validate server certificates, please use VerifyFull or VerifyCA instead of Require. To disable validation, explicitly set 'Trust Server Certificate' to true. See https://www.npgsql.org/doc/release-notes/6.0.html for more details.
```
  • Loading branch information
yoshioterada authored Sep 25, 2023
commit 7d39642aa46f1030e688c546e64d6e33f14db705
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ az keyvault secret set --vault-name ${KEY_VAULT} \
--name "POSTGRES-SERVER-NAME" --value ${POSTGRES_SERVER_FULL_NAME}

az keyvault secret set --vault-name ${KEY_VAULT} \
--name "ConnectionStrings--OrderContext" --value "Server=${POSTGRES_SERVER_FULL_NAME}; \
Database=${ORDER_SERVICE_DB};Port=5432;Ssl Mode=Require;User Id=${POSTGRES_SERVER_USER};Password=${POSTGRES_SERVER_PASSWORD}"
--name "ConnectionStrings--OrderContext" \
--value "Server=$POSTGRES_SERVER.postgres.database.azure.com;Database=$ORDER_SERVICE_DB;Port=5432;SSL Mode=Require;Trust Server Certificate=true;User ID=$POSTGRES_SERVER_USER;Password=$POSTGRES_SERVER_PASSWORD"

az keyvault secret set --vault-name ${KEY_VAULT} \
--name "CATALOG-DATABASE-NAME" --value ${CATALOG_SERVICE_DB}

Expand Down Expand Up @@ -137,4 +137,4 @@ Open the app, add items to the cart and submit the orders to make sure everythin

⬅️ Previous guide: [12 - Hands On Lab 3.4 - Configure Single Sign On](../12-hol-3.4-configure-single-signon/README.md)

➡️ Next guide: [14 - Hands On Lab 4.1 - End-End Observability](../14-hol-4.1-end-to-end-observability/README.md)
➡️ Next guide: [14 - Hands On Lab 4.1 - End-End Observability](../14-hol-4.1-end-to-end-observability/README.md)