Skip to content

Commit a02a782

Browse files
author
Mike Swantek
committed
Update mirror docs and corrected powershell try, catch, fail loops
1 parent a13ef5d commit a02a782

7 files changed

Lines changed: 18 additions & 55 deletions

docs/postgresql_mirroring.md

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,18 @@ param postgreSqlAllowAzureServices = true
4444
```
4545

4646
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:
48-
49-
```powershell
50-
pwsh ./scripts/automationScripts/FabricWorkspace/mirror/prepare_postgresql_for_mirroring.ps1
51-
```
52-
53-
3. In Azure Portal, open the Key Vault from `keyVaultResourceId` and temporarily enable public networking so you can copy the password:
47+
2. In Azure Portal, open the Key Vault from `keyVaultResourceId` and temporarily enable public networking so you can copy the password:
5448
- Azure Portal -> search for **Key Vaults** -> select the Key Vault that matches the name in the resource ID
5549
- Go to **Networking** -> set **Public network access** to **Enabled**
5650
- Select **Apply** to save
57-
4. Copy the `fabric_user` password from that Key Vault (you will paste it into the Fabric connection wizard):
51+
3. Copy the `fabric_user` password from that Key Vault (you will paste it into the Fabric connection wizard):
5852

5953
```powershell
6054
azd env get-value postgreSqlMirrorConnectionSecretNameOut
6155
az keyvault secret show --vault-name <keyvault-name> --name <secret-name> --query value -o tsv
6256
```
6357

64-
5. In Fabric, create a new **Mirrored Azure Database for PostgreSQL** item:
58+
4. In Fabric, create a new **Mirrored Azure Database for PostgreSQL** item:
6559
- Go to [app.fabric.microsoft.com](https://app.fabric.microsoft.com) and open your workspace (for example, `workspace-<envname>`)
6660
- Select **New item** -> **Mirror data** -> **Azure Database for PostgreSQL**
6761
- Enter:
@@ -71,12 +65,12 @@ az keyvault secret show --vault-name <keyvault-name> --name <secret-name> --quer
7165
- Password: the Key Vault secret value
7266
- 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).
7367

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.
68+
5. Choose **Select data**, pick the `public.fabric_mirror_seed` table, preview the row, then select **Connect**.
69+
6. On the next screen, name the mirror (or accept the default) and select **Create mirrored database**.
70+
7. Verify the mirrored database appears.
71+
8. Re-lock the Key Vault by disabling public networking after the connection succeeds.
7872

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

8175
### Private Network or Private Endpoint
8276

@@ -183,38 +177,7 @@ Get the PostgreSQL server FQDN and database name:
183177

184178
## Step 2: Prepare the Database (Run Automatically During Postprovision)
185179

186-
The mirroring prep script configures the server and creates a seed table so Fabric always finds at least one table to replicate.
187-
188-
During `azd up`, postprovision runs:
189-
190-
```powershell
191-
pwsh ./scripts/automationScripts/FabricWorkspace/mirror/prepare_postgresql_for_mirroring.ps1
192-
```
193-
194-
Re-run it manually only if you need to repair or reapply the PostgreSQL mirroring readiness settings.
195-
196-
> **Security step (manual demo path):** If you are not running from a VNet-connected host, temporarily enable Key Vault access and PostgreSQL firewall access for your client before running the script. Restore the locked-down settings immediately after.
197-
198-
If you need the script to temporarily enable Key Vault public access while it runs, set:
199-
200-
```powershell
201-
$env:POSTGRES_TEMP_ENABLE_KV_PUBLIC_ACCESS = "true"
202-
pwsh ./scripts/automationScripts/FabricWorkspace/mirror/prepare_postgresql_for_mirroring.ps1
203-
```
204-
205-
### Manual rerun
206-
207-
Run:
208-
209-
```powershell
210-
pwsh ./scripts/automationScripts/FabricWorkspace/mirror/prepare_postgresql_for_mirroring.ps1
211-
```
212-
213-
If you are running from a non-VNet host and the Key Vault blocks public access, set:
214-
215-
```powershell
216-
$env:POSTGRES_TEMP_ENABLE_KV_PUBLIC_ACCESS = 'true'
217-
```
180+
The mirroring prep script configures the server and creates a seed table so Fabric always finds at least one table to replicate. It runs during `azd up` postprovision.
218181

219182
What it does:
220183

docs/required_roles_scopes_resources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ If you cannot grant role assignments at the scope where resources are created, t
1616

1717
The full list of default role assignments is maintained in the AI Landing Zone submodule. These assignments change if you modify `containerAppsList` or disable services.
1818

19-
- Default role assignment matrix: [submodules/ai-landing-zone/README.md](submodules/ai-landing-zone/README.md)
20-
- Default container app roles (driven by `containerAppsList`): [infra/main.bicepparam](infra/main.bicepparam)
19+
- Default role assignment matrix: [submodules/ai-landing-zone/README.md](../submodules/ai-landing-zone/README.md)
20+
- Default container app roles (driven by `containerAppsList`): [infra/main.bicepparam](../infra/main.bicepparam)
2121

2222
## Required resource providers
2323

infra/main.bicepparam

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ param useExistingVNet = false
2424
param existingVnetResourceId = readEnvironmentVariable('EXISTING_VNET_RESOURCE_ID', '')
2525

2626
// Optional additional Entra object IDs to grant Search roles.
27-
param aiSearchAdditionalAccessObjectIds = ['']
27+
param aiSearchAdditionalAccessObjectIds = []
2828

2929
// ========================================
3030
// OPTIONAL INPUTS (Configuration)
@@ -205,7 +205,7 @@ param containerAppsList = [
205205
]
206206

207207
param vmAdminPassword = readEnvironmentVariable('VM_ADMIN_PASSWORD', '$(secretOrRandomPassword)')
208-
param vmSize = 'Standard_D8s_v5'
208+
param vmSize = 'Standard_D2s_v3'
209209

210210
// ========================================
211211
// FABRIC CAPACITY PARAMETERS
@@ -245,7 +245,7 @@ param fabricWorkspaceName = '' // optional (helpful for naming/UX)
245245
param fabricCapacitySku = 'F8'
246246

247247
// Fabric capacity admin members (email addresses or object IDs).
248-
param fabricCapacityAdmins = ['']
248+
param fabricCapacityAdmins = []
249249

250250
// ========================================
251251
// PURVIEW PARAMETERS (Optional)

scripts/automationScripts/OneLakeIndex/02_create_onelake_skillsets.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ try {
110110
Write-Host "✅ Successfully created skillset: $($response.name)"
111111
} catch {
112112
Write-Error "Failed to create skillset: $($_.Exception.Message)"
113-
exit 1
113+
throw
114114
}
115115

116116
Write-Host ""

scripts/automationScripts/OneLakeIndex/03_create_onelake_index.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ try {
234234
$errorContent = $_.Exception.Response.Content.ReadAsStringAsync().Result
235235
Write-Host "Error details: $errorContent"
236236
}
237-
exit 1
237+
throw
238238
}
239239

240240
Write-Host ""

scripts/automationScripts/OneLakeIndex/04_create_onelake_datasource.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Write-Host "================================================================="
109109

110110
if (-not $aiSearchName -or -not $resourceGroup -or -not $subscription) {
111111
Write-Error "AI Search configuration not found (name='$aiSearchName', rg='$resourceGroup', subscription='$subscription'). Cannot create OneLake data source."
112-
exit 1
112+
throw
113113
}
114114

115115
if (-not $workspaceId -or -not $lakehouseId) {

scripts/automationScripts/OneLakeIndex/05_create_onelake_indexer.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Write-Host "=============================================================="
9797

9898
if (-not $aiSearchName -or -not $resourceGroup -or -not $subscription) {
9999
Write-Error "AI Search configuration not found (name='$aiSearchName', rg='$resourceGroup', subscription='$subscription'). Cannot create OneLake indexer."
100-
exit 1
100+
throw
101101
}
102102

103103
. "$PSScriptRoot/SearchHelpers.ps1"

0 commit comments

Comments
 (0)