Skip to content

Commit a13ef5d

Browse files
author
Mike Swantek
committed
Updates and clarification of post provisioning script and environment validation.
Update PostgreSQL mirroring steps
1 parent 1acf214 commit a13ef5d

3 files changed

Lines changed: 97 additions & 40 deletions

File tree

docs/deploy_app_from_foundry.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This guide explains how to deploy a chat application directly from the Microsoft
66

77
Microsoft Foundry provides a built-in capability to publish playground experiences as web applications. This accelerator deploys the required infrastructure (App Service, managed identity, networking) so you can publish directly from the Foundry playground.
88

9+
> **UI note:** The new Foundry experience (the "New Foundry" toggle) does not currently show **Deploy to a web app**. Use the classic Foundry UI to publish for now. We will update this guide once the new UI supports web app deployment.
10+
911
## Prerequisites
1012

1113
- Completed deployment of this accelerator (`azd up`)
@@ -42,6 +44,8 @@ Since all resources are deployed with private endpoints, you must access Microso
4244

4345
### 4. Deploy to Web App
4446

47+
> **UI note:** If the "New Foundry" toggle is enabled, the **Deploy to a web app** option may be hidden. Switch to the classic Foundry UI to publish the web app.
48+
4549
1. Click **Deploy****Deploy to a web app**
4650
2. Configure deployment options:
4751
- **Create new** or **Update existing** web app

docs/post_deployment_steps.md

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Post Deployment Steps
22

3-
After running `azd up` or `azd provision` followed by `azd hooks run postprovision`, use these steps to verify that all components were deployed correctly and are functioning as expected.
3+
After running `azd up` or `azd provision` which then trigger the `azd hooks run postprovision`, use these steps to verify that all components were deployed correctly and are functioning as expected.
44

55
---
66

