Created
May 27, 2015 16:15
-
-
Save wgv-zbonham/78807996437c048d3d59 to your computer and use it in GitHub Desktop.
Storage Context for Non Default Azure Environments
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
<# | |
We only get Azure commercial and Azure China by default but this seems to work for Azure Gov by specifying the -Endpoint parameter | |
#> | |
$storageKey = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("My really long key that came from somewhere else and why isn't there a get-base64string cmdlet already??")) | |
$context = New-AzureStorageContext -StorageAccountName "Testing" -StorageAccountKey $storageKey -Endpoint "core.usgovcloudapp.net" | |
$context | |
StorageAccountName : Testing | |
BlobEndPoint : https://testing.blob.core.usgovcloudapp.net/ | |
TableEndPoint : https://testing.table.core.usgovcloudapp.net/ | |
QueueEndPoint : https://testing.queue.core.usgovcloudapp.net/ | |
Context : Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext | |
Name : | |
StorageAccount : BlobEndpoint=https://testing.blob.core.usgovcloudapp.net/;QueueEndpoint=https://testing.queue.core | |
.usgovcloudapp.net/;TableEndpoint=https://testing.table.core.usgovcloudapp.net/;FileEndpoint=https | |
://testing.file.core.usgovcloudapp.net/;AccountName=Testing;AccountKey=[key hidden] | |
EndPointSuffix : core.usgovcloudapp.net/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try add the following cmd with New-AzureStorageContext
-Endpoint core.chinacloudapi.cn