File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,19 +77,23 @@ function Connect-FabricAccount {
7777 else {
7878 $null = Connect-AzAccount
7979 }
80-
80+
8181 $azContext = Get-AzContext
82+
83+ Write-Verbose " Connected: $ ( $azContext.Account ) "
84+
8285 if ($PSCmdlet.ShouldProcess (" Setting Fabric authentication token for $ ( $azContext.Account ) " )) {
83- Write-output " Connected: $ ( $azContext.Account ) "
86+
87+ Write-Verbose " Get authentication token"
88+ $FabricSession.FabricToken = (Get-AzAccessToken - ResourceUrl $FabricSession.ResourceUrl ).Token
89+ Write-Verbose " Token: $ ( $FabricSession.FabricToken ) "
90+ }
91+
92+ if ($PSCmdlet.ShouldProcess (" Setting Fabric headers for $ ( $azContext.Account ) " )) {
93+ Write-Verbose " Setup headers for API calls"
94+ $FabricSession.HeaderParams = @ {' Authorization' = " Bearer {0}" -f $FabricSession.FabricToken }
95+ Write-Verbose " HeaderParams: $ ( $FabricSession.HeaderParams ) "
8496 }
85-
86- Write-Verbose " Get authentication token"
87- $FabricSession.FabricToken = (Get-AzAccessToken - ResourceUrl $FabricSession.ResourceUrl ).Token
88- Write-Verbose " Token: $ ( $FabricSession.FabricToken ) "
89-
90- Write-Verbose " Setup headers for API calls"
91- $FabricSession.HeaderParams = @ {' Authorization' = " Bearer {0}" -f $FabricSession.FabricToken }
92- Write-Verbose " HeaderParams: $ ( $FabricSession.HeaderParams ) "
9397 }
9498 end {
9599 }
You can’t perform that action at this time.
0 commit comments