@@ -10,8 +10,9 @@ After running `azd up` or `azd provision` followed by `azd hooks run postprovisi
1010
|-----------|---------------|----------------|
1111
| Fabric Capacity | Azure Portal → Microsoft Fabric capacities | **Active** (not Paused) |
1212
| Fabric Workspace | [app.fabric.microsoft.com](https://app.fabric.microsoft.com) | Workspace visible with 3 lakehouses |
13+
| PostgreSQL Flexible Server | Azure Portal → Azure Database for PostgreSQL flexible servers | **Ready** |
1314
| Microsoft Foundry project | [ai.azure.com](https://ai.azure.com) | Project accessible, models deployed |
14-
| AI Search Index | Azure Portal → AI Search → Indexes | `onelake-index` exists with documents |
15+
| AI Search Index | Azure Portal → AI Search → Indexes | `onelake-index` exists |
1516
| Purview Scan | Purview Portal → Data Map → Sources | Fabric data source registered |
1617

1718
---
@@ -45,33 +46,30 @@ az fabric capacity resume --capacity-name <capacity-name> --resource-group <rg-n
4546
- **gold** — Curated analytics-ready data
4647

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

5050
### Optional PostgreSQL Mirroring Follow-Up
5151

52-
End-to-end mirroring is not part of `azd up` or post-provisioning. Some steps are manual.
52+
End-to-end mirroring is not complete when running `azd up` or post-provisioning. Some steps are manual.
5353

5454
For the full steps (including the Fabric portal **New item** mirror), follow [PostgreSQL mirroring](./postgresql_mirroring.md).
5555

5656
---
5757

58-
## 3. Verify Microsoft Foundry Project
58+
## 3. Verify PostgreSQL Flexible Server (if enabled)
5959

60-
1. Navigate to [ai.azure.com](https://ai.azure.com)
61-
2. Sign in and select your Microsoft Foundry project
62-
3. Verify:
63-
- **Models** — Check that GPT-4o and text-embedding-ada-002 (or configured models) are deployed
64-
- **Connections** — AI Search connection should be listed
65-
- **Playground** — Test the chat playground with a sample query
60+
The PostgreSQL server must be in **Running** state to accept connections.
6661

67-
### Testing AI Search Connection in Playground
62+
1. Navigate to **Azure Portal****Azure Database for PostgreSQL flexible servers**
63+
2. Select the server created by the deployment
64+
3. Verify the **Status** shows **Ready** and the **State** shows **Running**
6865

69-
1. In Microsoft Foundry, go to **Playgrounds****Chat**
70-
2. Click **Add your data**
71-
3. Select your AI Search index (`onelake-index`)
72-
4. Ask a question about your indexed documents
66+
### Optional: Test PostgreSQL Connectivity
7367

74-
If the connection fails, verify RBAC roles are assigned (see Troubleshooting section).
68+
Use the connection details from the Azure Portal **Connection strings** blade or from your `azd` environment values.
69+
70+
```bash
71+
psql "host=<server>.postgres.database.azure.com port=5432 dbname=<db-name> user=<username> sslmode=require"
72+
```
7573

7674
---
7775

@@ -108,12 +106,46 @@ If no documents appear, check:
108106

109107
---
110108

111-
## 5. Verify Purview Integration (if enabled)
109+
## 5. Verify Microsoft Foundry Project
110+
111+
1. Navigate to [ai.azure.com](https://ai.azure.com)
112+
2. Sign in and select your Microsoft Foundry project
113+
3. Verify:
114+
- **Models** — Check that GPT-4o and text-embedding-ada-002 (or configured models) are deployed
115+
- **Connections** — AI Search connection should be listed
116+
- **Playground** — Test the chat playground with a sample query
117+
118+
### Testing AI Search Connection in Playground
119+
120+
Before testing, upload at least one sample PDF into the bronze lakehouse (Files/documents) and re-run the indexer.
121+
122+
Re-run the indexer in the Azure portal:
123+
124+
1. Navigate to **Azure Portal****AI Search** → your search service
125+
2. Go to **Indexers** and select `onelake-indexer`
126+
3. Click **Run**
127+
128+
Or run it from the CLI:
129+
130+
```bash
131+
az search indexer run --name onelake-indexer --service-name <search-name> --resource-group <rg>
132+
```
133+
134+
1. In Microsoft Foundry, go to **Playgrounds****Chat**
135+
2. Click **Add your data**
136+
3. Select your AI Search index (`onelake-index`)
137+
4. Ask a question about your indexed documents
138+
139+
If the connection fails, verify RBAC roles are assigned (see Troubleshooting section).
140+
141+
---
142+
143+
## 6. Verify Purview Integration (if enabled)
112144

113145
1. Navigate to the **Microsoft Purview governance portal**
114146
2. Go to **Data Map****Sources**
115-
3. Verify the Fabric data source is registered (e.g., `Fabric-Workspace-<id>`)
116-
4. Check **Scans** to see if the initial scan completed
147+
3. Verify the Fabric data source is registered at the container level and the collection is `collection-<envname>`
148+
4. Check **Scans** to confirm the workspace-scoped scan completed
117149

118150
If `purviewCollectionName` is left empty in [infra/main.bicepparam](../infra/main.bicepparam), the automation now uses `collection-<AZURE_ENV_NAME>`.
119151

@@ -131,9 +163,9 @@ Lineage appears only after you run data movement or transformation jobs (for exa
131163

132164
---
133165

134-
## 6. Verify Network Isolation (if enabled)
166+
## 7. Verify Network Isolation in Azure Portal (if enabled)
135167

136-
When `networkIsolation` is set to `true`:
168+
When `networkIsolation` is set to `true` in [infra/main.bicepparam](../infra/main.bicepparam) during provisioning:
137169

138170
### Check Microsoft Foundry Network Settings
139171

@@ -159,7 +191,7 @@ This is **expected behavior** — the resources are only accessible from within
159191

160192
---
161193

162-
## 7. Connecting via Bastion (Network Isolated Deployments)
194+
## 8. Connecting via Bastion (Network Isolated Deployments)
163195

164196
For network-isolated deployments, use Azure Bastion to access resources:
165197

@@ -176,6 +208,9 @@ For network-isolated deployments, use Azure Bastion to access resources:
176208
![Image showing bastion blade](../img/provisioning/checkNetworkIsolation7.png)
177209

178210
4. Enter the VM admin credentials (set during deployment) and click **Connect**
211+
- Admin username: `vmUserName` in [infra/main.bicep](../infra/main.bicep)
212+
- Admin password: `vmAdminPassword` in [infra/main.bicepparam](../infra/main.bicepparam) (defaults to the `VM_ADMIN_PASSWORD` environment variable)
213+
- If you do not have them, reset the password in **Azure Portal****Virtual machine****Reset password**.
179214

180215
![Image showing bastion login](../img/provisioning/checkNetworkIsolation8.png)
181216

@@ -232,6 +267,7 @@ pwsh ./scripts/automationScripts/OneLakeIndex/06_setup_ai_foundry_search_rbac.ps
232267

233268
1. Verify documents exist in the bronze lakehouse:
234269
- Go to Fabric → bronze lakehouse → Files → documents
270+
- If needed, follow [Testing AI Search Connection in Playground](#testing-ai-search-connection-in-playground) to upload a sample PDF
235271

236272
2. Check indexer status:
237273
- Azure Portal → AI Search → Indexers → `onelake-indexer`
@@ -275,8 +311,10 @@ pwsh ./scripts/automationScripts/<path-to-script>.ps1
275311

276312
Once verification is complete:
277313

278-
1. **Upload documents** to the bronze lakehouse for indexing
279-
2. **Test the Microsoft Foundry playground** with your indexed content
280-
3. **Configure additional models** if needed
281-
4. **[Deploy your app](./deploy_app_from_foundry.md)** from the Microsoft Foundry playground
282-
5. **Review governance** in Microsoft Purview
314+
1. **Upload documents** to the bronze lakehouse for indexing (if you haven't already in previous steps)
315+
2. **Test PostgreSQL connectivity** (if you plan to use the database)
316+
3. **Complete PostgreSQL mirroring in Fabric** (if needed) — follow [PostgreSQL mirroring](./postgresql_mirroring.md)
317+
4. **Test the Microsoft Foundry playground** with your indexed content
318+
5. **Configure additional models** if needed
319+
6. **[Deploy your app](./deploy_app_from_foundry.md)** from the Microsoft Foundry playground
320+
7. **Review governance** in Microsoft Purview

docs/postgresql_mirroring.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ This guide explains how to complete PostgreSQL mirroring in Microsoft Fabric aft
44

55
> **Security-critical note:** The mirroring prep script must run from a VNet-connected host when Key Vault and PostgreSQL are private. If you want to demo the full end-to-end mirroring flow from a non-VNet machine, you must temporarily open access to both Key Vault and PostgreSQL before running the script, then re-lock them afterward. Treat this as a deliberate security step, not a default configuration.
66
7+
> **Resource naming note:** The AI Landing Zone submodule deploys Foundry and agent resources with an `ai-` prefix, including a separate Key Vault, Storage Account, and Cosmos DB. PostgreSQL mirroring uses the main deployment Key Vault from `keyVaultResourceId` (this is where the `postgreSql*` secrets live), not the `ai-` prefixed Key Vault. When a step says "Key Vault" in this doc, use the Key Vault from `keyVaultResourceId`.
8+
>
9+
> **How to find `keyVaultResourceId`:**
10+
> - Run `azd env get-value keyVaultResourceId` from the repo root.
11+
> - Or run `azd env get-values` and look for `keyVaultResourceId`.
12+
> - Or in Azure Portal, open the Key Vault used for deployment and copy its **Resource ID** from the **Overview** blade.
13+
714
Mirroring automation in the current branch is set for PostgreSQL deployments where `postgreSqlNetworkIsolation = false`.
815

916
For the public/manual path, this repo now supports a declarative firewall toggle through `postgreSqlAllowAzureServices`.
@@ -36,30 +43,38 @@ param postgreSqlNetworkIsolation = false
3643
param postgreSqlAllowAzureServices = true
3744
```
3845

