-
Notifications
You must be signed in to change notification settings - Fork 16
feat(wellknown): add support for Tags in Set-Wellknown script #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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-Tagsfunction 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] |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
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.
| $result = $results.Response.value[0] | |
| $result = $results.Response.value | Where-Object { $_.displayName -eq "Test Tag" } | Select-Object -First 1 |
| function Set-Tags { | ||
| $results = Invoke-FabricRest -Method 'GET' -Endpoint "admin/tags" | ||
| $result = $results.Response.value[0] | ||
| if (-not $result) { | ||
| $payload = @{ | ||
| createTagsRequest = @( | ||
| @{ displayName = "Test Tag" } |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
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.
| 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 } |
📥 Pull Request
❓ What are you trying to address
Add support for Tags in Set-Wellknown script