-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc68886
commit a95dde8
Showing
2 changed files
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
#Using Az module | ||
Connect-AzAccount -Identity #Connect as the managed identity | ||
$storcontext = New-AzStorageContext -StorageAccountName 'sainfrastroragescus' -UseConnectedAccount | ||
Get-AzStorageBlobContent -Container 'images' -Blob '20200116_170521861_iOS.jpg' ` | ||
$storcontext = New-AzStorageContext -StorageAccountName 'sascussavilltech' -UseConnectedAccount | ||
Get-AzStorageBlobContent -Container 'images' -Blob 'OllieandEddieCerealEating.jpg' ` | ||
-Destination "C:\test\" -Context $storcontext | ||
|
||
#Integrate with Key Vault using token directly | ||
$response = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fvault.azure.net' -Method GET -Headers @{Metadata="true"} | ||
$response = Invoke-WebRequest -Uri 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net' -Method GET -Headers @{Metadata="true"} | ||
$content = $response.Content | ConvertFrom-Json | ||
$Token = $content.access_token | ||
|
||
(Invoke-WebRequest -Uri https://savkeyvault.vault.azure.net/secrets/TestSecret?api-version=2016-10-01 -Method GET -Headers @{Authorization="Bearer $Token"}).content | ||
(Invoke-WebRequest -Uri https://savillvaultrbac.vault.azure.net/secrets/Secret1?api-version=2016-10-01 -Method GET -Headers @{Authorization="Bearer $Token"}).content |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.