Azure-Samples / modern-data-warehouse-dataops

DataOps for Microsoft Data Platform technologies. https://aka.ms/dataops-repo
MIT License
588 stars 459 forks source link

Fix "targetStageWsName" handling in "run-deployment-pipelines.ps1" script #717

Open promisinganuj opened 4 months ago

promisinganuj commented 4 months ago

In the script run-deployment-pipelines.ps1, "targetStageWsName" is an optional parameter.

In case it's not passed at all, this would cause formatting issue and thus failure of the process.

https://github.com/Azure-Samples/modern-data-warehouse-dataops/blob/221732b9b475826d63cdbd36d93f4a52614bb1e7/single_tech_samples/fabric/fabric_ci_cd/devops/devops_scripts/run-deployment-pipelines.ps1#L75

    $deployBody = @{
...
        createdWorkspaceDetails = @{ #Required when deploying to a stage that has no assigned workspace
            Name = $targetStageWsName
        } 
...

The "Name" would become:

    $deployBody = @{
...
        createdWorkspaceDetails = @{ #Required when deploying to a stage that has no assigned workspace
            Name = 
        } 
...

and it would generate formatting error.

Proposed Fix:

Option 1 - Conditionally ignore this block if the value isn't passed. Option 2 - Set the default value as ''.

PS: This is reported by customer, and I haven't tested it myself.