Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom Headers for Download-File (#3170)
In our pipelines we have the need to authenticate using Oauth2 since we have a private storage container, we are using your Download-File in the scripts and I do not want to use a SAS token. I did not find any other way than this, perhaps you have another idea that doesn't need a commit? :) ``` $context = New-BcAuthContext -clientID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ` -tenantID "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ` -clientSecret "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ` -scopes "https://storage.azure.com/.default" $headers = @{ "Authorization" = "Bearer $($context.accessToken)" "x-ms-version" = "2017-11-09" } Download-File -sourceUrl "https://storage.blob.core.windows.net/container/file.file" ` -destinationFile "c:\temp\file.file" ` -headers $headers ``` --------- Co-authored-by: Mathias Stjernfelt <[email protected]>
- Loading branch information