Skip to content

Commit a17ad47

Browse files
authored
Fix ResourceUrl for Token Retrieval in Connect-FabricAccount (#51)
* Fix ResourceUrl for Token Retrieval in Connect-FabricAccount Updated the ResourceUrl used to retrieve the authentication token in the Connect-FabricAccount function. This change ensures that the correct API endpoint is utilized for obtaining the Fabric token, improving the reliability of the connection process for Pester Help Tests. Thank you! * Fixed a bug in New-FabricEventhouse that ran Invoke-RestMethod twice. Removed the ShouldProcess Check, rather than the one outside the ShouldProcess This change simplifies the API request process. * Add ShouldProcess check for API request in New-FabricEventhouse This change introduces a ShouldProcess check before making the API request to create a new Eventhouse. This ensures that the operation is confirmed by the user, enhancing safety and control over the action.
1 parent d771488 commit a17ad47

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

source/Public/Connect-FabricAccount.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function Connect-FabricAccount {
4141
Connect-AzAccount -TenantId $TenantId | Out-Null
4242

4343
Write-Verbose "Get authentication token"
44-
$FabricSession.FabricToken = (Get-AzAccessToken -ResourceUrl $FabricSession.BaseApiUrl).Token
44+
$FabricSession.FabricToken = (Get-AzAccessToken -ResourceUrl $FabricSession.ResourceUrl).Token
4545
Write-Verbose "Token: $($FabricSession.FabricToken)"
4646

4747
Write-Verbose "Setup headers for API calls"

source/Public/Eventhouse/New-FabricEventhouse.ps1

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,6 @@ function New-FabricEventhouse
152152
-ResponseHeadersVariable "responseHeader" `
153153
-StatusCodeVariable "statusCode"
154154
}
155-
# Step 4: Make the API request
156-
$response = Invoke-RestMethod `
157-
-Headers $FabricConfig.FabricHeaders `
158-
-Uri $apiEndpointUrl `
159-
-Method Post `
160-
-Body $bodyJson `
161-
-ContentType "application/json" `
162-
-ErrorAction Stop `
163-
-SkipHttpErrorCheck `
164-
-ResponseHeadersVariable "responseHeader" `
165-
-StatusCodeVariable "statusCode"
166155

167156
Write-Message -Message "Response Code: $statusCode" -Level Debug
168157

0 commit comments

Comments
 (0)