共用方式為


Set-AzureStorageAccount

更新 Azure 訂用帳戶中記憶體帳戶的屬性。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

Set-AzureStorageAccount
   [-StorageAccountName] <String>
   [-Label <String>]
   [-Description <String>]
   [-Type <String>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]
Set-AzureStorageAccount
   [-StorageAccountName] <String>
   [-Label <String>]
   [-Description <String>]
   [-GeoReplicationEnabled <Boolean>]
   [-Profile <AzureSMProfile>]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [<CommonParameters>]

Description

Set-AzureStorageAccount Cmdlet 會更新目前訂用帳戶中 Azure 記憶體帳戶的屬性。 可設定的屬性包括: LabelDescriptionTypeGeoReplicationEnabled

範例

範例 1:更新記憶體帳戶的標籤

PS C:\> Set-AzureStorageAccount -StorageAccountName "ContosoStorage01" -Label "ContosoAccnt" -Description "Contoso storage account"

此命令會 更新名為 ContosoStorage01 之記憶體帳戶的標籤描述 屬性。

範例 2:啟用記憶體帳戶的異地複寫

PS C:\> Set-AzureStorageAccount -StorageAccountName "ContosoStorage01" -GeoReplicationEnabled $False

此命令會將名為 ContosoStorage01 之記憶體帳戶的 GeoReplicationEnabled 屬性設定為$False。

範例 3:停用記憶體帳戶的異地複寫

PS C:\> Set-AzureStorageAccount -StorageAccountName "ContosoStorage01" -GeoReplicationEnabled $True

此命令會將名為 ContosoStorage01 之記憶體帳戶的 GeoReplicationEnabled 屬性設定為$True。

參數

-Description

指定記憶體帳戶的描述。 描述長度最多可達 1024 個字元。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-GeoReplicationEnabled

指定是否建立已啟用異地複寫的記憶體帳戶。

類型:Boolean
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InformationAction

指定此 Cmdlet 如何回應資訊事件。

此參數可接受的值為:

  • 繼續
  • 忽略
  • 詢問
  • SilentlyContinue
  • 停止
  • 暫止
類型:ActionPreference
別名:infa
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InformationVariable

指定資訊變數。

類型:String
別名:iv
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Label

指定記憶體帳戶的標籤。 標籤長度最多可達 100 個字元。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-StorageAccountName

指定此 Cmdlet 修改的記憶體帳戶名稱。

類型:String
別名:ServiceName
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Type

指定記憶體帳戶的類型。 有效值為:

  • Standard_LRS
  • Standard_ZRS
  • Standard_GRS
  • Standard_RAGRS
  • Premium_LRS

如果未指定此參數,預設值會Standard_GRS。

指定 GeoReplicationEnabled 參數的效果與在 Type 參數中指定Standard_GRS相同。

Standard_ZRS或Premium_LRS帳戶無法變更為其他帳戶類型,反之亦然。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False