2017-08-02 43 views
0

我們正試圖獲取一個腳本來檢查當前的存儲複製設置(LRS,GAGRS,GRS),我們似乎無法在Google上找到任何內容。獲取AzureRMStorage複製設置

即使在低於我們的proerties沒有得到「複製」(除非我失去了一些東西)標題

有沒有辦法讓設置,最終如果錯誤是有辦法修改它?

我們希望他們都設置爲LRS,有些設置爲我們發現的GRS。

Login-AzurermAccount 
Select-AzureRmSubscription -SubscriptionId xxxxx-xxxxx-xxxxx-xxxxx 
Get-AzureRmStorageAccount -ResourceGroupName rg-name -Name storageaccountname 

ResourceGroupName  : rg-name 
StorageAccountName  : storageaccountname 
Id      : /subscriptions/xxxxx-xxxxx-xxxxx-xxxxx/resourceGroups/rg-name/providers/Microsoft.Sto 
         rage/storageAccounts/storageaccountname 
Location    : westeurope 
Sku     : Microsoft.Azure.Management.Storage.Models.Sku 
Kind     : Storage 
Encryption    : 
AccessTier    : 
CreationTime   : 23/03/2017 16:54:28 
CustomDomain   : 
Identity    : 
LastGeoFailoverTime : 
PrimaryEndpoints  : Microsoft.Azure.Management.Storage.Models.Endpoints 
PrimaryLocation  : westeurope 
ProvisioningState  : Succeeded 
SecondaryEndpoints  : 
SecondaryLocation  : 
StatusOfPrimary  : Available 
StatusOfSecondary  : 
Tags     : {[TAGS]} 
EnableHttpsTrafficOnly : False 
Context    : Microsoft.WindowsAzure.Commands.Common.Storage.LazyAzureStorageContext 
ExtendedProperties  : {} 

感謝您的幫助:)

+0

我看到這個問題沒有答案。您可以使用Azure Power Shell來解決它。我將它添加到答案中。希望它能幫助更多的人。 –

+0

如果您有Azure問題,最好添加標籤'Azure' –

回答

1

你可以使用Get-AzureRmStorageAccount列出複製信息。如下所示:

$storage=Get-AzureRmStorageAccount -Name "shuiwindiag907" -ResourceGroupName "shuiwin" 

$storage.Sku 

您將得到以下結果。

PS C:\Users\v-shshui> $storage.Sku 

     Name  Tier 
     ----  ---- 
StandardLRS Standard 

如果要更改複製,可以使用Set-AzureRmStorageAccount。例如:

Set-AzureRmStorageAccount -ResourceGroupName "MyResourceGroup" -AccountName "MyStorageAccount" -Type "Standard_RAGRS"