39-
1. Run `azd up` and let postprovision finish (mirroring prep may fail on a non-VNet host).
40-
2. In Azure Portal, open the Key Vault and temporarily enable public networking.
41-
3. Re-run the prep script from your machine:
46+
1. Run `azd up` and let postprovision finish (mirroring prep may warn on a non-VNet host).
47+
2. Re-run the prep script from your machine (it configures PostgreSQL auth, creates the mirror user/role grants, and ensures a seed table exists for Fabric). The script will temporarily enable Key Vault public access for its own secret operations, then disable it again:
4248

4349
```powershell
4450
pwsh ./scripts/automationScripts/FabricWorkspace/mirror/prepare_postgresql_for_mirroring.ps1
4551
```
4652

47-
4. Copy the `fabric_user` password from Key Vault:
53+
3. In Azure Portal, open the Key Vault from `keyVaultResourceId` and temporarily enable public networking so you can copy the password:
54+
- Azure Portal -> search for **Key Vaults** -> select the Key Vault that matches the name in the resource ID
55+
- Go to **Networking** -> set **Public network access** to **Enabled**
56+
- Select **Apply** to save
57+
4. Copy the `fabric_user` password from that Key Vault (you will paste it into the Fabric connection wizard):
4858

4959
```powershell
5060
azd env get-value postgreSqlMirrorConnectionSecretNameOut
5161
az keyvault secret show --vault-name <keyvault-name> --name <secret-name> --query value -o tsv
5262
```
5363

5464
5. In Fabric, create a new **Mirrored Azure Database for PostgreSQL** item:
55-
56-
- Server: PostgreSQL FQDN from `azd env get-value postgreSqlServerFqdn`
57-
- Database: `postgres` (or your custom DB)
58-
- Username: `fabric_user`
59-
- Password: the Key Vault secret value
60-
61-
6. Select **Connect** and verify the mirrored database appears.
62-
7. Re-lock the Key Vault by disabling public networking after the connection succeeds.
65+
- Go to [app.fabric.microsoft.com](https://app.fabric.microsoft.com) and open your workspace (for example, `workspace-<envname>`)
66+
- Select **New item** -> **Mirror data** -> **Azure Database for PostgreSQL**
67+
- Enter:
68+
- Server: PostgreSQL FQDN from `azd env get-value postgreSqlServerFqdn`
69+
- Database: `postgres` (or your custom DB)
70+
- Username: `fabric_user`
71+
- Password: the Key Vault secret value
72+
- For full portal screenshots and walkthrough, see [Tutorial: Configure Microsoft Fabric mirrored databases from Azure Database for PostgreSQL](https://learn.microsoft.com/fabric/mirroring/azure-database-postgresql-tutorial).
73+
74+
6. Choose **Select data**, pick the `public.fabric_mirror_seed` table, preview the row, then select **Connect**.
75+
7. On the next screen, name the mirror (or accept the default) and select **Create mirrored database**.
76+
8. Verify the mirrored database appears.
77+
9. Re-lock the Key Vault by disabling public networking after the connection succeeds.
6378

6479
If the database or login fails, confirm `postgreSqlAllowAzureServices = true` (or add the `0.0.0.0` firewall rule) and re-run the prep script.
6580

0 commit comments

Comments
 (0)