Skip to content

Commit

Permalink
key rotation whiteboard
Browse files Browse the repository at this point in the history
  • Loading branch information
johnthebrit committed Feb 21, 2023
1 parent dc68886 commit a95dde8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ManagedIdentity/mngidstoraccess.ps1
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
Binary file added Whiteboards/KeyRotationPolicy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a95dde8

Please sign in to comment.