Skip to content

Commit 17ec603

Browse files
author
Mike Swantek
committed
update docs and post deployment steps
1 parent 4ee31df commit 17ec603

5 files changed

Lines changed: 98 additions & 28 deletions

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This accelerator extends the [AI Landing Zone](https://github.com/Azure/ai-landi
2222

2323
### Solution Architecture
2424

25-
| ![Architecture](./img/Architecture/Deploy-AI-App-in-Prod-Architecture_final.png) |
25+
| ![Architecture](./img/Architecture/Depoly-AI-App-in-Prod-Architecture-final.png) |
2626
|---|
2727

2828
### Key Components
@@ -31,6 +31,7 @@ This accelerator extends the [AI Landing Zone](https://github.com/Azure/ai-landi
3131
|-----------|---------|
3232
| **Azure AI Foundry** | Unified platform for AI development, testing, and deployment with playground, prompt flow, and publishing |
3333
| **Microsoft Fabric** | Data foundation with lakehouses (bronze/silver/gold) for document storage and OneLake indexing |
34+
| **Azure Database for PostgreSQL** | Optional operational data source that can be prepared for Microsoft Fabric mirroring after deployment |
3435
| **Azure AI Search** | Retrieval backbone enabling RAG (Retrieval-Augmented Generation) chat experiences |
3536
| **Microsoft Purview** | Governance layer for cataloging, scans, and Data Security Posture Management |
3637
| **Private Networking** | All traffic secured via private endpoints—no public internet exposure |
@@ -61,6 +62,9 @@ This accelerator extends the [AI Landing Zone](https://github.com/Azure/ai-landi
6162
- **Integrated data-to-AI pipeline** <br/>
6263
Connect Fabric lakehouses → OneLake indexer → AI Search → Foundry playground for grounded chat experiences.
6364

65+
- **PostgreSQL-to-Fabric mirroring path** <br/>
66+
Provision Azure Database for PostgreSQL, prepare it for Fabric mirroring, create the Fabric connection, and mirror operational data into OneLake for downstream analytics and AI scenarios.
67+
6468
- **Governance built-in** <br/>
6569
Microsoft Purview integration for cataloging, scoped scans, and Data Security Posture Management (DSPM).
6670

@@ -169,6 +173,7 @@ After deployment, you'll have a complete, enterprise-ready platform that unifies
169173
|-------|-----------------|----------------|
170174
| **AI Platform** | Azure AI Foundry with OpenAI models, playground, and prompt flow | Build, test, and publish AI chat applications without managing infrastructure |
171175
| **Data Foundation** | Microsoft Fabric with bronze/silver/gold lakehouses and OneLake indexing | Store documents at scale and automatically feed them into your AI workflows |
176+
| **Operational Data Mirroring** | Azure Database for PostgreSQL prepared for Fabric mirroring | Bring PostgreSQL operational data into Fabric with a documented connection and mirror setup path |
172177
| **Search & Retrieval** | Azure AI Search with vector and semantic search | Enable RAG (Retrieval-Augmented Generation) for grounded, accurate AI responses |
173178
| **Governance** | Microsoft Purview with cataloging, scans, and DSPM | Track data lineage, enforce policies, and maintain compliance visibility |
174179
| **Security** | Private endpoints, managed identities, RBAC, network isolation | Zero public internet exposure—all traffic stays on the Microsoft backbone |
@@ -186,6 +191,9 @@ After deployment, you'll have a complete, enterprise-ready platform that unifies
186191
- **Fabric-powered retrieval workflows**
187192
<br/>Land documents in a Fabric lakehouse, index them with OneLake + Azure AI Search, and wire the index into the Foundry playground for grounded chat experiences.
188193
194+
- **Fabric mirroring for PostgreSQL**
195+
<br/>Prepare Azure Database for PostgreSQL for Fabric mirroring, create the Fabric connection, and mirror source data into Fabric using the documented post-deployment flow.
196+
189197
- **Governed data and agent operations**
190198
<br/>Integrate Microsoft Purview for cataloging, scoped scans, and Data Security Posture Management (DSPM) so compliance teams can monitor the same assets the app consumes.
191199
@@ -208,6 +216,16 @@ After deployment, you'll have a complete, enterprise-ready platform that unifies
208216
5. **Publish application** → Deploy the chat experience to end users
209217
6. **Monitor governance** → Review data lineage and security posture in Purview
210218
219+
### PostgreSQL Mirroring Setup
220+
221+
If you deploy Azure Database for PostgreSQL, the repo also supports a documented Fabric mirroring path after deployment:
222+
223+
1. Prepare the PostgreSQL server and mirroring user with the provided automation.
224+
2. Create the Fabric PostgreSQL connection using the `fabric_user` credentials stored in Key Vault.
225+
3. Start the mirror in Fabric so PostgreSQL data lands in OneLake.
226+
227+
See the detailed steps in [docs/postgresql_mirroring.md](./docs/postgresql_mirroring.md) and the shorter checklist in [docs/post_deployment_steps.md](./docs/post_deployment_steps.md).
228+
211229
<br/>
212230
213231
<!------------------------------------------>

docs/PARAMETER_GUIDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,22 @@ Use these in `infra/main.bicepparam` when deploying via this repo. `postgreSqlNe
444444
```bicep-params
445445
param deployPostgreSql = true
446446
param postgreSqlNetworkIsolation = networkIsolation
447+
param postgreSqlMirrorConnectionMode = 'fabricUser'
448+
param postgreSqlAuthConfig = {
449+
activeDirectoryAuth: 'Enabled'
450+
passwordAuth: 'Enabled'
451+
}
447452
```
448453

449454
When `postgreSqlNetworkIsolation` is `false`, PostgreSQL uses public access and does not create private endpoints or private DNS resources.
450455

456+
`postgreSqlAuthConfig` should remain set to both authentication modes enabled if you plan to configure Fabric mirroring after deployment. This ensures the server is created with password authentication available for the `fabric_user` connection instead of relying on a later hook to change the auth mode.
457+
458+
`postgreSqlMirrorConnectionMode` controls which credential the manual Fabric PostgreSQL connection should use after deployment:
459+
460+
- `fabricUser` uses the dedicated least-privilege mirroring user and `postgres-fabric-user-password`. This is the production-oriented default.
461+
- `admin` uses the PostgreSQL admin login and `postgres-admin-password`. This is intended for demo automation scenarios where you want to avoid creating a separate mirroring user.
462+
451463
### Storage Account
452464

453465
```json

docs/post_deployment_steps.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,22 @@ az fabric capacity resume --capacity-name <capacity-name> --resource-group <rg-n
4646
- **gold** — Curated analytics-ready data
4747

4848
5. Open the **bronze** lakehouse and verify the `Files/documents` folder structure exists
49+
6. In the workspace, check each lakehouse (**bronze**, **silver**, **gold**) and confirm the **Sensitivity label** matches the value set in the parameter file.
4950

5051
### PostgreSQL Mirroring (if enabled)
5152

52-
Use these short steps to create the Fabric connection and enable mirroring. For full details and troubleshooting, see [PostgreSQL mirroring](./postgresql_mirroring.md).
53+
Use these short steps to verify the automatic Fabric connection and mirroring flow. For full details and troubleshooting, see [PostgreSQL mirroring](./postgresql_mirroring.md).
5354

54-
0. In **Azure Portal****Key Vault** → your vault → **Networking**, set **Public access** to **Allow public access from specific virtual networks and IP addresses**, add your client IP, then **Apply**. This lets you read the `fabric_user` password from the vault.
55+
0. In **Azure Portal****Key Vault** → your vault → **Networking**, set **Public access** to **Allow public access from specific virtual networks and IP addresses**, add your client IP, then **Apply**. This lets you read the PostgreSQL connection password from the vault.
5556
After you retrieve the secret, remove your IP and **Apply** again to re-lock the vault.
56-
1. In Fabric, open the workspace, then select **Connections****New****PostgreSQL**.
57-
2. Use the PostgreSQL server name, database name, and the `fabric_user` credentials stored in Key Vault.
58-
3. Test the connection and **Save**.
59-
4. In the workspace, select **New****Data pipeline****Mirror database**.
60-
5. Pick the PostgreSQL connection, select the target database, and **Start mirroring**.
57+
1. Check the resolved mirroring identity instead of hardcoding it:
58+
- `azd env get-value postgreSqlMirrorConnectionModeOut`
59+
- `azd env get-value postgreSqlMirrorConnectionUserNameOut`
60+
- `azd env get-value postgreSqlMirrorConnectionSecretNameOut`
61+
2. Run `pwsh ./scripts/automationScripts/FabricWorkspace/Mirror/create_postgresql_mirror.ps1` if Stage 7.5 did not already complete it.
62+
3. Verify `azd env get-value fabricPostgresConnectionId` now returns a Fabric connection ID.
63+
4. In Fabric, confirm the PostgreSQL connection exists under **Connections** and that the mirrored database is running.
64+
5. If your PostgreSQL source requires a Fabric VNet gateway, set `azd env set-value fabricPostgresGatewayId "<gateway-id>"` and rerun the script.
6165

6266
---
6367

docs/postgresql_mirroring.md

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ This guide explains how to complete PostgreSQL mirroring in Microsoft Fabric aft
77
What is automated today:
88

99
- PostgreSQL server prep (roles, grants, seed table, parameters).
10-
- Mirror creation **after** a Fabric connection exists (scripted).
11-
12-
What is still manual and why:
13-
14-
- Fabric connection creation is **portal-only** today. The public Fabric API does not currently expose a supported endpoint to create PostgreSQL connections, so the connection must be created in the UI to obtain a `connectionId`.
15-
16-
Once Fabric exposes a supported API for connection creation, this step can be fully automated.
10+
- Fabric connection creation or reuse for PostgreSQL mirroring.
11+
- Mirror creation after the Fabric connection is resolved.
1712

1813
## Why a Fabric Connection Is Required
1914

@@ -25,16 +20,17 @@ The Fabric mirroring API requires a Fabric "connection" object that stores the P
2520
- You can sign in to Fabric (app.fabric.microsoft.com) with access to the workspace.
2621
- PostgreSQL authentication mode is **PostgreSQL and Microsoft Entra authentication** (password auth enabled).
2722
- You have access to the Key Vault that stores the PostgreSQL secrets.
23+
- Decide which connection mode you are using: `fabricUser` (default) or `admin` via `postgreSqlMirrorConnectionMode`.
2824

2925
## Step 1: Confirm PostgreSQL Details
3026

3127
Get the PostgreSQL server FQDN and database name:
3228

3329
- FQDN: from `azd env get-value postgreSqlServerFqdn`
3430
- Database name: `postgres` (default) or your custom DB
35-
- Admin login: `pgadmin`
36-
- Fabric login: `fabric_user` (used by Fabric)
37-
- Fabric password: Key Vault secret `postgres-fabric-user-password`
31+
- Connection mode: from `azd env get-value postgreSqlMirrorConnectionModeOut`
32+
- Fabric login: from `azd env get-value postgreSqlMirrorConnectionUserNameOut`
33+
- Fabric password secret name: from `azd env get-value postgreSqlMirrorConnectionSecretNameOut`
3834

3935
## Step 2: Prepare the Database (Automated by Default)
4036

@@ -56,10 +52,10 @@ $env:POSTGRES_TEMP_ENABLE_KV_PUBLIC_ACCESS = 'true'
5652

5753
What it does now:
5854

59-
- Creates or validates the `fabric_user` role.
55+
- Creates or validates the `fabric_user` role when mode is `fabricUser`.
6056
- Ensures PostgreSQL auth modes are enabled (password + Entra).
6157
- Grants `azure_cdc_admin` and database permissions.
62-
- Creates a seed table: `public.fabric_mirror_seed` (owned by the mirroring user when created as `fabric_user`).
58+
- Creates a seed table: `public.fabric_mirror_seed` (owned by the mirroring identity, either `fabric_user` or `pgadmin`).
6359
- Uses `psql` fallback when `rdbms-connect` cannot install.
6460

6561
### Manual (only if automation fails)
@@ -92,19 +88,53 @@ az keyvault secret set --vault-name <keyvault-name> --name postgres-fabric-user-
9288

9389
> Ownership note: Fabric requires the mirror user to own tables. If you create tables as `pgadmin`, change ownership to `fabric_user`.
9490
95-
## Step 3: Create the Fabric Connection (UI)
91+
## Step 3: Create or Reuse the Fabric Connection (Automated by Default)
92+
93+
Run:
94+
95+
```powershell
96+
pwsh ./scripts/automationScripts/FabricWorkspace/Mirror/create_postgresql_mirror.ps1
97+
```
98+
99+
What the script does now:
100+
101+
- Reuses `fabricPostgresConnectionId` when it is already stored in `azd`.
102+
- Otherwise resolves the connection login from `postgreSqlMirrorConnectionUserNameOut`.
103+
- Resolves the connection password secret name from `postgreSqlMirrorConnectionSecretNameOut`.
104+
- Reads the chosen secret from Key Vault, creates or reuses the Fabric PostgreSQL connection, and stores the resulting `fabricPostgresConnectionId` back into `azd`.
105+
- Creates the mirrored database after the connection is available.
106+
107+
If your PostgreSQL server is reachable only through a Fabric VNet data gateway, set the gateway ID before rerunning the script:
108+
109+
```powershell
110+
azd env set-value fabricPostgresGatewayId "<fabric-vnet-gateway-id>"
111+
```
112+
113+
Without `fabricPostgresGatewayId`, the script creates a standard cloud connection.
114+
115+
### Manual fallback
116+
117+
If you need to create the Fabric connection manually, do not hardcode `fabric_user`, `pgadmin`, or the secret name. Read the values from the deployment outputs first:
118+
119+
```powershell
120+
azd env get-value postgreSqlMirrorConnectionModeOut
121+
azd env get-value postgreSqlMirrorConnectionUserNameOut
122+
azd env get-value postgreSqlMirrorConnectionSecretNameOut
123+
```
124+
125+
Then in Fabric:
96126

97127
1. Open the Fabric workspace.
98128
2. Go to **Settings** -> **Manage connections and gateways**.
99129
3. Select **New connection** -> **PostgreSQL**.
100130
4. Enter:
101131
- Server: PostgreSQL FQDN (example: `pg-<env>.postgres.database.azure.com`)
102132
- Database: `postgres` (or your custom DB)
103-
- User: `fabric_user` (example: `fabric_user`)
104-
- Password: value from Key Vault secret `postgres-fabric-user-password`
133+
- User: the value from `postgreSqlMirrorConnectionUserNameOut`
134+
- Password: the Key Vault secret value stored under `postgreSqlMirrorConnectionSecretNameOut`
105135
5. Save and copy the **Connection ID**.
106136

107-
## Step 4: Set the Connection ID in azd
137+
## Step 4: Persist the Connection ID in azd (only if you created it manually)
108138

109139
```powershell
110140
azd env set-value fabricPostgresConnectionId "<connection-id>"
@@ -113,7 +143,7 @@ azd env set-value POSTGRES_DATABASE_NAME "postgres"
113143

114144
## Step 5: Create the Mirror
115145

116-
Run the mirror script (this is the automation step after the connection exists):
146+
If the previous script already created the connection automatically, re-running it is safe and idempotent. If you created the connection manually, run it once now:
117147

118148
```powershell
119149
./scripts/automationScripts/FabricWorkspace/Mirror/create_postgresql_mirror.ps1
@@ -126,16 +156,22 @@ Run the mirror script (this is the automation step after the connection exists):
126156

127157
## Notes
128158

129-
- The deployment now skips the mirror step until a valid Fabric connection exists, so `azd up` will no longer fail on this step.
159+
- The deployment now attempts to create or reuse the Fabric PostgreSQL connection automatically before creating the mirror.
160+
- If automatic connection creation cannot reach Key Vault or the source database, the script exits without failing the entire deployment and leaves a manual fallback path.
130161
- If you rotate passwords, update the Fabric connection in the workspace.
131162

132163
## Troubleshooting
133164

134165
### Invalid credentials
135166

136167
- Ensure PostgreSQL auth is **PostgreSQL and Microsoft Entra authentication** (password auth enabled).
137-
- Use `fabric_user` in the Fabric connection.
138-
- Verify the Key Vault secret matches the role password. Automation sets it unless it failed.
168+
- Use the login from `postgreSqlMirrorConnectionUserNameOut` in the Fabric connection.
169+
- Verify the Key Vault secret named by `postgreSqlMirrorConnectionSecretNameOut` matches the chosen connection credential.
170+
171+
### Private networking or gateway-required sources
172+
173+
- If the PostgreSQL server is private-only, set `fabricPostgresGatewayId` in `azd` before rerunning the script so the connection is created under the Fabric VNet gateway.
174+
- If the gateway ID is not set, the automation uses a shareable cloud connection.
139175

140176
### Must be owner of table
141177

97.6 KB
Loading

0 commit comments

Comments
 (0)