Using Azure File Storage with Azure Government

Avatar

Shawn

So you have looked at the docs and you would like to give Azure File Storage a try, but you are having trouble connecting it to Azure Government following the instructions posted on the public Azure site?
http://azure.microsoft.com/en-us/services/storage/files/

Let me guess you are getting an error that says:
“The Remote name could not be resolved: ‘youracount.file.core.windows.net’”

Fear not the Azure Government Blog to the rescue!

It is an easy fix, just add the –Endpoint argument with the value of “core.usgovcloudapi.net” to your PowerShell and you should be good to go!

The full commands should look something like this:

$ctx=New-AzureStorageContext -StorageAccountName “<<MyAccount>>” -StorageAccountKey “<<MyKey>>” -Endpoint “core.usgovcloudapi.net”
$s = New-AzureStorageShare <<MyShare>> -Context $ctx
New-AzureStorageDirectory -Share $s -Path MyDir

net use z: \\<<MyAccount>>.file.core.usgovcloudapi.net\<<MyShare>> /u:<<MyAccount>> <<MyKey>>

Happy File Sharing 

Avatar
Shawn Weisfeld

Follow Shawn   

No Comments.