Skip to content

Commit 1f3bc19

Browse files
authored
Merge pull request #106 from Yamini-Microsoft/psl-minor-fix
fix: Use purviewCollectionName parameter for Purview collection setup
2 parents 9210afe + 1ab8547 commit 1f3bc19

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

scripts/automationScripts/FabricPurviewAutomation/create_purview_collection.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ $collectionName = $null
6666
$purviewAccountName = Get-AzdEnvValue -key 'purviewAccountName'
6767
$purviewSubscriptionId = Get-AzdEnvValue -key 'purviewSubscriptionId'
6868
$purviewResourceGroup = Get-AzdEnvValue -key 'purviewResourceGroup'
69-
$collectionName = Get-AzdEnvValue -key 'desiredFabricDomainName'
69+
# First try purviewCollectionName, then fall back to desiredFabricDomainName for backwards compatibility
70+
$collectionName = Get-AzdEnvValue -key 'purviewCollectionName'
71+
if (-not $collectionName) { $collectionName = Get-AzdEnvValue -key 'desiredFabricDomainName' }
7072
$purviewAccountResourceId = Get-AzdEnvValue -key 'purviewAccountResourceId'
7173

7274
if (-not $purviewAccountResourceId) { $purviewAccountResourceId = $env:PURVIEW_ACCOUNT_RESOURCE_ID }
@@ -83,7 +85,7 @@ if ($purviewAccountResourceId) {
8385
# Skip gracefully when Purview integration is not configured for this environment.
8486
$missingValues = @()
8587
if (-not $purviewAccountName) { $missingValues += 'purviewAccountName' }
86-
if (-not $collectionName) { $missingValues += 'desiredFabricDomainName' }
88+
if (-not $collectionName) { $missingValues += 'purviewCollectionName or desiredFabricDomainName' }
8789
if (-not $purviewSubscriptionId) { $missingValues += 'purviewSubscriptionId' }
8890
if (-not $purviewResourceGroup) { $missingValues += 'purviewResourceGroup' }
8991
if ($missingValues.Count -gt 0) {

scripts/automationScripts/FabricWorkspace/CreateWorkspace/register_fabric_datasource.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ function Resolve-PurviewFromResourceId([string]$resourceId) {
8989

9090
# Resolve Purview account and collection name from azd (if present)
9191
$purviewAccountName = Get-AzdEnvValue -key 'purviewAccountName'
92-
$collectionName = Get-AzdEnvValue -key 'desiredFabricDomainName'
92+
# First try purviewCollectionName, then fall back to desiredFabricDomainName for backwards compatibility
93+
$collectionName = Get-AzdEnvValue -key 'purviewCollectionName'
94+
if (-not $collectionName) { $collectionName = Get-AzdEnvValue -key 'desiredFabricDomainName' }
9395
$purviewAccountResourceId = Get-AzdEnvValue -key 'purviewAccountResourceId'
9496
$purviewSubscriptionId = Get-AzdEnvValue -key 'purviewSubscriptionId'
9597
$purviewResourceGroup = Get-AzdEnvValue -key 'purviewResourceGroup'
@@ -106,7 +108,7 @@ if ($purviewAccountResourceId) {
106108
if (-not $purviewAccountName -or -not $collectionName) {
107109
$missing = @()
108110
if (-not $purviewAccountName) { $missing += 'purviewAccountName' }
109-
if (-not $collectionName) { $missing += 'desiredFabricDomainName' }
111+
if (-not $collectionName) { $missing += 'purviewCollectionName or desiredFabricDomainName' }
110112
Warn "Skipping Purview datasource registration; missing env values: $($missing -join ', ')"
111113
Clear-SensitiveVariables -VariableNames @('purviewToken')
112114
exit 0
@@ -256,7 +258,7 @@ if ($fabricDatasourceName) {
256258
$anyPbi = $existing.value | Where-Object { $_.kind -eq 'PowerBI' } | Select-Object -First 1
257259
}
258260
if ($anyPbi) {
259-
Warn "Found existing PowerBI datasource '${($anyPbi.name)}' registered under a collection and no root-level Fabric datasource exists. Using that datasource and not creating a new root-level datasource."
261+
Warn "Found existing PowerBI datasource '$($anyPbi.name)' registered under a collection and no root-level Fabric datasource exists. Using that datasource and not creating a new root-level datasource."
260262
$fabricDatasourceName = $anyPbi.name
261263
$collectionRef = $anyPbi.properties.collection.referenceName
262264
if ($collectionRef) { $collectionId = $collectionRef }

0 commit comments

Comments
 (0)