首页 > 代码库 > Microsoft AzureStorageAccount for Powershell

Microsoft AzureStorageAccount for Powershell

使用Powershell 创建的存储账户,注意StorageAccountName只能使用小写字母以及数字, -Location参考http://www.cnblogs.com/SignalTips/p/4111101.html

PS C:\WINDOWS\system32> New-AzureStorageAccount -StorageAccountName "andersonstorage1" -Label "AndersonStorage1" -Location "China East"OperationDescription                    OperationId                             OperationStatus--------------------                    -----------                             ---------------New-AzureStorageAccount                 ed58cdda-fcd7-4830-a901-8e58a5cc2e7d    SucceededPS C:\WINDOWS\system32> New-AzureStorageAccount -StorageAccountName "andersonstorage2" -Label "AndersonStorage2" -Location "China North"OperationDescription                    OperationId                             OperationStatus--------------------                    -----------                             ---------------New-AzureStorageAccount                 01ce6305-44ad-48f0-9277-c13440ee98d0    Succeeded

获取存储账户信息

PS C:\WINDOWS\system32> Get-AzureStorageAccountStorageAccountDescription :AffinityGroup             :Location                  : China EastGeoReplicationEnabled     : TrueGeoPrimaryLocation        : China EastGeoSecondaryLocation      : China NorthLabel                     : AndersonStorageStorageAccountStatus      : CreatedStatusOfPrimary           : AvailableStatusOfSecondary         : AvailableEndpoints                 : {https://andersonstorage.blob.core.chinacloudapi.cn/,                            https://andersonstorage.queue.core.chinacloudapi.cn/,                            https://andersonstorage.table.core.chinacloudapi.cn/}AccountType               : Standard_GRSStorageAccountName        : andersonstorageOperationDescription      : Get-AzureStorageAccountOperationId               : ec8de9f1-a197-49f5-99e8-5a959881e728OperationStatus           : SucceededWARNING: GeoReplicationEnabled property will be deprecated in a future release of Azure PowerShell. The value will bemerged into the AccountType property.PS C:\WINDOWS\system32>

订阅账号绑定或切换存储

PS C:\WINDOWS\system32> Set-AzureSubscription -SubscriptionName ‘Free‘ -CurrentStorageAccount ‘andersonstorage2‘PS C:\WINDOWS\system32> Get-AzureSubscription -SubscriptionName ‘Free‘SubscriptionId            : 36b1bd18-6519-4ea5-8d90-5300a6915a25SubscriptionName          : FreeEnvironment               : AzureChinaCloudSupportedModes            : AzureServiceManagementDefaultAccount            : Ling@SHTriathlon.partner.onmschina.cnAccounts                  : {}IsDefault                 : TrueIsCurrent                 : TrueCurrentStorageAccountName : andersonstorage2PS C:\WINDOWS\system32>

删除存储账户

PS C:\WINDOWS\system32> Remove-AzureStorageAccount -StorageAccountName "andersonstorage"StorageAccountName            OperationDescription          OperationId                   OperationStatus------------------            --------------------          -----------                   ---------------andersonstorage               Remove-AzureStorageAccount    495845d6-7818-4f3d-8b3c-9d... Succeeded

 在存储账户下创建容器,可以把容器想象成的文件夹,但只能建立一层文件夹 -Permission Off/Container/Blob对应门户Private/Public Container/Public Blob

 

PS C:\WINDOWS\system32> New-AzureStorageContainer containeranderson -Permission Off   Blob End Point: https://andersonstorage2.blob.core.chinacloudapi.cn/Name                                              PublicAccess         LastModified----                                              ------------         ------------containeranderson                                 Off                  11/26/2014 9:49:46 AM +00:00PS C:\WINDOWS\system32>

以下实例是创建多个容器

PS C:\WINDOWS\system32> "container1 container2 container3".split() | New-AzureStorageContainer -Permission Container   Blob End Point: https://andersonstorage.blob.core.chinacloudapi.cn/Name                                              PublicAccess         LastModified----                                              ------------         ------------container1                                        Container            11/26/2014 9:01:21 AM +00:00container2                                        Container            11/26/2014 9:01:20 AM +00:00container3                                        Container            11/26/2014 9:01:19 AM +00:00

 

 Windows Azure Storage Explorers (2014)

http://blogs.msdn.com/b/windowsazurestorage/archive/2014/03/11/windows-azure-storage-explorers-2014.aspx

 

 

Blob 管理工具

http://clumsyleaf.com/products/downloads

 

Azure Storage Explorer (CodePlex)

http://azurestorageexplorer.codeplex.com/

CloudXplorer - explore your favorite cloud storage with ease

http://clumsyleaf.com/products/cloudxplorer

Microsoft AzureStorageAccount for Powershell