@@ -92,34 +92,54 @@ You can use this cmdlet to modify the account type, update a customer domain, or
92
92
## EXAMPLES
93
93
94
94
### Example 1: Set the Storage account type
95
+ <!-- Skip: Output cannot be splitted from code -->
96
+
97
+
98
+
95
99
```
96
100
PS C:\>Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -SkuName "Standard_RAGRS"
97
101
```
98
102
99
103
This command sets the Storage account type to Standard_RAGRS.
100
104
101
105
### Example 2: Set a custom domain for a Storage account
106
+ <!-- Skip: Output cannot be splitted from code -->
107
+
108
+
109
+
102
110
```
103
111
PS C:\>Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -CustomDomainName "www.contoso.com" -UseSubDomain $true
104
112
```
105
113
106
114
This command sets a custom domain for a Storage account.
107
115
108
116
### Example 3: Set the access tier value
117
+ <!-- Skip: Output cannot be splitted from code -->
118
+
119
+
120
+
109
121
```
110
122
PS C:\>Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -AccessTier Cool
111
123
```
112
124
113
125
The command sets the Access Tier value to be cool.
114
126
115
127
### Example 4: Set the custom domain and tags
128
+ <!-- Skip: Output cannot be splitted from code -->
129
+
130
+
131
+
116
132
```
117
133
PS C:\>Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -CustomDomainName "www.domainname.com" -UseSubDomain $true -Tag @{tag0="value0";tag1="value1";tag2="value2"}
118
134
```
119
135
120
136
The command sets the custom domain and tags for a Storage account.
121
137
122
138
### Example 5: Set Encryption KeySource to Keyvault
139
+ <!-- Skip: Output cannot be splitted from code -->
140
+
141
+
142
+
123
143
```
124
144
PS C:\>Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -AssignIdentity
125
145
PS C:\>$account = Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount"
@@ -139,13 +159,21 @@ This command set Encryption KeySource with a new created Keyvault.
139
159
If want to enable key auto rotation, don't set keyversion when set Keyvault properties for the first time, or clean up it by set keyvault properties again with keyversion as empty.
140
160
141
161
### Example 6: Set Encryption KeySource to "Microsoft.Storage"
162
+ <!-- Skip: Output cannot be splitted from code -->
163
+
164
+
165
+
142
166
```
143
167
PS C:\>Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -StorageEncryption
144
168
```
145
169
146
170
This command set Encryption KeySource to "Microsoft.Storage"
147
171
148
172
### Example 7: Set NetworkRuleSet property of a Storage account with JSON
173
+ <!-- Skip: Output cannot be splitted from code -->
174
+
175
+
176
+
149
177
```
150
178
PS C:\>Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -NetworkRuleSet (@{bypass="Logging,Metrics";
151
179
ipRules=(@{IPAddressOrRange="20.11.0.0/16";Action="allow"},
@@ -158,6 +186,10 @@ PS C:\>Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorag
158
186
This command sets NetworkRuleSet property of a Storage account with JSON
159
187
160
188
### Example 8: Get NetworkRuleSet property from a Storage account, and set it to another Storage account
189
+ <!-- Skip: Output cannot be splitted from code -->
190
+
191
+
192
+
161
193
```
162
194
PS C:\> $networkRuleSet = (Get-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount").NetworkRuleSet
163
195
PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount2" -NetworkRuleSet $networkRuleSet
@@ -166,6 +198,10 @@ PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystora
166
198
This first command gets NetworkRuleSet property from a Storage account, and the second command sets it to another Storage account
167
199
168
200
### Example 9: Upgrade a Storage account with Kind "Storage" or "BlobStorage" to "StorageV2" kind Storage account
201
+ <!-- Skip: Output cannot be splitted from code -->
202
+
203
+
204
+
169
205
```
170
206
PS C:\> Set-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -UpgradeToStorageV2
171
207
```
0 commit comments