Skip to content

Conversation

@CatalinDabuleanu
Copy link
Contributor

📥 Pull Request

❓ What are you trying to address

Add support for Tags in Set-Wellknown script

@CatalinDabuleanu CatalinDabuleanu requested a review from a team as a code owner October 21, 2025 01:03
Copilot AI review requested due to automatic review settings October 21, 2025 01:03
@CatalinDabuleanu CatalinDabuleanu added the skip-changelog Skip changelog entry label Oct 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Tags in the Set-WellKnown script by introducing functionality to retrieve or create a tag and store its metadata in the wellKnown configuration object.

Key changes:

  • Added a Set-Tags function to retrieve or create a tag via the Fabric REST API
  • Integrated tag metadata (id, displayName, scopeType) into the wellKnown configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


function Set-Tags {
$results = Invoke-FabricRest -Method 'GET' -Endpoint "admin/tags"
$result = $results.Response.value[0]
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code always selects the first tag from the response without validation. If the goal is to find a specific tag (e.g., 'Test Tag'), this should filter the results to match the expected tag rather than assuming the first tag is the correct one.

Suggested change
$result = $results.Response.value[0]
$result = $results.Response.value | Where-Object { $_.displayName -eq "Test Tag" } | Select-Object -First 1

Copilot uses AI. Check for mistakes.
Comment on lines +1718 to +1724
function Set-Tags {
$results = Invoke-FabricRest -Method 'GET' -Endpoint "admin/tags"
$result = $results.Response.value[0]
if (-not $result) {
$payload = @{
createTagsRequest = @(
@{ displayName = "Test Tag" }
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The hardcoded tag name 'Test Tag' should be extracted as a parameter or configuration variable to improve reusability and make the script more flexible.

Suggested change
function Set-Tags {
$results = Invoke-FabricRest -Method 'GET' -Endpoint "admin/tags"
$result = $results.Response.value[0]
if (-not $result) {
$payload = @{
createTagsRequest = @(
@{ displayName = "Test Tag" }
# Tag display name can be configured here
$TagDisplayName = "Test Tag"
function Set-Tags {
$results = Invoke-FabricRest -Method 'GET' -Endpoint "admin/tags"
$result = $results.Response.value[0]
if (-not $result) {
$payload = @{
createTagsRequest = @(
@{ displayName = $TagDisplayName }

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Skip changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants