forked from Azure/azure-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_help.py
More file actions
3187 lines (2895 loc) · 153 KB
/
_help.py
File metadata and controls
3187 lines (2895 loc) · 153 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from knack.help_files import helps # pylint: disable=unused-import
# pylint: disable=line-too-long, too-many-lines
helps['storage'] = """
type: group
short-summary: Manage Azure Cloud Storage resources.
"""
helps['storage account'] = """
type: group
short-summary: Manage storage accounts.
"""
helps['storage account check-name'] = """
type: command
short-summary: Check that the storage account name is valid and is not already in use.
"""
helps['storage account blob-inventory-policy'] = """
type: group
short-summary: Manage storage account Blob Inventory Policy.
"""
helps['storage account blob-inventory-policy create'] = """
type: command
short-summary: Create Blob Inventory Policy for storage account.
examples:
- name: Create Blob Inventory Policy through json file for storage account.
text: az storage account blob-inventory-policy create -g myresourcegroup --account-name mystorageaccount --policy @policy.json
"""
helps['storage account blob-inventory-policy show'] = """
type: command
short-summary: Show Blob Inventory Policy properties associated with the specified storage account.
examples:
- name: Show Blob Inventory Policy properties associated with the specified storage account without prompt.
text: az storage account blob-inventory-policy show -g ResourceGroupName --account-name storageAccountName
"""
helps['storage account blob-inventory-policy update'] = """
type: command
short-summary: Update Blob Inventory Policy associated with the specified storage account.
examples:
- name: Update Blob Inventory Policy associated with the specified storage account.
text: az storage account blob-inventory-policy update -g ResourceGroupName --account-name storageAccountName --set "policy.rules[0].name=newname"
"""
helps['storage account blob-inventory-policy delete'] = """
type: command
short-summary: Delete Blob Inventory Policy associated with the specified storage account.
examples:
- name: Delete Blob Inventory Policy associated with the specified storage account without prompt.
text: az storage account blob-inventory-policy delete -g ResourceGroupName --account-name storageAccountName -y
"""
helps['storage account blob-service-properties'] = """
type: group
short-summary: Manage the properties of a storage account's blob service.
"""
helps['storage account blob-service-properties show'] = """
type: command
short-summary: Show the properties of a storage account's blob service.
long-summary: >
Show the properties of a storage account's blob service, including
properties for Storage Analytics and CORS (Cross-Origin Resource
Sharing) rules.
examples:
- name: Show the properties of the storage account 'mystorageaccount' in resource group 'MyResourceGroup'.
text: az storage account blob-service-properties show -n mystorageaccount -g MyResourceGroup
"""
helps['storage account blob-service-properties update'] = """
type: command
short-summary: Update the properties of a storage account's blob service.
long-summary: >
Update the properties of a storage account's blob service, including
properties for Storage Analytics and CORS (Cross-Origin Resource
Sharing) rules.
parameters:
- name: --enable-change-feed
short-summary: 'Indicate whether change feed event logging is enabled. If it is true, you enable the storage account to begin capturing changes. The default value is true. You can see more details in https://learn.microsoft.com/azure/storage/blobs/storage-blob-change-feed?tabs=azure-portal#register-by-using-azure-cli'
- name: --enable-delete-retention
short-summary: 'Indicate whether delete retention policy is enabled for the blob service.'
- name: --delete-retention-days
short-summary: 'Indicate the number of days that the deleted blob should be retained. The value must be in range [1,365]. It must be provided when `--enable-delete-retention` is true.'
examples:
- name: Enable change feed and set change feed retention days to infinite for the storage account 'mystorageaccount' in resource group 'myresourcegroup'.
text: az storage account blob-service-properties update --enable-change-feed true -n mystorageaccount -g myresourcegroup
- name: Enable change feed and set change feed retention days to 100 for the storage account 'mystorageaccount' in resource group 'myresourcegroup'.
text: az storage account blob-service-properties update --enable-change-feed --change-feed-days 100 -n mystorageaccount -g myresourcegroup
- name: Disable change feed for the storage account 'mystorageaccount' in resource group 'myresourcegroup'.
text: az storage account blob-service-properties update --enable-change-feed false -n mystorageaccount -g myresourcegroup
- name: Enable delete retention policy and set delete retention days to 100 for the storage account 'mystorageaccount' in resource group 'myresourcegroup'.
text: az storage account blob-service-properties update --enable-delete-retention true --delete-retention-days 100 -n mystorageaccount -g myresourcegroup
- name: Enable versioning for the storage account 'mystorageaccount' in resource group 'myresourcegroup'.
text: az storage account blob-service-properties update --enable-versioning -n mystorageaccount -g myresourcegroup
- name: Set default version for incoming request for storage account 'mystorageaccount'.
text: az storage account blob-service-properties update --default-service-version 2020-04-08 -n mystorageaccount -g myresourcegroup
"""
helps['storage account blob-service-properties cors-rule'] = """
type: group
short-summary: Manage the Cross-Origin Resource Sharing (CORS) rules of a storage account's blob service properties.
"""
helps['storage account blob-service-properties cors-rule list'] = """
type: command
short-summary: List all CORS rules of a storage account's blob service properties.
examples:
- name: List all CORS rules of a storage account
text: |
az storage account blob-service-properties cors-rule list --account-name mystorageaccount --resource-group myresourcegroup
"""
helps['storage account blob-service-properties cors-rule clear'] = """
type: command
short-summary: Clear all CORS rules for a storage account.
examples:
- name: Clear all CORS rules for a storage account
text: |
az storage account blob-service-properties cors-rule clear --account-name mystorageaccount --resource-group myresourcegroup
"""
helps['storage account blob-service-properties cors-rule add'] = """
type: command
short-summary: Add a CORS rule for a storage account.
examples:
- name: Add a CORS rule for a storage account
text: |
az storage account blob-service-properties cors-rule add --account-name mystorageaccount --resource-group myresourcegroup --allowed-origins "http://*.contoso.com" --allowed-methods PUT GET --max-age 200
"""
helps['storage account create'] = """
type: command
short-summary: Create a storage account.
long-summary: >
The SKU of the storage account defaults to 'Standard_RAGRS'.
examples:
- name: Create a storage account 'mystorageaccount' in resource group 'MyResourceGroup' in the West US region with locally redundant storage.
text: az storage account create -n mystorageaccount -g MyResourceGroup -l westus --sku Standard_LRS
- name: Create a storage account 'mystorageaccount' in resource group 'MyResourceGroup' in the eastus2euap region with account-scoped encryption key enabled for Table Service.
text: az storage account create -n mystorageaccount -g MyResourceGroup --kind StorageV2 -l eastus2euap -t Account
"""
helps['storage account delete'] = """
type: command
short-summary: Delete a storage account.
examples:
- name: Delete a storage account using a resource ID.
text: az storage account delete --ids /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Storage/storageAccounts/{StorageAccount}
- name: Delete a storage account using an account name and resource group.
text: az storage account delete -n MyStorageAccount -g MyResourceGroup
"""
helps['storage account encryption-scope'] = """
type: group
short-summary: Manage encryption scope for a storage account.
"""
helps['storage account encryption-scope create'] = """
type: command
short-summary: Create an encryption scope within storage account.
examples:
- name: Create an encryption scope within storage account based on Microsoft.Storage key source.
text: |
az storage account encryption-scope create --name myencryption -s Microsoft.Storage --account-name mystorageaccount -g MyResourceGroup
- name: Create an encryption scope within storage account based on Microsoft.KeyVault key source.
text: |
az storage account encryption-scope create --name myencryption -s Microsoft.KeyVault -u "https://vaultname.vault.azure.net/keys/keyname/1f7fa7edc99f4cdf82b5b5f32f2a50a7" --account-name mystorageaccount -g MyResourceGroup
- name: Create an encryption scope within storage account. (autogenerated)
text: |
az storage account encryption-scope create --account-name mystorageaccount --key-source Microsoft.Storage --name myencryption --resource-group MyResourceGroup --subscription mysubscription
crafted: true
"""
helps['storage account encryption-scope list'] = """
type: command
short-summary: List encryption scopes within storage account.
examples:
- name: List encryption scopes within storage account.
text: |
az storage account encryption-scope list --account-name mystorageaccount -g MyResourceGroup
- name: List encryption scopes starting with specific name.
text: |
az storage account encryption-scope list --account-name mystorageaccount -g myresourcegroup --filter 'startswith(name, value)'
"""
helps['storage account encryption-scope show'] = """
type: command
short-summary: Show properties for specified encryption scope within storage account.
examples:
- name: Show properties for specified encryption scope within storage account.
text: |
az storage account encryption-scope show --name myencryption --account-name mystorageaccount -g MyResourceGroup
"""
helps['storage account encryption-scope update'] = """
type: command
short-summary: Update properties for specified encryption scope within storage account.
examples:
- name: Update an encryption scope key source to Microsoft.Storage.
text: |
az storage account encryption-scope update --name myencryption -s Microsoft.Storage --account-name mystorageaccount -g MyResourceGroup
- name: Create an encryption scope within storage account based on Microsoft.KeyVault key source.
text: |
az storage account encryption-scope update --name myencryption -s Microsoft.KeyVault -u "https://vaultname.vault.azure.net/keys/keyname/1f7fa7edc99f4cdf82b5b5f32f2a50a7" --account-name mystorageaccount -g MyResourceGroup
- name: Disable an encryption scope within storage account.
text: |
az storage account encryption-scope update --name myencryption --state Disabled --account-name mystorageaccount -g MyResourceGroup
- name: Enable an encryption scope within storage account.
text: |
az storage account encryption-scope update --name myencryption --state Enabled --account-name mystorageaccount -g MyResourceGroup
"""
helps['storage account failover'] = """
type: command
short-summary: Failover request can be triggered for a storage account in case of availability issues.
long-summary: |
The failover occurs from the storage account's primary cluster to secondary cluster for (RA-)GRS/GZRS accounts. The secondary
cluster will become primary after failover. For more information, please refer to
https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance.
examples:
- name: Failover a storage account.
text: |
az storage account failover -n mystorageaccount -g MyResourceGroup
- name: Failover a storage account without waiting for complete.
text: |
az storage account failover -n mystorageaccount -g MyResourceGroup --no-wait
az storage account show -n mystorageaccount --expand geoReplicationStats
"""
helps['storage account generate-sas'] = """
type: command
short-summary: Generate a shared access signature for the storage account.
parameters:
- name: --services
short-summary: 'The storage services the SAS is applicable for. Allowed values: (b)lob (f)ile (q)ueue (t)able. Can be combined.'
- name: --resource-types
short-summary: 'The resource types the SAS is applicable for. Allowed values: (s)ervice (c)ontainer (o)bject. Can be combined.'
- name: --expiry
short-summary: Specifies the UTC datetime (Y-m-d'T'H:M'Z') at which the SAS becomes invalid.
- name: --start
short-summary: Specifies the UTC datetime (Y-m-d'T'H:M'Z') at which the SAS becomes valid. Defaults to the time of the request.
- name: --account-name
short-summary: 'Storage account name. Must be used in conjunction with either storage account key or a SAS token. Environment Variable: AZURE_STORAGE_ACCOUNT'
examples:
- name: Generate a sas token for the account that is valid for queue and table services on Linux.
text: |
end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
az storage account generate-sas --permissions cdlruwap --account-name MyStorageAccount --services qt --resource-types sco --expiry $end -o tsv
- name: Generate a sas token for the account that is valid for queue and table services on MacOS.
text: |
end=`date -v+30M '+%Y-%m-%dT%H:%MZ'`
az storage account generate-sas --permissions cdlruwap --account-name MyStorageAccount --services qt --resource-types sco --expiry $end -o tsv
- name: Generate a shared access signature for the account (autogenerated)
text: |
az storage account generate-sas --account-key 00000000 --account-name MyStorageAccount --expiry 2020-01-01 --https-only --permissions acuw --resource-types co --services bfqt
crafted: true
"""
helps['storage account file-service-properties'] = """
type: group
short-summary: Manage the properties of file service in storage account.
"""
helps['storage account file-service-properties show'] = """
type: command
short-summary: Show the properties of file service in storage account.
long-summary: >
Show the properties of file service in storage account.
examples:
- name: Show the properties of file service in storage account.
text: az storage account file-service-properties show -n mystorageaccount -g MyResourceGroup
"""
helps['storage account file-service-properties update'] = """
type: command
short-summary: Update the properties of file service in storage account.
long-summary: >
Update the properties of file service in storage account.
examples:
- name: Enable soft delete policy and set delete retention days to 100 for file service in storage account.
text: az storage account file-service-properties update --enable-delete-retention true --delete-retention-days 100 -n mystorageaccount -g MyResourceGroup
- name: Disable soft delete policy for file service.
text: az storage account file-service-properties update --enable-delete-retention false -n mystorageaccount -g MyResourceGroup
- name: Enable SMB Multichannel setting for file service.
text: az storage account file-service-properties update --enable-smb-multichannel -n mystorageaccount -g MyResourceGroup
- name: Disable SMB Multichannel setting for file service.
text: az storage account file-service-properties update --enable-smb-multichannel false -n mystorageaccount -g MyResourceGroup
- name: Set secured SMB setting for file service.
text: >
az storage account file-service-properties update --versions SMB2.1;SMB3.0;SMB3.1.1
--auth-methods NTLMv2;Kerberos --kerb-ticket-encryption RC4-HMAC;AES-256
--channel-encryption AES-128-CCM;AES-128-GCM;AES-256-GCM -n mystorageaccount -g MyResourceGroup
"""
helps['storage account keys'] = """
type: group
short-summary: Manage storage account keys.
"""
helps['storage account keys list'] = """
type: command
short-summary: List the access keys or Kerberos keys (if active directory enabled) for a storage account.
examples:
- name: List the access keys for a storage account.
text: az storage account keys list -g MyResourceGroup -n MyStorageAccount
- name: List the access keys and Kerberos keys (if active directory enabled) for a storage account.
text: az storage account keys list -g MyResourceGroup -n MyStorageAccount --expand-key-type kerb
"""
helps['storage account keys renew'] = """
type: command
short-summary: Regenerate one of the access keys or Kerberos keys (if active directory enabled) for a storage account.
long-summary: >
Kerberos key is generated per storage account for Azure Files identity based authentication either with
Azure Active Directory Domain Service (Azure AD DS) or Active Directory Domain Service (AD DS). It is used as the
password of the identity registered in the domain service that represents the storage account. Kerberos key does not
provide access permission to perform any control or data plane read or write operations against the storage account.
examples:
- name: Regenerate one of the access keys for a storage account.
text: az storage account keys renew -g MyResourceGroup -n MyStorageAccount --key primary
- name: Regenerate one of the Kerberos keys for a storage account.
text: az storage account keys renew -g MyResourceGroup -n MyStorageAccount --key secondary --key-type kerb
"""
helps['storage account list'] = """
type: command
short-summary: List storage accounts.
examples:
- name: List all storage accounts in a subscription.
text: az storage account list
- name: List all storage accounts in a resource group.
text: az storage account list -g MyResourceGroup
"""
helps['storage account management-policy'] = """
type: group
short-summary: Manage storage account management policies.
"""
helps['storage account management-policy create'] = """
type: command
short-summary: Create the data policy rules associated with the specified storage account.
examples:
- name: Create the data policy rules associated with the specified storage account. (autogenerated)
text: |
az storage account management-policy create --account-name myaccount --policy @policy.json --resource-group myresourcegroup
crafted: true
"""
helps['storage account management-policy update'] = """
type: command
short-summary: Update the data policy rules associated with the specified storage account.
examples:
- name: Update the data policy rules associated with the specified storage account.
text: |
az storage account management-policy update --account-name myaccount --resource-group myresourcegroup --set policy.rules[0].name=newname
"""
helps['storage account management-policy show'] = """
type: command
short-summary: Get the data policy rules associated with the specified storage account.
"""
helps['storage account management-policy delete'] = """
type: command
short-summary: Delete the data policy rules associated with the specified storage account.
"""
helps['storage account network-rule'] = """
type: group
short-summary: Manage network rules.
"""
helps['storage account network-rule add'] = """
type: command
short-summary: Add a network rule.
long-summary: >
Rules can be created for an IPv4 address, address range (CIDR format), or a virtual network subnet.
examples:
- name: Create a rule to allow a specific address-range.
text: az storage account network-rule add -g myRg --account-name mystorageaccount --ip-address 23.45.1.0/24
- name: Create a rule to allow access for a subnet.
text: az storage account network-rule add -g myRg --account-name mystorageaccount --vnet-name myvnet --subnet mysubnet
- name: Create a rule to allow access for a subnet in another resource group.
text: az storage account network-rule add -g myRg --account-name mystorageaccount --subnet $subnetId
"""
helps['storage account network-rule list'] = """
type: command
short-summary: List network rules.
examples:
- name: List network rules. (autogenerated)
text: |
az storage account network-rule list --account-name MyAccount --resource-group MyResourceGroup
crafted: true
"""
helps['storage account network-rule remove'] = """
type: command
short-summary: Remove a network rule.
examples:
- name: Remove a network rule. (autogenerated)
text: |
az storage account network-rule remove --account-name MyAccount --resource-group MyResourceGroup --subnet MySubnetID
crafted: true
- name: Remove a network rule. (autogenerated)
text: |
az storage account network-rule remove --account-name MyAccount --ip-address 23.45.1.0/24 --resource-group MyResourceGroup
crafted: true
"""
helps['storage account or-policy'] = """
type: group
short-summary: Manage storage account Object Replication Policy.
"""
helps['storage account or-policy create'] = """
type: command
short-summary: Create Object Replication Service Policy for storage account.
examples:
- name: Create Object Replication Service Policy for storage account.
text: az storage account or-policy create -g ResourceGroupName -n storageAccountName -d destAccountName -s srcAccountName --destination-container dcont --source-container scont
- name: Create Object Replication Service Policy through json file for storage account.
text: az storage account or-policy create -g ResourceGroupName -n storageAccountName --policy @policy.json
- name: Create Object Replication Service Policy to source storage account through policy associated with destination storage account.
text: az storage account or-policy show -g ResourceGroupName -n destAccountName --policy-id "3496e652-4cea-4581-b2f7-c86b3971ba92" | az storage account or-policy create -g ResourceGroupName -n srcAccountName -p "@-"
"""
helps['storage account or-policy list'] = """
type: command
short-summary: List Object Replication Service Policies associated with the specified storage account.
examples:
- name: List Object Replication Service Policies associated with the specified storage account.
text: az storage account or-policy list -g ResourceGroupName -n StorageAccountName
"""
helps['storage account or-policy delete'] = """
type: command
short-summary: Delete specified Object Replication Service Policy associated with the specified storage account.
examples:
- name: Delete Object Replication Service Policy associated with the specified storage account.
text: az storage account or-policy delete -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8"
"""
helps['storage account or-policy show'] = """
type: command
short-summary: Show the properties of specified Object Replication Service Policy for storage account.
examples:
- name: Show the properties of specified Object Replication Service Policy for storage account.
text: az storage account or-policy show -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8"
"""
helps['storage account or-policy update'] = """
type: command
short-summary: Update Object Replication Service Policy properties for storage account.
examples:
- name: Update source storage account in Object Replication Service Policy.
text: az storage account or-policy update -g ResourceGroupName -n StorageAccountName --source-account newSourceAccount --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8"
- name: Update Object Replication Service Policy through json file.
text: az storage account or-policy update -g ResourceGroupName -n StorageAccountName -p @policy.json
"""
helps['storage account or-policy rule'] = """
type: group
short-summary: Manage Object Replication Service Policy Rules.
"""
helps['storage account or-policy rule add'] = """
type: command
short-summary: Add rule to the specified Object Replication Service Policy.
examples:
- name: Add rule to the specified Object Replication Service Policy.
text: az storage account or-policy rule add -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" -d destContainer -s srcContainer
"""
helps['storage account or-policy rule list'] = """
type: command
short-summary: List all the rules in the specified Object Replication Service Policy.
examples:
- name: List all the rules in the specified Object Replication Service Policy.
text: az storage account or-policy rule list -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8"
"""
helps['storage account or-policy rule remove'] = """
type: command
short-summary: Remove the specified rule from the specified Object Replication Service Policy.
examples:
- name: Remove the specified rule from the specified Object Replication Service Policy.
text: az storage account or-policy rule remove -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" --rule-id "78746d86-d3b7-4397-a99c-0837e6741332"
"""
helps['storage account or-policy rule show'] = """
type: command
short-summary: Show the properties of specified rule in Object Replication Service Policy.
examples:
- name: Show the properties of specified rule in Object Replication Service Policy.
text: az storage account or-policy rule show -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" --rule-id "78746d86-d3b7-4397-a99c-0837e6741332"
"""
helps['storage account or-policy rule update'] = """
type: command
short-summary: Update rule properties to Object Replication Service Policy.
examples:
- name: Update rule properties to Object Replication Service Policy.
text: az storage account or-policy rule update -g ResourceGroupName -n StorageAccountName --policy-id "04344ea7-aa3c-4846-bfb9-e908e32d3bf8" --rule-id "78746d86-d3b7-4397-a99c-0837e6741332" --prefix-match blobA blobB
"""
helps['storage account private-endpoint-connection'] = """
type: group
short-summary: Manage storage account private endpoint connection.
"""
helps['storage account private-endpoint-connection approve'] = """
type: command
short-summary: Approve a private endpoint connection request for storage account.
examples:
- name: Approve a private endpoint connection request for storage account by ID.
text: |
az storage account private-endpoint-connection approve --id "/subscriptions/0000-0000-0000-0000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/privateEndpointConnections/mystorageaccount.b56b5a95-0588-4f8b-b348-15db61590a6c"
- name: Approve a private endpoint connection request for storage account by ID.
text: |
id = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].id")
az storage account private-endpoint-connection approve --id $id
- name: Approve a private endpoint connection request for storage account using account name and connection name.
text: |
az storage account private-endpoint-connection approve -g myRg --account-name mystorageaccount --name myconnection
- name: Approve a private endpoint connection request for storage account using account name and connection name.
text: |
name = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].name")
az storage account private-endpoint-connection approve -g myRg --account-name mystorageaccount --name $name
"""
helps['storage account private-endpoint-connection delete'] = """
type: command
short-summary: Delete a private endpoint connection request for storage account.
examples:
- name: Delete a private endpoint connection request for storage account by ID.
text: |
az storage account private-endpoint-connection delete --id "/subscriptions/0000-0000-0000-0000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/privateEndpointConnections/mystorageaccount.b56b5a95-0588-4f8b-b348-15db61590a6c"
- name: Delete a private endpoint connection request for storage account by ID.
text: |
id = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].id")
az storage account private-endpoint-connection delete --id $id
- name: Delete a private endpoint connection request for storage account using account name and connection name.
text: |
az storage account private-endpoint-connection delete -g myRg --account-name mystorageaccount --name myconnection
- name: Delete a private endpoint connection request for storage account using account name and connection name.
text: |
name = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].name")
az storage account private-endpoint-connection delete -g myRg --account-name mystorageaccount --name $name
"""
helps['storage account private-endpoint-connection reject'] = """
type: command
short-summary: Reject a private endpoint connection request for storage account.
examples:
- name: Reject a private endpoint connection request for storage account by ID.
text: |
az storage account private-endpoint-connection reject --id "/subscriptions/0000-0000-0000-0000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/privateEndpointConnections/mystorageaccount.b56b5a95-0588-4f8b-b348-15db61590a6c"
- name: Reject a private endpoint connection request for storage account by ID.
text: |
id = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].id")
az storage account private-endpoint-connection reject --id $id
- name: Reject a private endpoint connection request for storage account using account name and connection name.
text: |
az storage account private-endpoint-connection reject -g myRg --account-name mystorageaccount --name myconnection
- name: Reject a private endpoint connection request for storage account using account name and connection name.
text: |
name = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].name")
az storage account private-endpoint-connection reject -g myRg --account-name mystorageaccount --name $name
"""
helps['storage account private-endpoint-connection show'] = """
type: command
short-summary: Show details of a private endpoint connection request for storage account.
examples:
- name: Show details of a private endpoint connection request for storage account by ID.
text: |
az storage account private-endpoint-connection show --id "/subscriptions/0000-0000-0000-0000/resourceGroups/MyResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount/privateEndpointConnections/mystorageaccount.b56b5a95-0588-4f8b-b348-15db61590a6c"
- name: Show details of a private endpoint connection request for storage account by ID.
text: |
id = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].id")
az storage account private-endpoint-connection show --id $id
- name: Show details of a private endpoint connection request for storage account using account name and connection name.
text: |
az storage account private-endpoint-connection show -g myRg --account-name mystorageaccount --name myconnection
- name: Show details of a private endpoint connection request for storage account using account name and connection name.
text: |
name = (az storage account show -n mystorageaccount --query "privateEndpointConnections[0].name")
az storage account private-endpoint-connection show -g myRg --account-name mystorageaccount --name $name
"""
helps['storage account private-link-resource'] = """
type: group
short-summary: Manage storage account private link resources.
"""
helps['storage account private-link-resource list'] = """
type: command
short-summary: Get the private link resources that need to be created for a storage account.
examples:
- name: Get the private link resources that need to be created for a storage account.
text: |
az storage account private-link-resource list --account-name mystorageaccount -g MyResourceGroup
"""
helps['storage account revoke-delegation-keys'] = """
type: command
short-summary: Revoke all user delegation keys for a storage account.
examples:
- name: Revoke all user delegation keys for a storage account by resource ID.
text: az storage account revoke-delegation-keys --ids /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Storage/storageAccounts/{StorageAccount}
- name: Revoke all user delegation keys for a storage account 'mystorageaccount' in resource group 'MyResourceGroup' in the West US region with locally redundant storage.
text: az storage account revoke-delegation-keys -n mystorageaccount -g MyResourceGroup
"""
helps['storage account show'] = """
type: command
short-summary: Show storage account properties.
examples:
- name: Show properties for a storage account by resource ID.
text: az storage account show --ids /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Storage/storageAccounts/{StorageAccount}
- name: Show properties for a storage account using an account name and resource group.
text: az storage account show -g MyResourceGroup -n MyStorageAccount
"""
helps['storage account show-connection-string'] = """
type: command
short-summary: Get the connection string for a storage account.
examples:
- name: Get a connection string for a storage account.
text: az storage account show-connection-string -g MyResourceGroup -n MyStorageAccount
- name: Get the connection string for a storage account. (autogenerated)
text: |
az storage account show-connection-string --name MyStorageAccount --resource-group MyResourceGroup --subscription MySubscription
crafted: true
"""
helps['storage account show-usage'] = """
type: command
short-summary: Show the current count and limit of the storage accounts under the subscription.
examples:
- name: Show the current count and limit of the storage accounts under the subscription. (autogenerated)
text: |
az storage account show-usage --location westus2
crafted: true
"""
helps['storage account update'] = """
type: command
short-summary: Update the properties of a storage account.
examples:
- name: Update the properties of a storage account. (autogenerated)
text: |
az storage account update --default-action Allow --name MyStorageAccount --resource-group MyResourceGroup
crafted: true
- name: Use a user-assigned managed identity instead of system-assigned managed identity
text: |
az storage account update --name <storage-account-name> --resource-group <resource-group-name> --encryption-key-vault <keyvault-uri> --encryption-key-name <key-name-in-keyvault> --encryption-key-source Microsoft.Keyvault --key-vault-user-identity-id <user-assigned-identity-id> --identity-type UserAssigned --user-identity-id <user-assigned-identity-id>`
"""
helps['storage account hns-migration'] = """
type: group
short-summary: Manage storage account migration to enable hierarchical namespace.
"""
helps['storage account hns-migration start'] = """
type: command
short-summary: Validate/Begin migrating a storage account to enable hierarchical namespace.
examples:
- name: Validate migrating a storage account to enable hierarchical namespace.
text: az storage account hns-migration start --type validation --name mystorageaccount --resource-group myresourcegroup
- name: Begin migrating a storage account to enable hierarchical namespace.
text: az storage account hns-migration start --type upgrade --name mystorageaccount --resource-group myresourcegroup
"""
helps['storage account hns-migration stop'] = """
type: command
short-summary: Stop the enabling hierarchical namespace migration of a storage account.
examples:
- name: Stop the enabling hierarchical namespace migration of a storage account.
text: az storage account hns-migration stop --name mystorageaccount --resource-group myresourcegroup
"""
helps['storage account local-user'] = """
type: group
short-summary: Manage storage account local users.
"""
helps['storage account local-user create'] = """
type: command
short-summary: Create a local user for a given storage account.
examples:
- name: Create a local-user with two permission scopes and an ssh-authorized-key
text: >
az storage account local-user create --account-name {account-name} -g {resource-group} -n {username}
--home-directory home --permission-scope permissions=r service=blob resource-name=container1
--permission-scope permissions=rw service=file resource-name=share2 --ssh-authorized-key key="ssh-rsa a2V5"
--has-ssh-key true --has-ssh-password --has-shared-key false
"""
helps['storage account local-user update'] = """
type: command
short-summary: Update properties for a local user.
examples:
- name: Update a local-user with one permission scopes and no ssh-key
text: >
az storage account local-user update --account-name {account-name} -g {resource-group} -n {username}
--permission-scope permissions=rw service=file resource-name=share2
--has-ssh-key false
"""
helps['storage account local-user delete'] = """
type: command
short-summary: Delete a local user.
examples:
- name: Delete a local-user
text: >
az storage account local-user delete --account-name {account-name} -g {resource-group} -n {username}
"""
helps['storage account local-user list'] = """
type: command
short-summary: List local users for a storage account.
examples:
- name: List local-user for a storage account
text: >
az storage account local-user list --account-name {account-name} -g {resource-group}
"""
helps['storage account local-user show'] = """
type: command
short-summary: Show info for a local user.
examples:
- name: Show info for a local-user
text: >
az storage account local-user show --account-name {account-name} -g {resource-group} -n {username}
"""
helps['storage account local-user list-keys'] = """
type: command
short-summary: List sharedkeys and sshAuthorizedKeys for a local user.
examples:
- name: List sharedkeys and sshAuthorizedKeys for a local-user
text: >
az storage account local-user list-keys --account-name {account-name} -g {resource-group} -n {username}
"""
helps['storage account local-user regenerate-password'] = """
type: command
short-summary: Regenerate sshPassword for a local user.
examples:
- name: Regenerate sshPassword for a local-user
text: >
az storage account local-user regenerate-password --account-name {account-name} -g {resource-group} -n {username}
"""
helps['storage blob'] = """
type: group
short-summary: Manage object storage for unstructured data (blobs).
long-summary: >
Please specify one of the following authentication parameters for your commands: --auth-mode, --account-key,
--connection-string, --sas-token. You also can use corresponding environment variables to store your authentication
credentials, e.g. AZURE_STORAGE_KEY, AZURE_STORAGE_CONNECTION_STRING and AZURE_STORAGE_SAS_TOKEN.
"""
helps['storage blob copy'] = """
type: group
short-summary: Manage blob copy operations. Use `az storage blob show` to check the status of the blobs.
"""
helps['storage blob copy start'] = """
type: command
short-summary: Copy a blob asynchronously. Use `az storage blob show` to check the status of the blobs.
parameters:
- name: --source-uri -u
type: string
short-summary: >
A URL of up to 2 KB in length that specifies an Azure file or blob.
The value should be URL-encoded as it would appear in a request URI.
If the source is in another account, the source must either be public
or must be authenticated via a shared access signature. If the source
is public, no authentication is required.
Examples:
`https://myaccount.blob.core.windows.net/mycontainer/myblob`,
`https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=<DateTime>`,
`https://otheraccount.blob.core.windows.net/mycontainer/myblob?sastoken`
- name: --destination-if-modified-since
type: string
short-summary: >
A DateTime value. Azure expects the date value passed in to be UTC.
If timezone is included, any non-UTC datetimes will be converted to UTC.
If a date is passed in without timezone info, it is assumed to be UTC.
Specify this conditional header to copy the blob only
if the destination blob has been modified since the specified date/time.
If the destination blob has not been modified, the Blob service returns
status code 412 (Precondition Failed).
- name: --destination-if-unmodified-since
type: string
short-summary: >
A DateTime value. Azure expects the date value passed in to be UTC.
If timezone is included, any non-UTC datetimes will be converted to UTC.
If a date is passed in without timezone info, it is assumed to be UTC.
Specify this conditional header to copy the blob only
if the destination blob has not been modified since the specified
date/time. If the destination blob has been modified, the Blob service
returns status code 412 (Precondition Failed).
- name: --source-if-modified-since
type: string
short-summary: >
A DateTime value. Azure expects the date value passed in to be UTC.
If timezone is included, any non-UTC datetimes will be converted to UTC.
If a date is passed in without timezone info, it is assumed to be UTC.
Specify this conditional header to copy the blob only if the source
blob has been modified since the specified date/time.
- name: --source-if-unmodified-since
type: string
short-summary: >
A DateTime value. Azure expects the date value passed in to be UTC.
If timezone is included, any non-UTC datetimes will be converted to UTC.
If a date is passed in without timezone info, it is assumed to be UTC.
Specify this conditional header to copy the blob only if the source blob
has not been modified since the specified date/time.
examples:
- name: Copy a blob asynchronously. Use `az storage blob show` to check the status of the blobs.
text: |
az storage blob copy start --account-key 00000000 --account-name MyAccount --destination-blob MyDestinationBlob --destination-container MyDestinationContainer --source-uri https://storage.blob.core.windows.net/photos
- name: Copy a blob asynchronously. Use `az storage blob show` to check the status of the blobs.
text: |
az storage blob copy start --account-name MyAccount --destination-blob MyDestinationBlob --destination-container MyDestinationContainer --sas-token $sas --source-uri https://storage.blob.core.windows.net/photos
- name: Copy a blob specific version
text: |
az storage blob copy start --account-name MyAccount --destination-blob MyDestinationBlob --destination-container MyDestinationContainer --source-uri https://my-account.blob.core.windows.net/my-container/my-blob?versionId=2022-03-21T18:28:44.4431011Z --auth-mode login
"""
helps['storage blob copy start-batch'] = """
type: command
short-summary: Copy multiple blobs to a blob container. Use `az storage blob show` to check the status of the blobs.
parameters:
- name: --destination-container -c
type: string
short-summary: The blob container where the selected source files or blobs will be copied to.
- name: --pattern
type: string
short-summary: The pattern used for globbing files or blobs in the source. The supported patterns are '*', '?', '[seq]', and '[!seq]'. For more information, please refer to https://docs.python.org/3/library/fnmatch.html.
long-summary: When you use '*' in --pattern, it will match any character including the the directory separator '/'.
- name: --dryrun
type: bool
short-summary: List the files or blobs to be uploaded. No actual data transfer will occur.
- name: --source-account-name
type: string
short-summary: The source storage account from which the files or blobs are copied to the destination. If omitted, the destination account is used.
- name: --source-account-key
type: string
short-summary: The account key for the source storage account.
- name: --source-container
type: string
short-summary: The source container from which blobs are copied.
- name: --source-share
type: string
short-summary: The source share from which files are copied.
- name: --source-uri
type: string
short-summary: A URI specifying a file share or blob container from which the files or blobs are copied.
long-summary: If the source is in another account, the source must either be public or be authenticated by using a shared access signature.
- name: --source-sas
type: string
short-summary: The shared access signature for the source storage account.
examples:
- name: Copy multiple blobs to a blob container. Use `az storage blob show` to check the status of the blobs. (autogenerated)
text: |
az storage blob copy start-batch --account-key 00000000 --account-name MyAccount --destination-container MyDestinationContainer --source-account-key MySourceKey --source-account-name MySourceAccount --source-container MySourceContainer
crafted: true
"""
helps['storage blob delete'] = """
type: command
short-summary: Mark a blob or snapshot for deletion.
long-summary: >
The blob is marked for later deletion during garbage collection. In order to delete a blob, all of its snapshots must also be deleted.
Both can be removed at the same time.
examples:
- name: Delete a blob.
text: az storage blob delete -c mycontainer -n MyBlob
- name: Delete a blob using login credentials.
text: az storage blob delete -c mycontainer -n MyBlob --account-name mystorageaccount --auth-mode login
"""
helps['storage blob undelete'] = """
type: command
short-summary: Restore soft deleted blob or snapshot.
long-summary: >
Operation will only be successful if used within the specified number of days set in the delete retention policy.
Attempting to undelete a blob or snapshot that is not soft deleted will succeed without any changes.
examples:
- name: Undelete a blob.
text: az storage blob undelete -c mycontainer -n MyBlob
- name: Undelete a blob using login credentials.
text: az storage blob undelete -c mycontainer -n MyBlob --account-name mystorageaccount --auth-mode login
"""
helps['storage blob delete-batch'] = """
type: command
short-summary: Delete blobs from a blob container recursively.
parameters:
- name: --source -s
type: string
short-summary: The blob container from where the files will be deleted.
long-summary: The source can be the container URL or the container name. When the source is the container URL, the storage account name will be parsed from the URL.
- name: --pattern
type: string
short-summary: The pattern used for globbing files or blobs in the source. The supported patterns are '*', '?', '[seq]', and '[!seq]'. For more information, please refer to https://docs.python.org/3/library/fnmatch.html.
long-summary: When you use '*' in --pattern, it will match any character including the the directory separator '/'. You can also try "az storage remove" command with --include and --exclude with azure cli >= 2.0.70 to match multiple patterns.
- name: --dryrun
type: bool
short-summary: Show the summary of the operations to be taken instead of actually deleting the file(s).
long-summary: If this is specified, it will ignore all the Precondition Arguments that include --if-modified-since and --if-unmodified-since. So the file(s) will be deleted with the command without --dryrun may be different from the result list with --dryrun flag on.
- name: --if-match
type: string
short-summary: An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.
- name: --if-none-match
type: string
short-summary: An ETag value, or the wildcard character (*).
long-summary: Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.
examples:
- name: Delete all blobs ending with ".py" in a container that have not been modified for 10 days.
text: |
date=`date -d "10 days ago" '+%Y-%m-%dT%H:%MZ'`
az storage blob delete-batch -s mycontainer --account-name mystorageaccount --pattern "*.py" --if-unmodified-since $date --auth-mode login
- name: Delete all the blobs in a directory named "dir" in a container named "mycontainer".
text: |
az storage blob delete-batch -s mycontainer --pattern "dir/*"
- name: Delete the blobs with the format 'cli-2018-xx-xx.txt' or 'cli-2019-xx-xx.txt' in a container.
text: |
az storage blob delete-batch -s mycontainer --pattern "cli-201[89]-??-??.txt"
- name: Delete all blobs with the format 'cli-201x-xx-xx.txt' except cli-2018-xx-xx.txt' and 'cli-2019-xx-xx.txt' in a container.
text: |
az storage blob delete-batch -s mycontainer --pattern "cli-201[!89]-??-??.txt"
"""
helps['storage blob download-batch'] = """
type: command
short-summary: Download blobs from a blob container recursively.
parameters:
- name: --source -s
type: string
short-summary: The blob container from where the files will be downloaded.
long-summary: The source can be the container URL or the container name. When the source is the container URL, the storage account name will be parsed from the URL.
- name: --destination -d
type: string
short-summary: The existing destination folder for this download operation.
- name: --pattern
type: string
short-summary: The pattern used for globbing files or blobs in the source. The supported patterns are '*', '?', '[seq]', and '[!seq]'. For more information, please refer to https://docs.python.org/3/library/fnmatch.html.
long-summary: When you use '*' in --pattern, it will match any character including the the directory separator '/'.
- name: --dryrun
type: bool
short-summary: Show the summary of the operations to be taken instead of actually downloading the file(s).
examples:
- name: Download all blobs that end with .py
text: |
az storage blob download-batch -d . --pattern "*.py" -s mycontainer --account-name mystorageaccount --account-key 00000000
- name: Download all blobs in a directory named "dir" from container named "mycontainer".
text: |
az storage blob download-batch -d . -s mycontainer --pattern "dir/*"
- name: Download all blobs with the format 'cli-2018-xx-xx.txt' or 'cli-2019-xx-xx.txt' in container to current path.
text: |
az storage blob download-batch -d . -s mycontainer --pattern "cli-201[89]-??-??.txt"
- name: Download all blobs with the format 'cli-201x-xx-xx.txt' except cli-2018-xx-xx.txt' and 'cli-2019-xx-xx.txt' in container to current path.
text: |
az storage blob download-batch -d . -s mycontainer --pattern "cli-201[!89]-??-??.txt"
"""
helps['storage blob exists'] = """
type: command
short-summary: Check for the existence of a blob in a container.
parameters:
- name: --name -n
short-summary: The blob name.
examples:
- name: Check for the existence of a blob in a container. (autogenerated)
text: |
az storage blob exists --account-key 00000000 --account-name MyAccount --container-name mycontainer --name MyBlob
crafted: true
"""
helps['storage blob generate-sas'] = """
type: command
short-summary: Generate a shared access signature for the blob.
examples: