-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
_help.py
1831 lines (1640 loc) · 75.1 KB
/
_help.py
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['acr'] = """
type: group
short-summary: Manage private registries with Azure Container Registries.
"""
helps['acr build'] = """
type: command
short-summary: Queues a quick build, providing streaming logs for an Azure Container Registry.
examples:
- name: Queue a local context as a Linux build, tag it, and push it to the registry.
text: >
az acr build -t sample/hello-world:{{.Run.ID}} -r myregistry .
- name: Queue a local context as a Linux build, tag it, and push it to the registry without streaming logs.
text: >
az acr build -t sample/hello-world:{{.Run.ID}} -r myregistry --no-logs .
- name: Queue a local context as a Linux build without pushing it to the registry.
text: >
az acr build -t sample/hello-world:{{.Run.ID}} -r myregistry --no-push .
- name: Queue a local context as a Linux build without pushing it to the registry.
text: >
az acr build -r myregistry .
- name: Queue a remote GitHub context as a Windows build, tag it, and push it to the registry.
text: >
az acr build -r myregistry https://github.com/Azure/acr-builder.git -f Windows.Dockerfile --platform windows
- name: Queue a remote OCI Artifact context build.
text: >
az acr build -r myregistry oci://myregistry.azurecr.io/myartifact:mytag
- name: Queue a local context as a Linux build on arm/v7 architecture, tag it, and push it to the registry.
text: >
az acr build -t sample/hello-world:{{.Run.ID}} -r myregistry . --platform linux/arm/v7
"""
helps['acr check-health'] = """
type: command
short-summary: Gets health information on the environment and optionally a target registry.
examples:
- name: Gets health state with target registry 'myregistry', skipping confirmation for pulling image.
text: >
az acr check-health -n myregistry -y
- name: Gets health state of the environment, without stopping on first error.
text: >
az acr check-health --ignore-errors
"""
helps['acr check-name'] = """
type: command
short-summary: Checks if an Azure Container Registry name is valid and available for use.
examples:
- name: Check if a registry name already exists.
text: >
az acr check-name -n doesthisnameexist
"""
helps['acr config'] = """
type: group
short-summary: Configure policies for Azure Container Registries.
"""
helps['acr config content-trust'] = """
type: group
short-summary: Manage content-trust policy for Azure Container Registries.
"""
helps['acr config authentication-as-arm'] = """
type: group
short-summary: Manage 'Azure AD authenticate as ARM' policy for Azure Container Registries.
"""
helps['acr config authentication-as-arm show'] = """
type: command
short-summary: Show the configured 'Azure AD authenticate as ARM' policy for an Azure Container Registry.
examples:
- name: Show the configured 'Azure AD authenticate as ARM' policy for an Azure Container Registry
text: >
az acr config authentication-as-arm show -r myregistry
"""
helps['acr config authentication-as-arm update'] = """
type: command
short-summary: Update 'Azure AD authenticate as ARM' policy for an Azure Container Registry.
examples:
- name: Disable 'Azure AD authenticate as ARM' policy for an Azure Container Registry, so only ACR audienced tokens can be used for authentication
text: >
az acr config authentication-as-arm update -r myregistry --status Disabled
- name: Enable 'Azure AD authenticate as ARM' policy for an Azure Container Registry, it will allow both ACR and ARM audienced tokens to be used for authentication
text: >
az acr config authentication-as-arm update -r myregistry --status Enabled
"""
helps['acr config content-trust show'] = """
type: command
short-summary: Show the configured content-trust policy for an Azure Container Registry.
examples:
- name: Show the configured content-trust policy for an Azure Container Registry
text: >
az acr config content-trust show -r myregistry
"""
helps['acr config content-trust update'] = """
type: command
short-summary: Update content-trust policy for an Azure Container Registry.
examples:
- name: Update content-trust policy for an Azure Container Registry
text: >
az acr config content-trust update -r myregistry --status Enabled
"""
helps['acr config retention'] = """
type: group
short-summary: Manage retention policy for Azure Container Registries.
"""
helps['acr config retention show'] = """
type: command
short-summary: Show the configured retention policy for an Azure Container Registry.
examples:
- name: Show the configured retention policy for an Azure Container Registry
text: >
az acr config retention show -r myregistry
"""
helps['acr config retention update'] = """
type: command
short-summary: Update retention policy for an Azure Container Registry.
examples:
- name: Enable retention policy for an Azure Container Registry to delete an untagged manifest after 30 days.
text: >
az acr config retention update -r myregistry --status Enabled --days 30 --type UntaggedManifests
- name: Enable retention policy for an Azure Container Registry to delete a manifest as soon as it gets untagged.
text: >
az acr config retention update -r myregistry --status Enabled --days 0 --type UntaggedManifests
"""
helps['acr config soft-delete'] = """
type: group
short-summary: Manage soft-delete policy for Azure Container Registries.
"""
helps['acr config soft-delete show'] = """
type: command
short-summary: Show the configured soft-delete policy for an Azure Container Registry.
examples:
- name: Show the configured soft-delete policy for an Azure Container Registry
text: >
az acr config soft-delete show -r myregistry
"""
helps['acr config soft-delete update'] = """
type: command
short-summary: Update soft-delete policy for an Azure Container Registry.
examples:
- name: Enable soft-delete policy for an Azure Container Registry to purge a soft-deleted manifest after 30 days.
text: >
az acr config soft-delete update -r myregistry --status Enabled --days 30
"""
helps['acr create'] = """
type: command
short-summary: Create an Azure Container Registry.
examples:
- name: Create a managed container registry with the Standard SKU.
text: >
az acr create -n myregistry -g MyResourceGroup --sku Standard
"""
helps['acr credential'] = """
type: group
short-summary: Manage login credentials for Azure Container Registries.
"""
helps['acr credential renew'] = """
type: command
short-summary: Regenerate login credentials for an Azure Container Registry.
examples:
- name: Renew the second password for an Azure Container Registry.
text: >
az acr credential renew -n myregistry --password-name password2
- name: Regenerate login credentials for an Azure Container Registry. (autogenerated)
text: az acr credential renew --name myregistry --password-name password --resource-group MyResourceGroup
crafted: true
"""
helps['acr credential show'] = """
type: command
short-summary: Get the login credentials for an Azure Container Registry.
examples:
- name: Get the login credentials for an Azure Container Registry.
text: >
az acr credential show -n myregistry
- name: Get the username used to log in to an Azure Container Registry.
text: >
az acr credential show -n myregistry --query username
- name: Get a password used to log in to an Azure Container Registry.
text: >
az acr credential show -n myregistry --query 'passwords[0].value'
"""
helps['acr delete'] = """
type: command
short-summary: Deletes an Azure Container Registry.
examples:
- name: Delete an Azure Container Registry.
text: >
az acr delete -n myregistry
"""
helps['acr helm'] = """
type: group
short-summary: Manage helm charts for Azure Container Registries.
"""
helps['acr helm delete'] = """
type: command
short-summary: Delete a helm chart version in an Azure Container Registry.
examples:
- name: Delete all versions of a helm chart in an Azure Container Registry
text: >
az acr helm delete -n myregistry mychart
- name: Delete a helm chart version in an Azure Container Registry
text: >
az acr helm delete -n myregistry mychart --version 0.3.2
"""
helps['acr helm list'] = """
type: command
short-summary: List all helm charts in an Azure Container Registry.
examples:
- name: List all helm charts in an Azure Container Registry
text: >
az acr helm list -n myregistry
"""
helps['acr helm push'] = """
type: command
short-summary: Push a helm chart package to an Azure Container Registry.
examples:
- name: Push a chart package to an Azure Container Registry
text: >
az acr helm push -n myregistry mychart-0.3.2.tgz
- name: Push a chart package to an Azure Container Registry, overwriting the existing one.
text: >
az acr helm push -n myregistry mychart-0.3.2.tgz --force
"""
helps['acr helm repo'] = """
type: group
short-summary: Manage helm chart repositories for Azure Container Registries.
"""
helps['acr helm repo add'] = """
type: command
short-summary: Add a helm chart repository from an Azure Container Registry through the Helm CLI.
long-summary: Helm must be installed on your machine.
examples:
- name: Add a helm chart repository from an Azure Container Registry to manage helm charts.
text: >
az acr helm repo add -n myregistry
"""
helps['acr helm show'] = """
type: command
short-summary: Describe a helm chart in an Azure Container Registry.
examples:
- name: Show all versions of a helm chart in an Azure Container Registry
text: >
az acr helm show -n myregistry mychart
- name: Show a helm chart version in an Azure Container Registry
text: >
az acr helm show -n myregistry mychart --version 0.3.2
"""
helps['acr helm install-cli'] = """
type: command
short-summary: Download and install Helm command-line tool.
examples:
- name: Install the default version of Helm CLI to the default location
text: >
az acr helm install-cli
- name: Install a specified version of Helm CLI to the default location
text: >
az acr helm install-cli --client-version x.x.x
- name: Install the default version of Helm CLI to a specified location
text: >
az acr helm install-cli --install-location /folder/filename
- name: Install a specified version of Helm CLI to a specified location
text: >
az acr helm install-cli --client-version x.x.x --install-location /folder/filename
"""
helps['acr import'] = """
type: command
short-summary: Imports an image to an Azure Container Registry from another Container Registry. Import removes the need to docker pull, docker tag, docker push. For larger images consider using `--no-wait`.
examples:
- name: Import an image from 'sourceregistry' to 'myregistry'. The image inherits its source repository and tag names.
text: >
az acr import -n myregistry --source sourceregistry.azurecr.io/sourcerepository:sourcetag
- name: Import an image from a public repository on Docker Hub. The image uses the specified repository and tag names.
text: >
az acr import -n myregistry --source docker.io/library/hello-world:latest -t targetrepository:targettag
- name: Import an image from a private repository using its username and password. This also applies to registries outside Azure.
text: >
az acr import -n myregistry --source myprivateregistry.azurecr.io/hello-world:latest -u username -p password
- name: Import an image from an Azure container registry in a different subscription.
text: |
az acr import -n myregistry --source sourcerepository:sourcetag -t targetrepository:targettag \\
-r /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry
- name: Import an image without waiting for successful completion. Failures during import will not be reflected. Run `az acr repository show-tags` to confirm that import succeeded.
text: >
az acr import -n myregistry --source sourceregistry.azurecr.io/sourcerepository:sourcetag --no-wait
"""
helps['acr list'] = """
type: command
short-summary: Lists all the container registries under the current subscription.
examples:
- name: List container registries and show the results in a table, across multiple resource groups.
text: >
az acr list -o table
- name: List container registries in a resource group and show the results in a table.
text: >
az acr list -g MyResourceGroup -o table
"""
helps['acr login'] = """
type: command
short-summary: Log in to an Azure Container Registry through the Docker CLI.
long-summary: Docker must be installed on your machine. Once done, use 'docker logout <registry url>' to log out. (If you only need an access token and do not want to install Docker, specify '--expose-token')
examples:
- name: Log in to an Azure Container Registry
text: >
az acr login -n myregistry
- name: Get an Azure Container Registry access token
text: >
az acr login -n myregistry --expose-token
"""
helps['acr network-rule'] = """
type: group
short-summary: Manage network rules for Azure Container Registries.
"""
helps['acr network-rule add'] = """
type: command
short-summary: Add a network rule.
examples:
- name: Add a rule to allow access for a specific IP address-range.
text: >
az acr network-rule add -n myregistry --ip-address 23.45.1.0/24
"""
helps['acr network-rule list'] = """
type: command
short-summary: List network rules.
examples:
- name: List network rules for a registry.
text: >
az acr network-rule list -n myregistry
"""
helps['acr network-rule remove'] = """
type: command
short-summary: Remove a network rule.
examples:
- name: Remove a rule that allows access for a specific IP address-range.
text: >
az acr network-rule remove -n myregistry --ip-address 23.45.1.0/24
"""
helps['acr pack'] = """
type: group
short-summary: Manage Azure Container Registry Tasks that use Cloud Native Buildpacks.
"""
helps['acr pack build'] = """
type: command
short-summary: Queues a quick build task that builds an app and pushes it into an Azure Container Registry.
examples:
- name: Queue a build for the current directory with the CloudFoundry builder.
text: az acr pack build -r myregistry -t {{.Run.Registry}}/node-app:{{.Run.ID}} --builder cloudfoundry/cnb:bionic .
- name: Queue a build for the given GitHub repository with the Heroku builder.
text: az acr pack build -r myregistry -t {{.Run.Registry}}/node-app:{{.Run.ID}} --pull --builder heroku/buildpacks:18 https://github.com/Azure-Samples/nodejs-docs-hello-world.git
"""
helps['acr replication'] = """
type: group
short-summary: Manage geo-replicated regions of Azure Container Registries.
"""
helps['acr replication create'] = """
type: command
short-summary: Create a replicated region for an Azure Container Registry.
examples:
- name: Create a replicated region for an Azure Container Registry.
text: >
az acr replication create -r myregistry -l westus
- name: Create a replicated region for an Azure Container Registry. (autogenerated)
text: az acr replication create --location westus --registry myregistry --resource-group MyResourceGroup
crafted: true
"""
helps['acr replication delete'] = """
type: command
short-summary: Delete a replicated region from an Azure Container Registry.
examples:
- name: Delete a replicated region from an Azure Container Registry.
text: >
az acr replication delete -n MyReplication -r myregistry
"""
helps['acr replication list'] = """
type: command
short-summary: List all of the regions for a geo-replicated Azure Container Registry.
examples:
- name: List replications and show the results in a table.
text: >
az acr replication list -r myregistry -o table
"""
helps['acr replication show'] = """
type: command
short-summary: Get the details of a replicated region.
examples:
- name: Get the details of a replicated region
text: >
az acr replication show -n MyReplication -r myregistry
"""
helps['acr replication update'] = """
type: command
short-summary: Updates a replication.
examples:
- name: Update tags for a replication
text: >
az acr replication update -n MyReplication -r myregistry --tags key1=value1 key2=value2
- name: Updates a replication. (autogenerated)
text: az acr replication update --name MyReplication --registry myregistry --resource-group MyResourceGroup --tags key1=value1 key2=value2
crafted: true
"""
helps['acr repository'] = """
type: group
short-summary: Manage repositories (image names) for Azure Container Registries.
"""
helps['acr repository delete'] = """
type: command
short-summary: Delete a repository or image in an Azure Container Registry.
long-summary: This command deletes all associated layer data that are not referenced by any other manifest in the container registry.
examples:
- name: Delete an image manifest by tag. This deletes the manifest referenced by 'hello-world:latest' and all other tags referencing the same manifest.
text: az acr repository delete -n myregistry --image hello-world:latest
- name: Delete an image manifest by sha256-based manifest digest. This deletes the manifest identified by 'hello-world@sha256:abc123' and all tags referencing the manifest.
text: az acr repository delete -n myregistry --image hello-world@sha256:abc123
- name: Delete a repository from an Azure Container Registry. This deletes all manifests and tags under 'hello-world'.
text: az acr repository delete -n myregistry --repository hello-world
"""
helps['acr repository list'] = """
type: command
short-summary: List repositories in an Azure Container Registry.
examples:
- name: List repositories in a given Azure Container Registry.
text: az acr repository list -n myregistry
"""
helps['acr repository list-deleted'] = """
type: command
short-summary: List soft-deleted repositories in an Azure Container Registry.
examples:
- name: List soft-deleted repositories in a given Azure Container Registry.
text: az acr repository list-deleted -n myregistry
"""
helps['acr repository show'] = """
type: command
short-summary: Get the attributes of a repository or image in an Azure Container Registry.
examples:
- name: Get the attributes of the repository 'hello-world'.
text: az acr repository show -n myregistry --repository hello-world
- name: Get the attributes of the image referenced by tag 'hello-world:latest'.
text: az acr repository show -n myregistry --image hello-world:latest
- name: Get the attributes of the image referenced by digest 'hello-world@sha256:abc123'.
text: az acr repository show -n myregistry --image hello-world@sha256:abc123
"""
helps['acr repository show-manifests'] = """
type: command
short-summary: Show manifests of a repository in an Azure Container Registry.
examples:
- name: Show manifests of a repository in an Azure Container Registry.
text: az acr repository show-manifests -n myregistry --repository MyRepository
- name: Show the latest 10 manifests ordered by timestamp of a repository in an Azure Container Registry.
text: az acr repository show-manifests -n myregistry --repository MyRepository --top 10 --orderby time_desc
- name: Show the detailed information of the latest 10 manifests ordered by timestamp of a repository in an Azure Container Registry.
text: az acr repository show-manifests -n myregistry --repository MyRepository --top 10 --orderby time_desc --detail
"""
helps['acr repository show-tags'] = """
type: command
short-summary: Show tags for a repository in an Azure Container Registry.
examples:
- name: Show tags of a repository in an Azure Container Registry.
text: az acr repository show-tags -n myregistry --repository MyRepository
- name: Show the detailed information of tags of a repository in an Azure Container Registry.
text: az acr repository show-tags -n myregistry --repository MyRepository --detail
- name: Show the detailed information of the latest 10 tags ordered by timestamp of a repository in an Azure Container Registry.
text: az acr repository show-tags -n myregistry --repository MyRepository --top 10 --orderby time_desc --detail
"""
helps['acr repository untag'] = """
type: command
short-summary: Untag an image in an Azure Container Registry.
long-summary: This command does not delete the manifest referenced by the tag or any associated layer data.
examples:
- name: Untag an image from a repository.
text: az acr repository untag -n myregistry --image hello-world:latest
"""
helps['acr repository update'] = """
type: command
short-summary: Update the attributes of a repository or image in an Azure Container Registry.
examples:
- name: Update the attributes of the repository 'hello-world' to disable write operation.
text: az acr repository update -n myregistry --repository hello-world --write-enabled false
- name: Update the attributes of the image referenced by tag 'hello-world:latest' to disable write operation.
text: az acr repository update -n myregistry --image hello-world:latest --write-enabled false
- name: Update the attributes of the image referenced by digest 'hello-world@sha256:abc123' to disable write operation.
text: az acr repository update -n myregistry --image hello-world@sha256:abc123 --write-enabled false
"""
helps['acr cache'] = """
type: group
short-summary: Manage cache rules in Azure Container Registries.
"""
helps['acr cache show'] = """
type: command
short-summary: Show a cache rule.
examples:
- name: Show a cache rule.
text: az acr cache show -r myregistry -n MyRule
"""
helps['acr cache list'] = """
type: command
short-summary: List the cache rules in an Azure Container Registry.
examples:
- name: List the cache rules in an Azure Container Registry.
text: az acr cache list -r myregistry
"""
helps['acr cache create'] = """
type: command
short-summary: Create a cache rule.
examples:
- name: Create a cache rule without a credential set.
text: az acr cache create -r myregistry -n MyRule -s docker.io/library/ubuntu -t ubuntu
- name: Create a cache rule with a credential set.
text: az acr cache create -r myregistry -n MyRule -s docker.io/library/ubuntu -t ubuntu -c MyCredSet
"""
helps['acr cache update'] = """
type: command
short-summary: Update the credential set on a cache rule.
examples:
- name: Change or add a credential set to an existing cache rule.
text: az acr cache update -r myregistry -n MyRule -c NewCredSet
- name: Remove a credential set from an existing cache rule.
text: az acr cache update -r myregistry -n MyRule --remove-cred-set
"""
helps['acr cache delete'] = """
type: command
short-summary: Delete a cache rule.
examples:
- name: Delete a cache rule.
text: az acr cache delete -r myregistry -n MyRule
"""
helps['acr credential-set'] = """
type: group
short-summary: Manage credential sets in Azure Container Registries.
"""
helps['acr credential-set show'] = """
type: command
short-summary: Show a credential set.
examples:
- name: Show a credential set rule.
text: az acr credential-set show -r myregistry -n MyCredSet
"""
helps['acr credential-set list'] = """
type: command
short-summary: List the credential sets in an Azure Container Registry.
examples:
- name: List the credential sets in an Azure Container Registry.
text: az acr credential-set list -r myregistry
"""
helps['acr credential-set create'] = """
type: command
short-summary: Create a credential set.
examples:
- name: Create a credential set.
text: az acr credential-set create -r myregistry -n MyRule -l docker.io -u https://MyKeyvault.vault.azure.net/secrets/usernamesecret -p https://MyKeyvault.vault.azure.net/secrets/passwordsecret
"""
helps['acr credential-set update'] = """
type: command
short-summary: Update the username or password Azure Key Vault secret ID on a credential set.
examples:
- name: Update the password Azure Key Vault secret ID.
text: az acr credential-set update -r myregistry -n MyRule -p https://MyKeyvault.vault.azure.net/secrets/newsecretname
"""
helps['acr credential-set delete'] = """
type: command
short-summary: Delete a credential set.
examples:
- name: Delete a credential set.
text: az acr credential-set delete -r myregistry -n MyCredSet
"""
helps['acr manifest'] = """
type: group
short-summary: Manage artifact manifests in Azure Container Registries.
"""
helps['acr manifest show'] = """
type: command
short-summary: Get a manifest in an Azure Container Registry.
examples:
- name: Get the manifest of the artifact 'hello-world:latest'.
text: az acr manifest show -r myregistry -n hello-world:latest
- name: Get the manifest of the artifact 'hello-world:latest'.
text: az acr manifest show myregistry.azurecr.io/hello-world:latest
- name: Get the manifest of the artifact referenced by digest 'hello-world@sha256:abc123'.
text: az acr manifest show -r myregistry -n hello-world@sha256:abc123
- name: Get the raw, unformatted manifest of the artifact 'hello-world:latest'.
text: az acr manifest show -r myregistry -n hello-world:latest --raw
"""
helps['acr manifest list'] = """
type: command
short-summary: List the manifests in a repository in an Azure Container Registry.
examples:
- name: List the manifests of the repository 'hello-world'.
text: az acr manifest list -r myregistry -n hello-world
- name: List the manifests of the repository 'hello-world'.
text: az acr manifest list myregistry.azurecr.io/hello-world
"""
helps['acr manifest delete'] = """
type: command
short-summary: Delete a manifest in an Azure Container Registry.
examples:
- name: Delete the manifest of the artifact 'hello-world:latest'.
text: az acr manifest delete -r myregistry -n hello-world:latest
- name: Delete the manifest of the artifact 'hello-world:latest'.
text: az acr manifest delete myregistry.azurecr.io/hello-world:latest
- name: Delete the manifest of the artifact referenced by digest 'hello-world@sha256:abc123'.
text: az acr manifest delete -r myregistry -n hello-world@sha256:abc123
"""
helps['acr manifest list-referrers'] = """
type: command
short-summary: List the referrers to a manifest in an Azure Container Registry.
examples:
- name: List the referrers to the manifest of the artifact 'hello-world:latest'.
text: az acr manifest list-referrers -r myregistry -n hello-world:latest
- name: List the referrers to the manifest of the artifact 'hello-world:latest'.
text: az acr manifest list-referrers myregistry.azurecr.io/hello-world:latest
- name: List the referrers to the manifest of the artifact referenced by digest 'hello-world@sha256:abc123'.
text: az acr manifest list-referrers -r myregistry -n hello-world@sha256:abc123
"""
helps['acr manifest show-metadata'] = """
type: command
short-summary: Get the metadata of an artifact in an Azure Container Registry.
examples:
- name: Get the metadata of the tag 'hello-world:latest'.
text: az acr manifest show-metadata -r myregistry -n hello-world:latest
- name: Get the metadata of the tag 'hello-world:latest'.
text: az acr manifest show-metadata myregistry.azurecr.io/hello-world:latest
- name: Get the metadata of the manifest referenced by digest 'hello-world@sha256:abc123'.
text: az acr manifest show-metadata -r myregistry -n hello-world@sha256:abc123
"""
helps['acr manifest list-metadata'] = """
type: command
short-summary: List the metadata of the manifests in a repository in an Azure Container Registry.
examples:
- name: List the metadata of the manifests in the repository 'hello-world'.
text: az acr manifest list-metadata -r myregistry -n hello-world
- name: List the metadata of the manifests in the repository 'hello-world'.
text: az acr manifest list-metadata myregistry.azurecr.io/hello-world
"""
helps['acr manifest update-metadata'] = """
type: command
short-summary: Update the manifest metadata of an artifact in an Azure Container Registry.
examples:
- name: Update the metadata of the tag 'hello-world:latest'.
text: az acr manifest update-metadata -r myregistry -n hello-world:latest --write-enabled false
- name: Update the metadata of the tag 'hello-world:latest'.
text: az acr manifest update-metadata myregistry.azurecr.io/hello-world:latest --write-enabled false
- name: Update the metadata of the artifact referenced by digest 'hello-world@sha256:abc123'.
text: az acr manifest update-metadata -r myregistry -n hello-world@sha256:abc123 --write-enabled false
"""
# Deprecated
helps['acr manifest metadata'] = """
type: group
short-summary: Manage artifact manifest metadata in Azure Container Registries.
"""
helps['acr manifest metadata show'] = """
type: command
short-summary: Get the metadata of an artifact in an Azure Container Registry.
"""
helps['acr manifest metadata list'] = """
type: command
short-summary: List the metadata of the manifests in a repository in an Azure Container Registry.
"""
helps['acr manifest metadata update'] = """
type: command
short-summary: Update the manifest metadata of an artifact in an Azure Container Registry.
"""
helps['acr manifest list-deleted'] = """
type: command
short-summary: List the soft-deleted manifests in a repository in an Azure Container Registry.
examples:
- name: List the soft-deleted manifests in the repository 'hello-world'.
text: az acr manifest list-deleted -r myregistry -n hello-world
- name: List the soft-deleted manifests in the repository 'hello-world'.
text: az acr manifest list-deleted myregistry.azurecr.io/hello-world
"""
helps['acr manifest list-deleted-tags'] = """
type: command
short-summary: List the soft-deleted tags in a repository in an Azure Container Registry.
examples:
- name: List the soft-deleted tags in the repository 'hello-world'.
text: az acr manifest list-deleted-tags -r myregistry -n hello-world
- name: List the soft-deleted tags in the repository 'hello-world'.
text: az acr manifest list-deleted-tags myregistry.azurecr.io/hello-world
- name: List the soft-deleted tags that match tag 'latest' in the repository 'hello-world'.
text: az acr manifest list-deleted-tags -r myregistry -n hello-world:latest
- name: List the soft-deleted tags that match tag 'latest' in the repository 'hello-world'.
text: az acr manifest list-deleted-tags myregistry.azurecr.io/hello-world:latest
"""
helps['acr manifest restore'] = """
type: command
short-summary: Restore a soft-deleted artifact and tag in an Azure Container Registry.
examples:
- name: Restore the manifest matching digest 'sha256:abc123' with tag 'latest' in the repository 'hello-world'.
text: az acr manifest restore -r myregistry -n hello-world:latest -d sha256:abc123
- name: Restore the manifest matching digest 'sha256:abc123' with tag 'latest' in the repository 'hello-world'.
text: az acr manifest restore myregistry.azurecr.io/hello-world:latest -d sha256:abc123
- name: Restore the most recently deleted manifest associated with the tag 'latest' in the repository 'hello-world'.
text: az acr manifest restore -r myregistry -n hello-world:latest
- name: Restore the most recently deleted manifest associated with the tag 'latest' in the repository 'hello-world'.
text: az acr manifest restore myregistry.azurecr.io/hello-world:latest
"""
helps['acr run'] = """
type: command
short-summary: Queues a quick run providing streamed logs for an Azure Container Registry.
examples:
- name: Queue a run to execute a container command.
text: >
az acr run -r myregistry --cmd '$Registry/myimage' /dev/null
- name: Queue a run with the task definition from the standard input. Either 'Ctrl + Z'(Windows) or 'Ctrl + D'(Linux) terminates the input stream.
text: >
az acr run -r myregistry -f - /dev/null
- name: Queue a run to execute the tasks passed through the pipe.
text: >
cat task.yaml | az acr run -r myregistry -f - /dev/null
- name: Queue a local context, pushed to ACR with streaming logs.
text: >
az acr run -r myregistry -f bash-echo.yaml ./workspace
- name: Queue a remote git context with streaming logs.
text: >
az acr run -r myregistry https://github.com/Azure-Samples/acr-tasks.git -f hello-world.yaml
- name: Queue a remote git context with streaming logs and runs the task on Linux platform.
text: >
az acr run -r myregistry https://github.com/Azure-Samples/acr-tasks.git -f build-hello-world.yaml --platform linux
- name: Queue a remote OCI Artifact context and runs the task.
text: >
az acr run -r myregistry oci://myregistry.azurecr.io/myartifact:mytag -f hello-world.yaml
"""
helps['acr scope-map'] = """
type: group
short-summary: Manage scope access maps for Azure Container Registries.
"""
helps['acr scope-map create'] = """
type: command
short-summary: Create a scope map for an Azure Container Registry.
examples:
- name: Create a scope map that allows content/write and metadata/read actions for `hello-world` repository, and content/read action for `hello-world-again`.
text: >
az acr scope-map create -n MyScopeMap -r myregistry --repository hello-world content/write metadata/read --repository hello-world-again content/read --description "Sample scope map."
- name: Create a scope map that allows all repository actions for `test`, and all gateway actions for `connectedRegistry`.
text: >
az acr scope-map create -n MyScopeMap -r myregistry --description "Sample scope map."
--repository test content/delete content/read content/write metadata/read metadata/write
--gateway connectedRegistry config/read config/write message/read message/write
"""
helps['acr scope-map delete'] = """
type: command
short-summary: Delete a scope map for an Azure Container Registry.
examples:
- name: Delete the scope map 'MyScopeMap'.
text: >
az acr scope-map delete -n MyScopeMap -r myregistry
"""
helps['acr scope-map list'] = """
type: command
short-summary: List all scope maps for an Azure Container Registry.
examples:
- name: List scope maps under the registry 'myregistry'.
text: >
az acr scope-map list -r myregistry
"""
helps['acr scope-map show'] = """
type: command
short-summary: Show details and attributes of a scope map for an Azure Container Registry.
examples:
- name: Get information for the scope map 'MyScopeMap'.
text: >
az acr scope-map show -n MyScopeMap -r myregistry
"""
helps['acr scope-map update'] = """
type: command
short-summary: Update a scope map for an Azure Container Registry.
examples:
- name: Update the scope map 'MyScopeMap' removing metadata/read and content/read actions for `hello-world` repository, and message/write action for `connectedRegistry`.
text: >
az acr scope-map update -n MyScopeMap -r myregistry --remove-repo hello-world metadata/read content/read --remove-gateway connectedRegistry message/write
"""
helps['acr show'] = """
type: command
short-summary: Get the details of an Azure Container Registry.
examples:
- name: Get the login server for an Azure Container Registry.
text: >
az acr show -n myregistry --query loginServer
- name: Get the details of an Azure Container Registry
text: az acr show --name myregistry --resource-group MyResourceGroup
crafted: true
"""
helps['acr show-usage'] = """
type: command
short-summary: Get the storage usage for an Azure Container Registry.
examples:
- name: Get the storage usage for an Azure Container Registry.
text: >
az acr show-usage -n myregistry
"""
helps['acr task'] = """
type: group
short-summary: Manage a collection of steps for building, testing and OS & Framework patching container images using Azure Container Registries.
"""
helps['acr task cancel-run'] = """
type: command
short-summary: Cancel a specified run of an Azure Container Registry.
examples:
- name: Cancel a run
text: >
az acr task cancel-run -r myregistry --run-id runId
"""
helps['acr task create'] = """
type: command
short-summary: Create a series of steps for building, testing and OS & Framework patching containers. Tasks support triggers from git commits and base image updates.
examples:
- name: Create a task without the source location.
text: >
az acr task create -n hello-world -r myregistry --cmd '$Registry/myimage' -c /dev/null
- name: Create a task with the definition from the standard input and with a timer trigger that runs the task at the top of every hour using the default trigger name. Either 'Ctrl + Z'(Windows) or 'Ctrl + D'(Linux) terminates the input stream.
text: |
cat task.yaml | az acr task create -n hello-world -r myregistry -f - -c /dev/null \\
--schedule "0 */1 * * *"
az acr task create -n hello-world -r myregistry -f - -c /dev/null --schedule "0 */1 * * *"
- name: Create a Linux task from a public GitHub repository which builds the hello-world image without triggers and uses a build argument.
text: |
az acr task create -t hello-world:{{.Run.ID}} -n hello-world -r myregistry \\
-c https://github.com/Azure/acr-builder.git -f Dockerfile \\
--commit-trigger-enabled false --base-image-trigger-enabled false \\
--arg DOCKER_CLI_BASE_IMAGE=docker:18.03.0-ce-git
- name: Create a Linux task using a specific branch of a private Azure DevOps repository which builds the hello-world image on Arm architecture (V7 variant) and has triggers enabled.
text: |
az acr task create -t hello-world:{{.Run.ID}} -n hello-world -r myregistry \\
-c https://msazure.visualstudio.com/DefaultCollection/Project/_git/Repo#Branch:Folder \\
-f Dockerfile --git-access-token <Personal Access Token> --platform linux/arm/v7
- name: Create a Linux task from a public GitHub repository which builds the hello-world image with both a git commit and pull request trigger enabled. Note that this task does not use Source Registry (myregistry), so we can explicitly set Auth mode as None for it.
text: |
az acr task create -t hello-world:{{.Run.ID}} -n hello-world -r myregistry -f Dockerfile \\
--no-push true --auth-mode None -c https://github.com/Azure-Samples/acr-build-helloworld-node.git \\
--pull-request-trigger-enabled true --git-access-token 000000000000000000000000000000000
- name: Create a Windows task from a public GitHub repository which builds the Azure Container Builder image on Amd64 architecture with only base image trigger enabled.
text: |
az acr task create -t acb:{{.Run.ID}} -n acb-win -r myregistry \\
-c https://github.com/Azure/acr-builder.git -f Windows.Dockerfile \\
--commit-trigger-enabled false --platform Windows/amd64
- name: Create a Linux multi-step task from a public GitHub repository with with both system-assigned and user-assigned managed identities and base image, git commit, pull request, and timer triggers that run the task at noon on Mondays through Fridays with the timer trigger name provided.
text: |
az acr task create -t hello-world:{{.Run.ID}} -n hello-world -r myregistry \\
--pull-request-trigger-enabled true --schedule "dailyTimer:0 12 * * Mon-Fri" \\
-c https://github.com/Azure-Samples/acr-tasks.git#:multipleRegistries -f testtask.yaml \\
--assign-identity [system] "/subscriptions/<subscriptionId>/resourcegroups/<myResourceGroup>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<myUserAssignedIdentitiy>"
"""
helps['acr task credential'] = """
type: group
short-summary: Manage credentials for a task. Please see https://aka.ms/acr/tasks/cross-registry-authentication for more information.
"""
helps['acr task credential add'] = """
type: command
short-summary: Add a custom registry login credential to the task
examples:
- name: Add a registry login credential to a task using a plain text username and password.
text: |
az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \\
-u myusername -p mysecret
- name: Add a registry login credential to a task using key vault secret URIs for the username and password and the task system-assigned identity.
text: |
az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \\
-u https://mykeyvault.vault.azure.net/secrets/secretusername -p https://mykeyvault.vault.azure.net/secrets/secretpassword \\
--use-identity [system]
- name: Add a registry login credential to a task using key vault secret URIs for the username and password and a task user-assigned identity given by its client id.
text: |
az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \\
-u https://mykeyvault.vault.azure.net/secrets/secretusername -p https://mykeyvault.vault.azure.net/secrets/secretpassword \\
--use-identity 00000000-0000-0000-0000-000000000000
- name: Add a registry login credential to a task using a plain text username and key vault secret URI for the password and the task user-assigned identity given by its client id.
text: |
az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \\
-u myusername -p https://mykeyvault.vault.azure.net/secrets/secretpassword \\
--use-identity 00000000-0000-0000-0000-000000000000
- name: Add a registry login credential to a task using a plain text username and key vault secret URI for the password and the default managed identity for the task if one exists.
text: |
az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \\
-u myusername -p https://mykeyvault.vault.azure.net/secrets/secretpassword
- name: Add a registry login credential to a task that uses only the task system-assigned identity to authenticate to the registry.
text: |
az acr task credential add -n taskname -r registryname --login-server myregistry.docker.io \\
--use-identity [system]
"""
helps['acr task credential list'] = """
type: command
short-summary: List all the custom registry credentials for task.
examples:
- name: List the Credentials for a task.
text: >
az acr task credential list -n taskname -r registryname
"""
helps['acr task credential remove'] = """
type: command
short-summary: Remove credential for a task.
examples:
- name: Remove a registry login credential from a task.
text: >
az acr task credential remove -n taskname -r registryname --login-server myregistry.docker.io
"""
helps['acr task credential update'] = """
type: command
short-summary: Update the registry login credential for a task.
examples:
- name: Update the credential for a task
text: |