/
_help.py
1552 lines (1395 loc) · 62.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
helps['containerapp'] = """
type: group
short-summary: Manage Azure Container Apps.
"""
helps['containerapp create'] = """
type: command
short-summary: Create a container app.
examples:
- name: Create a container app and retrieve its fully qualified domain name.
text: |
az containerapp create -n my-containerapp -g MyResourceGroup \\
--image myregistry.azurecr.io/my-app:v1.0 --environment MyContainerappEnv \\
--ingress external --target-port 80 \\
--registry-server myregistry.azurecr.io --registry-username myregistry --registry-password $REGISTRY_PASSWORD \\
--query properties.configuration.ingress.fqdn
- name: Create a container app with resource requirements and replica count limits.
text: |
az containerapp create -n my-containerapp -g MyResourceGroup \\
--image nginx --environment MyContainerappEnv \\
--cpu 0.5 --memory 1.0Gi \\
--min-replicas 4 --max-replicas 8
- name: Create a container app with secrets and environment variables.
text: |
az containerapp create -n my-containerapp -g MyResourceGroup \\
--image my-app:v1.0 --environment MyContainerappEnv \\
--secrets mysecret=secretvalue1 anothersecret="secret value 2" \\
--env-vars GREETING="Hello, world" SECRETENV=secretref:anothersecret
- name: Create a container app using a YAML configuration. Example YAML configuration - https://aka.ms/azure-container-apps-yaml
text: |
az containerapp create -n my-containerapp -g MyResourceGroup \\
--environment MyContainerappEnv \\
--yaml "path/to/yaml/file.yml"
- name: Create a container app with an http scale rule
text: |
az containerapp create -n myapp -g mygroup --environment myenv --image nginx \\
--scale-rule-name my-http-rule \\
--scale-rule-http-concurrency 50
- name: Create a container app with a custom scale rule
text: |
az containerapp create -n my-containerapp -g MyResourceGroup \\
--image my-queue-processor --environment MyContainerappEnv \\
--min-replicas 4 --max-replicas 8 \\
--scale-rule-name queue-based-autoscaling \\
--scale-rule-type azure-queue \\
--scale-rule-metadata "accountName=mystorageaccountname" \\
"cloud=AzurePublicCloud" \\
"queueLength": "5" "queueName": "foo" \\
--scale-rule-auth "connection=my-connection-string-secret-name"
- name: Create a container app with secrets and mounts them in a volume.
text: |
az containerapp create -n my-containerapp -g MyResourceGroup \\
--image my-app:v1.0 --environment MyContainerappEnv \\
--secrets mysecret=secretvalue1 anothersecret="secret value 2" \\
--secret-volume-mount "mnt/secrets"
"""
helps['containerapp update'] = """
type: command
short-summary: Update a container app. In multiple revisions mode, create a new revision based on the latest revision.
examples:
- name: Update a container app's container image.
text: |
az containerapp update -n my-containerapp -g MyResourceGroup \\
--image myregistry.azurecr.io/my-app:v2.0
- name: Update a container app's resource requirements and scale limits.
text: |
az containerapp update -n my-containerapp -g MyResourceGroup \\
--cpu 0.5 --memory 1.0Gi \\
--min-replicas 4 --max-replicas 8
- name: Update a container app with an http scale rule
text: |
az containerapp update -n myapp -g mygroup \\
--scale-rule-name my-http-rule \\
--scale-rule-http-concurrency 50
- name: Update a container app with a custom scale rule
text: |
az containerapp update -n myapp -g mygroup \\
--scale-rule-name my-custom-rule \\
--scale-rule-type my-custom-type \\
--scale-rule-metadata key=value key2=value2 \\
--scale-rule-auth triggerparam=secretref triggerparam=secretref
"""
helps['containerapp delete'] = """
type: command
short-summary: Delete a container app.
examples:
- name: Delete a container app.
text: az containerapp delete -g MyResourceGroup -n MyContainerapp
"""
helps['containerapp show'] = """
type: command
short-summary: Show details of a container app.
examples:
- name: Show the details of a container app.
text: |
az containerapp show -n my-containerapp -g MyResourceGroup
"""
helps['containerapp list'] = """
type: command
short-summary: List container apps.
examples:
- name: List container apps in the current subscription.
text: |
az containerapp list
- name: List container apps by resource group.
text: |
az containerapp list -g MyResourceGroup
"""
helps['containerapp exec'] = """
type: command
short-summary: Open an SSH-like interactive shell within a container app replica
examples:
- name: exec into a container app
text: |
az containerapp exec -n my-containerapp -g MyResourceGroup
- name: exec into a particular container app replica and revision
text: |
az containerapp exec -n my-containerapp -g MyResourceGroup --replica MyReplica --revision MyRevision
- name: open a bash shell in a containerapp
text: |
az containerapp exec -n my-containerapp -g MyResourceGroup --command bash
"""
helps['containerapp browse'] = """
type: command
short-summary: Open a containerapp in the browser, if possible
examples:
- name: open a containerapp in the browser
text: |
az containerapp browse -n my-containerapp -g MyResourceGroup
"""
helps['containerapp up'] = """
type: command
short-summary: Create or update a container app as well as any associated resources (ACR, resource group, container apps environment, GitHub Actions, etc.)
examples:
- name: Create a container app from a dockerfile in a GitHub repo (setting up github actions)
text: |
az containerapp up -n my-containerapp --repo https://github.com/myAccount/myRepo
- name: Create a container app from a dockerfile in a local directory (or autogenerate a container if no dockerfile is found)
text: |
az containerapp up -n my-containerapp --source .
- name: Create a container app from an image in a registry
text: |
az containerapp up -n my-containerapp --image myregistry.azurecr.io/myImage:myTag
- name: Create a container app from an image in a registry with ingress enabled and a specified environment
text: |
az containerapp up -n my-containerapp --image myregistry.azurecr.io/myImage:myTag --ingress external --target-port 80 --environment MyEnv
"""
helps['containerapp env logs'] = """
type: group
short-summary: Show container app environment logs
"""
helps['containerapp env logs show'] = """
type: command
short-summary: Show past environment logs and/or print logs in real time (with the --follow parameter)
examples:
- name: Fetch the past 20 lines of logs from an app and return
text: |
az containerapp env logs show -n MyEnvironment -g MyResourceGroup
- name: Fetch 30 lines of past logs logs from an environment and print logs as they come in
text: |
az containerapp env logs show -n MyEnvironment -g MyResourceGroup --follow --tail 30
"""
helps['containerapp logs'] = """
type: group
short-summary: Show container app logs
"""
helps['containerapp logs show'] = """
type: command
short-summary: Show past logs and/or print logs in real time (with the --follow parameter). Note that the logs are only taken from one revision, replica, and container (for non-system logs).
examples:
- name: Fetch the past 20 lines of logs from an app and return
text: |
az containerapp logs show -n my-containerapp -g MyResourceGroup
- name: Fetch the past 20 lines of system logs from an app and return
text: |
az containerapp logs show -n my-containerapp -g MyResourceGroup --type system
- name: Fetch 30 lines of past logs logs from an app and print logs as they come in
text: |
az containerapp logs show -n my-containerapp -g MyResourceGroup --follow --tail 30
- name: Fetch logs for a particular revision, replica, and container
text: |
az containerapp logs show -n my-containerapp -g MyResourceGroup --replica MyReplica --revision MyRevision --container MyContainer
"""
# Replica Commands
helps['containerapp replica'] = """
type: group
short-summary: Manage container app replicas
"""
helps['containerapp replica list'] = """
type: command
short-summary: List a container app revision's replica
examples:
- name: List a container app's replicas in the latest revision
text: |
az containerapp replica list -n my-containerapp -g MyResourceGroup
- name: List a container app's replicas in a particular revision
text: |
az containerapp replica list -n my-containerapp -g MyResourceGroup --revision MyRevision
"""
helps['containerapp replica show'] = """
type: command
short-summary: Show a container app replica
examples:
- name: Show a replica from the latest revision
text: |
az containerapp replica show -n my-containerapp -g MyResourceGroup --replica MyReplica
- name: Show a replica from the a particular revision
text: |
az containerapp replica show -n my-containerapp -g MyResourceGroup --replica MyReplica --revision MyRevision
"""
# Revision Commands
helps['containerapp revision'] = """
type: group
short-summary: Commands to manage revisions.
"""
helps['containerapp revision show'] = """
type: command
short-summary: Show details of a revision.
examples:
- name: Show details of a revision.
text: |
az containerapp revision show -n my-containerapp -g MyResourceGroup \\
--revision MyContainerappRevision
"""
helps['containerapp revision list'] = """
type: command
short-summary: List a container app's revisions.
examples:
- name: List a container app's revisions.
text: |
az containerapp revision list -n my-containerapp -g MyResourceGroup
"""
helps['containerapp revision restart'] = """
type: command
short-summary: Restart a revision.
examples:
- name: Restart a revision.
text: |
az containerapp revision restart -n my-containerapp -g MyResourceGroup --revision MyContainerappRevision
"""
helps['containerapp revision activate'] = """
type: command
short-summary: Activate a revision.
examples:
- name: Activate a revision.
text: |
az containerapp revision activate -g MyResourceGroup --revision MyContainerappRevision
"""
helps['containerapp revision deactivate'] = """
type: command
short-summary: Deactivate a revision.
examples:
- name: Deactivate a revision.
text: |
az containerapp revision deactivate -g MyResourceGroup --revision MyContainerappRevision
"""
helps['containerapp revision set-mode'] = """
type: command
short-summary: Set the revision mode of a container app.
examples:
- name: Set a container app to single revision mode.
text: |
az containerapp revision set-mode -n my-containerapp -g MyResourceGroup --mode Single
"""
helps['containerapp revision copy'] = """
type: command
short-summary: Create a revision based on a previous revision.
examples:
- name: Create a revision based on the latest revision.
text: |
az containerapp revision copy -n my-containerapp -g MyResourceGroup \\
--cpu 0.75 --memory 1.5Gi
- name: Create a revision based on a previous revision.
text: |
az containerapp revision copy -g MyResourceGroup \\
--from-revision PreviousRevisionName --cpu 0.75 --memory 1.5Gi
"""
helps['containerapp revision copy'] = """
type: command
short-summary: Create a revision based on a previous revision.
examples:
- name: Create a revision based on a previous revision.
text: |
az containerapp revision copy -n my-containerapp -g MyResourceGroup --cpu 0.75 --memory 1.5Gi
"""
helps['containerapp revision label'] = """
type: group
short-summary: Manage revision labels assigned to traffic weights.
"""
helps['containerapp revision label add'] = """
type: command
short-summary: Set a revision label to a revision with an associated traffic weight.
examples:
- name: Add a label to the latest revision.
text: |
az containerapp revision label add -n my-containerapp -g MyResourceGroup --label myLabel --revision latest
- name: Add a label to a previous revision.
text: |
az containerapp revision label add -g MyResourceGroup --label myLabel --revision revisionName
"""
helps['containerapp revision label remove'] = """
type: command
short-summary: Remove a revision label from a revision with an associated traffic weight.
examples:
- name: Remove a label.
text: |
az containerapp revision label remove -n my-containerapp -g MyResourceGroup --label myLabel
"""
helps['containerapp revision label swap'] = """
type: command
short-summary: Swap a revision label between two revisions with associated traffic weights.
examples:
- name: Swap a revision label between two revisions.
text: |
az containerapp revision label swap -n my-containerapp -g MyResourceGroup --source myLabel1 --target myLabel2
"""
# Environment Commands
helps['containerapp env'] = """
type: group
short-summary: Commands to manage Container Apps environments.
"""
helps['containerapp env create'] = """
type: command
short-summary: Create a Container Apps environment.
examples:
- name: Create an environment with an auto-generated Log Analytics workspace.
text: |
az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \\
--location eastus2
- name: Create a zone-redundant environment
text: |
az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \\
--location eastus2 --zone-redundant
- name: Create an environment with an existing Log Analytics workspace.
text: |
az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \\
--logs-workspace-id myLogsWorkspaceID \\
--logs-workspace-key myLogsWorkspaceKey \\
--location eastus2
- name: Create an environment with workload profiles enabled.
text: |
az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \\
--location eastus2 --enable-workload-profiles
- name: Create an environment without workload profiles enabled.
text: |
az containerapp env create -n MyContainerappEnvironment -g MyResourceGroup \\
--location eastus2 --enable-workload-profiles false
"""
helps['containerapp env update'] = """
type: command
short-summary: Update a Container Apps environment.
examples:
- name: Update an environment's custom domain configuration.
text: |
az containerapp env update -n MyContainerappEnvironment -g MyResourceGroup \\
--dns-suffix my-suffix.net --certificate-file MyFilePath \\
--certificate-password MyCertPass
"""
helps['containerapp env delete'] = """
type: command
short-summary: Delete a Container Apps environment.
examples:
- name: Delete an environment.
text: az containerapp env delete -n MyContainerappEnvironment -g MyResourceGroup
"""
helps['containerapp env show'] = """
type: command
short-summary: Show details of a Container Apps environment.
examples:
- name: Show the details of an environment.
text: |
az containerapp env show -n MyContainerappEnvironment -g MyResourceGroup
"""
helps['containerapp env list'] = """
type: command
short-summary: List Container Apps environments by subscription or resource group.
examples:
- name: List environments in the current subscription.
text: |
az containerapp env list
- name: List environments by resource group.
text: |
az containerapp env list -g MyResourceGroup
"""
helps['containerapp env dapr-component'] = """
type: group
short-summary: Commands to manage Dapr components for the Container Apps environment.
"""
helps['containerapp env dapr-component list'] = """
type: command
short-summary: List Dapr components for an environment.
examples:
- name: List Dapr components for an environment.
text: |
az containerapp env dapr-component list -g MyResourceGroup --name MyEnvironment
"""
helps['containerapp env dapr-component show'] = """
type: command
short-summary: Show the details of a Dapr component.
examples:
- name: Show the details of a Dapr component.
text: |
az containerapp env dapr-component show -g MyResourceGroup --dapr-component-name MyDaprComponentName --name MyEnvironment
"""
helps['containerapp env dapr-component set'] = """
type: command
short-summary: Create or update a Dapr component.
examples:
- name: Create a Dapr component.
text: |
az containerapp env dapr-component set -g MyResourceGroup --name MyEnv --yaml MyYAMLPath --dapr-component-name MyDaprComponentName
"""
helps['containerapp env dapr-component remove'] = """
type: command
short-summary: Remove a Dapr component from an environment.
examples:
- name: Remove a Dapr component from a Container Apps environment.
text: |
az containerapp env dapr-component remove -g MyResourceGroup --dapr-component-name MyDaprComponentName --name MyEnvironment
"""
helps['containerapp env storage'] = """
type: group
short-summary: Commands to manage storage for the Container Apps environment.
"""
helps['containerapp env storage list'] = """
type: command
short-summary: List the storages for an environment.
examples:
- name: List the storages for an environment.
text: |
az containerapp env storage list -g MyResourceGroup -n MyEnvironment
"""
helps['containerapp env storage show'] = """
type: command
short-summary: Show the details of a storage.
examples:
- name: Show the details of a storage.
text: |
az containerapp env storage show -g MyResourceGroup --storage-name MyStorageName -n MyEnvironment
"""
helps['containerapp env storage set'] = """
type: command
short-summary: Create or update a storage.
examples:
- name: Create a storage.
text: |
az containerapp env storage set -g MyResourceGroup -n MyEnv --storage-name MyStorageName --access-mode ReadOnly --azure-file-account-key MyAccountKey --azure-file-account-name MyAccountName --azure-file-share-name MyShareName
"""
helps['containerapp env storage remove'] = """
type: command
short-summary: Remove a storage from an environment.
examples:
- name: Remove a storage from a Container Apps environment.
text: |
az containerapp env storage remove -g MyResourceGroup --storage-name MyStorageName -n MyEnvironment
"""
helps['containerapp env workload-profile'] = """
type: group
short-summary: Manage the workload profiles of a Container Apps environment
"""
helps['containerapp env workload-profile delete'] = """
type: command
short-summary: Delete a workload profile from a Container Apps environment
examples:
- name: Delete a workload profile from a Container Apps environment
text: |
az containerapp env workload-profile delete -g MyResourceGroup -n MyEnvironment --workload-profile-name my-wlp
"""
helps['containerapp env workload-profile list'] = """
type: command
short-summary: List the workload profiles from a Container Apps environment
examples:
- name: List the workload profiles from a Container Apps environment
text: |
az containerapp env workload-profile list -g MyResourceGroup -n MyEnvironment
"""
helps['containerapp env workload-profile show'] = """
type: command
short-summary: Show a workload profile from a Container Apps environment
examples:
- name: Show a workload profile from a Container Apps environment
text: |
az containerapp env workload-profile show -g MyResourceGroup -n MyEnvironment --workload-profile-name my-wlp
"""
helps['containerapp env workload-profile list-supported'] = """
type: command
short-summary: List the supported workload profiles in a region
examples:
- name: List the supported workload profiles in a region
text: |
az containerapp env workload-profile list-supported -l region
"""
helps['containerapp env workload-profile add'] = """
type: command
short-summary: Create a workload profile in a Container Apps environment
examples:
- name: Create a workload profile in a Container Apps environment
text: |
az containerapp env workload-profile add -g MyResourceGroup -n MyEnvironment --workload-profile-name my-wlp --workload-profile-type D4 --min-nodes 1 --max-nodes 2
"""
helps['containerapp env workload-profile update'] = """
type: command
short-summary: Update an existing workload profile in a Container Apps environment
examples:
- name: Update an existing workload profile in a Container Apps environment
text: |
az containerapp env workload-profile update -g MyResourceGroup -n MyEnvironment --workload-profile-name my-wlp --min-nodes 1 --max-nodes 3
"""
# Container Apps Job Commands
helps['containerapp job'] = """
type: group
short-summary: Commands to manage Container Apps jobs.
"""
helps['containerapp job create'] = """
type: command
short-summary: Create a container apps job.
examples:
- name: Create a container apps job with Trigger Type as Manual.
text: |
az containerapp job create -n MyContainerappsjob -g MyResourceGroup \\
--trigger-type Manual \\
--replica-timeout 5 \\
--replica-retry-limit 2 \\
--replica-completion-count 1 \\
--parallelism 1 \\
--image imageName \\
--workload-profile-name my-wlp
- name: Create a container apps job with Trigger Type as Schedule.
text: |
az containerapp job create -n MyContainerappsjob -g MyResourceGroup \\
--trigger-type Schedule \\
--replica-timeout 5 \\
--replica-retry-limit 2 \\
--replica-completion-count 1 \\
--parallelism 1 \\
--cron-expression \"*/1 * * * *\" \\
--image imageName
- name: Create a container apps job with Trigger Type as Event.
text: |
az containerapp job create -n MyContainerappsjob -g MyResourceGroup \\
--trigger-type Event \\
--replica-timeout 5 \\
--replica-retry-limit 2 \\
--replica-completion-count 1 \\
--parallelism 1 \\
--polling-interval 30 \\
--min-executions 0 \\
--max-executions 1 \\
--scale-rule-name queueJob \\
--scale-rule-type azure-queue \\
--scale-rule-metadata "accountName=mystorageaccountname" \\
"cloud=AzurePublicCloud" \\
"queueLength": "5" "queueName": "foo" \\
--scale-rule-auth "connection=my-connection-string-secret-name" \\
--image imageName
"""
helps['containerapp job update'] = """
type: command
short-summary: Update a Container Apps Job.
examples:
- name: Update a job's replica timeout.
text: |
az containerapp job update -n my-containerapp-job -g MyResourceGroup \\
--replica-timeout 10
"""
helps['containerapp job delete'] = """
type: command
short-summary: Delete a Container Apps Job.
examples:
- name: Delete a job.
text: az containerapp job delete -n my-containerapp-job -g MyResourceGroup
"""
helps['containerapp job show'] = """
type: command
short-summary: Show details of a Container Apps Job.
examples:
- name: Show the details of a job.
text: |
az containerapp job show -n my-containerapp-job -g MyResourceGroup
"""
helps['containerapp job list'] = """
type: command
short-summary: List Container Apps Job by subscription or resource group.
examples:
- name: List jobs in the current subscription.
text: |
az containerapp job list
- name: List environments by resource group.
text: |
az containerapp job list -g MyResourceGroup
"""
helps['containerapp job start'] = """
type: command
short-summary: Start a Container Apps Job execution.
examples:
- name: Start a job execution.
text: az containerapp job start -n my-containerapp-job -g MyResourceGroup
- name: Start a job with different image and configurations.
text: az containerapp job start -n my-containerapp-job -g MyResourceGroup --image MyImageName --cpu 0.5 --memory 1.0Gi
"""
helps['containerapp job stop'] = """
type: command
short-summary: Stops a Container Apps Job execution.
examples:
- name: Stop a job execution.
text: az containerapp job stop -n my-containerapp-job -g MyResourceGroup
- name: Stop a job execution giving a specific job execution name.
text: az containerapp job stop -n my-containerapp-job -g MyResourceGroup --job-execution-name MyContainerAppJob-66v9xh0
- name: Stop multiple job executions giving a list of execution names.
text: az containerapp job stop -n my-containerapp-job -g MyResourceGroup --execution-name-list MyContainerAppJob-66v9xh0,MyContainerAppJob-66v9xh1
"""
# Container App Job Secret Commands
helps['containerapp job secret'] = """
type: group
short-summary: Commands to manage secrets.
"""
helps['containerapp job secret show'] = """
type: command
short-summary: Show details of a secret.
examples:
- name: Show the details of a secret.
text: |
az containerapp job secret show -n my-containerapp-job -g MyResourceGroup --secret-name MySecret
"""
helps['containerapp job secret list'] = """
type: command
short-summary: List the secrets of a container app job.
examples:
- name: List the secrets of a container app job.
text: |
az containerapp job secret list -n my-containerapp-job -g MyResourceGroup
"""
helps['containerapp job secret remove'] = """
type: command
short-summary: Remove secrets from a container app job.
examples:
- name: Remove secrets from a container app job.
text: |
az containerapp job secret remove -n my-containerapp-job -g MyResourceGroup --secret-names MySecret MySecret2
"""
helps['containerapp job secret set'] = """
type: command
short-summary: Create/update secrets.
examples:
- name: Add secrets to a container app job.
text: |
az containerapp job secret set -n my-containerapp-job -g MyResourceGroup --secrets MySecretName1=MySecretValue1 MySecretName2=keyvaultref:https://example.vault.azure.net/secrets/mysecret,identityref:/subscriptions/sub/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity
- name: Update a secret.
text: |
az containerapp job secret set -n my-containerapp-job -g MyResourceGroup --secrets MyExistingSecretName=MyNewSecretValue MyExistingSecretName2=keyvaultref:https://example.vault.azure.net/secrets/mysecret,identityref:/subscriptions/sub/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity
"""
# Container App Job execution commands
helps['containerapp job execution'] = """
type: group
short-summary: Commands to view executions of a Container App Job.
"""
helps['containerapp job execution list'] = """
type: command
short-summary: Get list of all executions of a Container App Job.
examples:
- name: List of all executions of a Container App Job.
text: az containerapp job execution list -n my-containerapp-job -g MyResourceGroup
"""
helps['containerapp job execution show'] = """
type: command
short-summary: Get execution of a Container App Job.
examples:
- name: Get execution of a Container App Job.
text: az containerapp job execution show -n my-containerapp-job -g MyResourceGroup --job-execution-name MyContainerAppJob-66v9xh0
"""
# Certificates Commands
helps['containerapp env certificate'] = """
type: group
short-summary: Commands to manage certificates for the Container Apps environment.
"""
helps['containerapp env certificate list'] = """
type: command
short-summary: List certificates for an environment.
examples:
- name: List certificates for an environment.
text: |
az containerapp env certificate list -g MyResourceGroup --name MyEnvironment
- name: Show a certificate by certificate id.
text: |
az containerapp env certificate list -g MyResourceGroup --name MyEnvironment --certificate MyCertificateId
- name: List certificates by certificate name.
text: |
az containerapp env certificate list -g MyResourceGroup --name MyEnvironment --certificate MyCertificateName
- name: List certificates by certificate thumbprint.
text: |
az containerapp env certificate list -g MyResourceGroup --name MyEnvironment --thumbprint MyCertificateThumbprint
"""
helps['containerapp env certificate upload'] = """
type: command
short-summary: Add or update a certificate.
examples:
- name: Add or update a certificate.
text: |
az containerapp env certificate upload -g MyResourceGroup --name MyEnvironment --certificate-file MyFilepath
- name: Add or update a certificate with a user-provided certificate name.
text: |
az containerapp env certificate upload -g MyResourceGroup --name MyEnvironment --certificate-file MyFilepath --certificate-name MyCertificateName
"""
helps['containerapp env certificate delete'] = """
type: command
short-summary: Delete a certificate from the Container Apps environment.
examples:
- name: Delete a certificate from the Container Apps environment by certificate name
text: |
az containerapp env certificate delete -g MyResourceGroup --name MyEnvironment --certificate MyCertificateName
- name: Delete a certificate from the Container Apps environment by certificate id
text: |
az containerapp env certificate delete -g MyResourceGroup --name MyEnvironment --certificate MyCertificateId
- name: Delete all certificates that have a matching thumbprint from the Container Apps environment
text: |
az containerapp env certificate delete -g MyResourceGroup --name MyEnvironment --thumbprint MyCertificateThumbprint
"""
# Identity Commands
helps['containerapp identity'] = """
type: group
short-summary: Commands to manage managed identities.
"""
helps['containerapp identity assign'] = """
type: command
short-summary: Assign managed identity to a container app.
long-summary: Managed identities can be user-assigned or system-assigned.
examples:
- name: Assign system identity.
text: |
az containerapp identity assign -n my-containerapp -g MyResourceGroup --system-assigned
- name: Assign user identity.
text: |
az containerapp identity assign -n my-containerapp -g MyResourceGroup --user-assigned myUserIdentityName
- name: Assign user identity (from a different resource group than the containerapp).
text: |
az containerapp identity assign -n my-containerapp -g MyResourceGroup --user-assigned myUserIdentityResourceId
- name: Assign system and user identity.
text: |
az containerapp identity assign -n my-containerapp -g MyResourceGroup --system-assigned --user-assigned myUserIdentityResourceId
"""
helps['containerapp identity remove'] = """
type: command
short-summary: Remove a managed identity from a container app.
examples:
- name: Remove system identity.
text: |
az containerapp identity remove -n my-containerapp -g MyResourceGroup --system-assigned
- name: Remove user identity.
text: |
az containerapp identity remove -n my-containerapp -g MyResourceGroup --user-assigned myUserIdentityName
- name: Remove system and user identity (from a different resource group than the containerapp).
text: |
az containerapp identity remove -n my-containerapp -g MyResourceGroup --system-assigned --user-assigned myUserIdentityResourceId
- name: Remove all user identities.
text: |
az containerapp identity remove -n my-containerapp -g MyResourceGroup --user-assigned
- name: Remove system identity and all user identities.
text: |
az containerapp identity remove -n my-containerapp -g MyResourceGroup --system-assigned --user-assigned
"""
helps['containerapp identity show'] = """
type: command
short-summary: Show managed identities of a container app.
examples:
- name: Show managed identities.
text: |
az containerapp identity show -n my-containerapp -g MyResourceGroup
"""
helps['containerapp job identity'] = """
type: group
short-summary: Commands to manage managed identities for container app job.
"""
helps['containerapp job identity assign'] = """
type: command
short-summary: Assign managed identity to a container app job.
long-summary: Managed identities can be user assigned or system assigned.
examples:
- name: Assign system identity.
text: |
az containerapp job identity assign -n my-containerapp-job -g MyResourceGroup --system-assigned
- name: Assign user identity.
text: |
az containerapp job identity assign -n my-containerapp-job -g MyResourceGroup --user-assigned myUserIdentityName
- name: Assign user identity (from a different resource group than the containerapp job).
text: |
az containerapp job identity assign -n my-containerapp-job -g MyResourceGroup --user-assigned myUserIdentityResourceId
- name: Assign system and user identity.
text: |
az containerapp job identity assign -n my-containerapp-job -g MyResourceGroup --system-assigned --user-assigned myUserIdentityResourceId
"""
helps['containerapp job identity remove'] = """
type: command
short-summary: Remove a managed identity from a container app job.
examples:
- name: Remove system identity.
text: |
az containerapp job identity remove -n my-containerapp-job -g MyResourceGroup --system-assigned
- name: Remove user identity.
text: |
az containerapp job identity remove -n my-containerapp-job -g MyResourceGroup --user-assigned myUserIdentityName
- name: Remove system and user identity (from a different resource group than the containerapp job).
text: |
az containerapp job identity remove -n my-containerapp-job -g MyResourceGroup --system-assigned --user-assigned myUserIdentityResourceId
- name: Remove all user identities.
text: |
az containerapp job identity remove -n my-containerapp-job -g MyResourceGroup --user-assigned
- name: Remove system identity and all user identities.
text: |
az containerapp job identity remove -n my-containerapp-job -g MyResourceGroup --system-assigned --user-assigned
"""
helps['containerapp job identity show'] = """
type: command
short-summary: Show managed identities of a container app job.
examples:
- name: Show managed identities.
text: |
az containerapp job identity show -n my-containerapp-job -g MyResourceGroup
"""
# Ingress Commands
helps['containerapp ingress'] = """
type: group
short-summary: Commands to manage ingress and traffic-splitting.
"""
helps['containerapp ingress traffic'] = """
type: subgroup
short-summary: Commands to manage traffic-splitting.
"""
helps['containerapp ingress show'] = """
type: command
short-summary: Show details of a container app's ingress.
examples:
- name: Show the details of a container app's ingress.
text: |
az containerapp ingress show -n my-containerapp -g MyResourceGroup
"""
helps['containerapp ingress enable'] = """
type: command
short-summary: Enable or update ingress for a container app.
examples:
- name: Enable or update ingress for a container app.
text: |
az containerapp ingress enable -n my-containerapp -g MyResourceGroup \\
--type external --allow-insecure --target-port 80 --transport auto
"""
helps['containerapp ingress disable'] = """
type: command
short-summary: Disable ingress for a container app.
examples:
- name: Disable ingress for a container app.
text: |
az containerapp ingress disable -n my-containerapp -g MyResourceGroup
"""
helps['containerapp ingress update'] = """
type: command
short-summary: Update ingress for a container app.
examples:
- name: Update ingress for a container app.
text: |
az containerapp ingress update -n my-containerapp -g MyResourceGroup \\
--target-port 8080
"""
helps['containerapp ingress traffic'] = """
type: group
short-summary: Commands to manage traffic-splitting.
"""
helps['containerapp ingress traffic set'] = """
type: command
short-summary: Configure traffic-splitting for a container app.
examples:
- name: Route 100% of a container app's traffic to its latest revision.
text: |
az containerapp ingress traffic set -n my-containerapp -g MyResourceGroup --revision-weight latest=100
- name: Split a container app's traffic between two revisions.
text: |
az containerapp ingress traffic set -n my-containerapp -g MyResourceGroup --revision-weight latest=80 MyRevisionName=20
- name: Split a container app's traffic between two labels.
text: |
az containerapp ingress traffic set -n my-containerapp -g MyResourceGroup --label-weight myLabel=80 myLabel2=20
- name: Split a container app's traffic between a label and a revision.
text: |
az containerapp ingress traffic set -n my-containerapp -g MyResourceGroup --revision-weight latest=80 --label-weight myLabel=20
"""
helps['containerapp ingress traffic show'] = """
type: command
short-summary: Show traffic-splitting configuration for a container app.
examples:
- name: Show a container app's ingress traffic configuration.
text: |
az containerapp ingress traffic show -n my-containerapp -g MyResourceGroup
"""
helps['containerapp ingress access-restriction'] = """
type: group
short-summary: Commands to manage IP access restrictions.
"""
helps['containerapp ingress access-restriction set'] = """
type: command
short-summary: Configure IP access restrictions for a container app.
examples:
- name: Add an allow IP access restriction.
text: |