-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Expand file tree
/
Copy path_help.py
More file actions
1114 lines (1018 loc) · 42.2 KB
/
_help.py
File metadata and controls
1114 lines (1018 loc) · 42.2 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['cdn'] = """
type: group
short-summary: Manage Azure Content Delivery Networks (CDNs).
"""
helps['cdn custom-domain'] = """
type: group
short-summary: Manage Azure CDN Custom Domains to provide custom host names for endpoints.
"""
helps['cdn custom-domain create'] = """
type: command
short-summary: Create a new custom domain to provide a hostname for a CDN endpoint.
long-summary: >
Creates a new custom domain which must point to the hostname of the endpoint.
For example, the custom domain hostname cdn.contoso.com would need to have a
CNAME record pointing to the hostname of the endpoint related to this custom
domain.
parameters:
- name: --profile-name
type: string
short-summary: Name of the CDN profile which is unique within the resource group.
- name: --endpoint-name
type: string
short-summary: Name of the endpoint under the profile which is unique globally.
- name: --hostname
type: string
short-summary: The host name of the custom domain. Must be a domain name.
examples:
- name: Create a custom domain with resource name customdomain1 within an endpoint and profile.
text: >
az cdn custom-domain create -g group --endpoint-name endpoint --profile-name profile
-n customdomain1 --hostname www.example.com
"""
helps['cdn custom-domain delete'] = """
type: command
short-summary: Delete the custom domain of a CDN.
examples:
- name: Delete a custom domain with resource name customdomain1.
text: >
az cdn custom-domain delete -g group --endpoint-name endpoint --profile-name profile
-n customdomain1
"""
helps['cdn custom-domain show'] = """
type: command
short-summary: Show details for the custom domain of a CDN.
examples:
- name: Get the details of a custom domain with resource name customdomain1.
text: >
az cdn custom-domain show -g group --endpoint-name endpoint --profile-name profile
-n customdomain1
"""
helps['cdn custom-domain enable-https'] = """
type: command
short-summary: Enable HTTPS for a custom domain. The resource name of the custom domain could be obtained using "az cdn custom-domain list".
examples:
- name: Enable HTTPS for custom domain with resource name customdomain1 using a CDN-managed certificate
text: >
az cdn custom-domain enable-https -g group --profile-name profile --endpoint-name endpoint
-n customdomain1
- name: Enable HTTPS for custom domain with resource name customdomain1 using a CDN-managed certificate and set the minimum TLS version to 1.2
text: >
az cdn custom-domain enable-https -g group --profile-name profile --endpoint-name endpoint
-n customdomain1 --min-tls-version 1.2
"""
helps['cdn edge-node'] = """
type: group
short-summary: View all available CDN edge nodes.
"""
helps['cdn name-exists'] = """
type: command
short-summary: Check the availability of a resource name.
This is needed for resources where name is globally unique, such as a CDN endpoint.
examples:
- name: Check whether the resource name contoso is available or not.
text: >
az cdn name-exists --name contoso
"""
helps['cdn endpoint'] = """
type: group
short-summary: Manage CDN endpoints.
"""
helps['cdn endpoint create'] = """
type: command
short-summary: Create a named endpoint to connect to a CDN.
examples:
- name: Create an endpoint to service content for hostname over HTTP or HTTPS.
text: >
az cdn endpoint create -g group -n endpoint --profile-name profile
--origin www.example.com
- name: Create an endpoint with a custom domain origin with HTTP and HTTPS ports.
text: >
az cdn endpoint create -g group -n endpoint --profile-name profile
--origin www.example.com 88 4444
- name: Create an endpoint with a custom domain origin with private link enabled.
text: >
az cdn endpoint create -g group -n endpoint --profile-name profile
--origin www.example.com 80 443
/subscriptions/subid/resourcegroups/rg1/providers/Microsoft.Network/privateLinkServices/pls1
eastus "Please approve this request"
- name: Create an https-only endpoint with a custom domain origin and support compression for Azure CDN's default compression MIME types.
text: >
az cdn endpoint create -g group -n endpoint --profile-name profile
--origin www.example.com --no-http --enable-compression
- name: Create an endpoint with a custom domain origin and support compression for specific MIME types.
text: >
az cdn endpoint create -g group -n endpoint --profile-name profile
--origin www.example.com --enable-compression --content-types-to-compress text/plain text/html
"""
helps['cdn endpoint delete'] = """
type: command
short-summary: Delete a CDN endpoint.
examples:
- name: Delete a CDN endpoint.
text: az cdn endpoint delete -g group -n endpoint --profile-name profile-name
"""
helps['cdn endpoint list'] = """
type: command
short-summary: List available endpoints for a CDN.
examples:
- name: List all endpoints within a given CDN profile.
text: >
az cdn endpoint list -g group --profile-name profile-name
"""
helps['cdn endpoint load'] = """
type: command
short-summary: Pre-load content for a CDN endpoint.
parameters:
- name: --content-paths
type: string
short-summary: Space-separated values. The path to the content to be loaded.
Path should be a relative file URL of the origin.
examples:
- name: Pre-load Javascript and CSS content for an endpoint.
text: >
az cdn endpoint load -g group -n endpoint --profile-name profile-name --content-paths
'/scripts/app.js' '/styles/main.css'
"""
helps['cdn endpoint purge'] = """
type: command
short-summary: Purge pre-loaded content for a CDN endpoint.
parameters:
- name: --content-paths
type: string
short-summary: Space-separated values. The path to the content to be purged.
Can describe a file path or a wildcard directory.
examples:
- name: Purge pre-loaded Javascript and CSS content.
text: >
az cdn endpoint purge -g group -n endpoint --profile-name profile-name --content-paths
'./scripts/app.js' './styles/*'
"""
helps['cdn endpoint validate-custom-domain'] = """
type: command
short-summary: Validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS.
parameters:
- name: --host-name
type: string
short-summary: The host name of the custom domain. Must be a domain name.
examples:
- name: Validate domain www.contoso.com to see whether it maps to the correct CDN endpoint in DNS.
text: >
az cdn endpoint validate-custom-domain -g group -n endpoint --profile-name profile-name --host-name www.contoso.com
"""
helps['cdn endpoint start'] = """
type: command
short-summary: Start a CDN endpoint.
examples:
- name: Start a CDN endpoint.
text: >
az cdn endpoint start -g group -n endpoint --profile-name profile-name
"""
helps['cdn endpoint stop'] = """
type: command
short-summary: Stop a CDN endpoint.
examples:
- name: Stop a CDN endpoint.
text: >
az cdn endpoint stop -g group -n endpoint --profile-name profile-name
"""
helps['cdn endpoint update'] = """
type: command
short-summary: Update a CDN endpoint to manage how content is delivered.
parameters:
- name: --default-origin-group
type: string
short-summary: >
The origin group to use for origins not explicitly included in an origin group. Can be
specified as a resource ID or the name of an origin group of this endpoint.
examples:
- name: Turn off HTTP traffic for an endpoint.
text: >
az cdn endpoint update -g group -n endpoint --profile-name profile --no-http
- name: Enable content compression for an endpoint.
text: >
az cdn endpoint update -g group -n endpoint --profile-name profile
--enable-compression
"""
helps['cdn endpoint rule'] = """
type: group
short-summary: Manage delivery rules for an endpoint.
"""
helps['cdn endpoint rule add'] = """
type: command
short-summary: Add a delivery rule to a CDN endpoint.
parameters:
- name: --rule-name
type: string
short-summary: >
Name of the rule, only required for Microsoft SKU.
examples:
- name: Create a global rule to disable caching.
text: >
az cdn endpoint rule add -g group -n endpoint --profile-name profile --order 0
--rule-name global --action-name CacheExpiration --cache-behavior BypassCache
- name: Create a rule for http to https redirect.
text: >
az cdn endpoint rule add -g group -n endpoint --profile-name profile --order 1
--rule-name "redirect" --match-variable RequestScheme --operator Equal --match-values HTTP
--action-name "UrlRedirect" --redirect-protocol Https --redirect-type Moved
- name: Create a rule to distribute requests with "/test1" in its URL path to origin group with name "origingroup1".
text: >
az cdn endpoint rule add -g group -n endpoint --profile-name profile --order 1
--rule-name "origin-group-override" --match-variable UrlPath --operator Contains --match-values /test1
--action-name "OriginGroupOverride" --origin-group origingroup1
"""
helps['cdn endpoint rule remove'] = """
type: command
short-summary: Remove a delivery rule from an endpoint.
examples:
- name: Remove the global rule.
text: >
az cdn endpoint rule remove -g group -n endpoint --profile-name profile --rule-name Global
- name: Remove the rule with the order 4.
text: >
az cdn endpoint rule remove -g group -n endpoint --profile-name profile --order 4
"""
helps['cdn endpoint rule show'] = """
type: command
short-summary: Show delivery rules associate with the endpoint.
examples:
- name: show delivery rules associate with the endpoint.
text: >
az cdn endpoint rule show -g group -n endpoint --profile-name profile
"""
helps['cdn endpoint rule condition'] = """
type: group
short-summary: Manage delivery rule conditions for an endpoint.
"""
helps['cdn endpoint rule condition add'] = """
type: command
short-summary: Add a condition to a delivery rule.
examples:
- name: Add a remote address condition.
text: >
az cdn endpoint rule condition add -g group -n endpoint --profile-name profile --rule-name name
--match-variable RemoteAddress --operator GeoMatch --match-values "TH"
"""
helps['cdn endpoint rule condition remove'] = """
type: command
short-summary: Remove a condition from a delivery rule.
examples:
- name: Remove the first condition.
text: >
az cdn endpoint rule condition remove -g group -n endpoint --profile-name profile --rule-name name
--index 0
"""
helps['cdn endpoint rule condition show'] = """
type: command
short-summary: show delivery rules associate with the endpoint.
examples:
- name: show delivery rules associate with the endpoint.
text: >
az cdn endpoint rule condition show -g group -n endpoint --profile-name profile-name
"""
helps['cdn endpoint rule action'] = """
type: group
short-summary: Manage delivery rule actions for an endpoint.
"""
helps['cdn endpoint rule action add'] = """
type: command
short-summary: Add an action to a delivery rule.
examples:
- name: Add a redirect action.
text: >
az cdn endpoint rule action add -g group -n endpoint --profile-name profile --rule-name name
--action-name "UrlRedirect" --redirect-protocol HTTPS --redirect-type Moved
- name: Add a cache expiration action
text: >
az cdn endpoint rule action add -g group -n endpoint --profile-name profile --rule-name name
--action-name "CacheExpiration" --cache-behavior BypassCache
"""
helps['cdn endpoint rule action remove'] = """
type: command
short-summary: Remove an action from a delivery rule.
examples:
- name: Remove the first action.
text: >
az cdn endpoint rule action remove -g group -n endpoint --profile-name profile --rule-name name
--index 0
"""
helps['cdn endpoint rule action show'] = """
type: command
short-summary: show delivery rules asscociate with the endpoint.
examples:
- name: show delivery rules asscociate with the endpoint.
text: >
az cdn endpoint rule action show -g group --profile-name profile-name -n endpoint
"""
helps['cdn origin'] = """
type: group
short-summary: List or show existing origins related to CDN endpoints.
"""
helps['cdn origin create'] = """
type: command
short-summary: Create an origin.
parameters:
- name: --host-name
type: string
short-summary: >
The host name where requests to the origin will be sent.
- name: --http-port
type: int
short-summary: >
The port used for http requests to the origin.
- name: --https-port
type: int
short-summary: >
The port used for https requests to the origin.
- name: --origin-host-header
type: string
short-summary: >
The Host header to send for requests to this origin.
- name: --weight
type: int
short-summary: >
The weight of the origin in given origin group for load balancing. Must be between 1 and 1000.
- name: --priority
type: int
short-summary: >
The load balancing priority. Higher priorities will not be used for load
balancing if any lower priority origin is healthy. Must be between 1 and 5.
- name: --disabled
type: bool
short-summary: >
Don't use the origin for load balancing.
- name: --private-link-resource-id -p
type: string
short-summary: >
The resource id of the private link that the origin will be connected to.
- name: --private-link-location -l
type: string
short-summary: >
The location of the private link that the origin will be connected to.
- name: --private-link-approval-message -m
type: string
short-summary: >
The message that is shown to the approver of the private link request.
examples:
- name: Create an additional origin
text: >
az cdn origin create -g group --host-name example.contoso.com --profile-name profile --endpoint-name endpoint
-n origin --host-name example.contoso.com --origin-host-header example.contoso.com
--http-port 80 --https-port 443
- name: Create a private origin
text: >
az cdn origin create -g group --host-name example.contoso.com --profile-name profile --endpoint-name endpoint
-n origin --http-port 80 --https-port 443 --private-link-resource-id
/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group/providers/Microsoft.Network/privateLinkServices/pls
--private-link-location EastUS --private-link-approval-message 'Please approve this request'
"""
helps['cdn origin update'] = """
type: command
short-summary: Update an origin.
parameters:
- name: --host-name
type: string
short-summary: >
The host name where requests to the origin will be sent.
- name: --http-port
type: int
short-summary: >
The port used for http requests to the origin.
- name: --https-port
type: int
short-summary: >
The port used for https requests to the origin.
- name: --origin-host-header
type: string
short-summary: >
The Host header to send for requests to this origin.
- name: --weight
type: int
short-summary: >
The weight of the origin in given origin group for load balancing. Must be between 1 and 1000.
- name: --priority
type: int
short-summary: >
The load balancing priority. Higher priorities will not be used for load
balancing if any lower priority origin is healthy. Must be between 1 and 5.
- name: --disabled
type: bool
short-summary: >
Don't use the origin for load balancing.
- name: --private-link-resource-id -p
type: string
short-summary: >
The resource id of the private link that the origin will be connected to.
- name: --private-link-location -l
type: string
short-summary: >
The location of the private link that the origin will be connected to.
- name: --private-link-approval-message -m
type: string
short-summary: >
The message that is shown to the approver of the private link request.
examples:
- name: Update an origin
text: >
az cdn origin update -g group --profile-name profile --endpoint-name endpoint -n origin --http-port 80
--https-port 443 --priority 3 --weight 500 --host-name example.contoso.com
- name: Disable an origin
text: >
az cdn origin update -g group --profile-name profile --endpoint-name endpoint -n origin --disabled
- name: Connect an origin to a private link service
text: >
az cdn origin update -g group --profile-name profile --endpoint-name endpoint -n origin --http-port 80
--https-port 443 --private-link-resource-id
/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group/providers/Microsoft.Network/privateLinkServices/pls
--private-link-location EastUS --private-link-approval-message 'Please approve this request'
"""
helps['cdn origin-group'] = """
type: group
short-summary: Manage origin groups of an endpoint.
"""
helps['cdn origin-group create'] = """
type: command
short-summary: Create an origin group.
parameters:
- name: --origins
type: int
short-summary: >
The origins load balanced by this origin group, as a comma-separated list of origin names or
origin resource IDs.
- name: --probe-interval
type: int
short-summary: >
The frequency to perform health probes in seconds.
- name: --probe-path
type: str
short-summary: >
The path relative to the origin that is used to determine the health of the origin.
- name: --probe-protocol
type: string
short-summary: >
The protocol to use for health probes.
- name: --probe-method
type: string
short-summary: >
The request method to use for health probes.
# Uncomment this once response error detection support is added in RP:
# - name: --response-error-detection-error-types
# type: string
# short-summary: >
# The type of response errors for real user requests for which the origin will be deemed unhealthy.
# - name: --response-error-detection-failover-threshold
# type: int
# short-summary: >
# The threshold of failed requests required to trigger failover as a percent of 100.
# - name: --response-error-detection-status-code-ranges
# type: string
# short-summary: >
# The HTTP response status codes to count toward the response error detection failover threshold, specified
# as a comma-separated list of ranges.
examples:
- name: Create an origin group
text: >
az cdn origin-group create -g group --profile-name profile --endpoint-name endpoint -n origin-group
--origins origin-0,origin-1
- name: Create an origin group with a custom health probe
text: >
az cdn origin-group create -g group --profile-name profile --endpoint-name endpoint -n origin-group
--origins origin-0,origin-1 --probe-path /healthz --probe-interval 90
--probe-protocol HTTPS --probe-method GET
# Uncomment this once response error detection support is added in RP:
# - name: Create an origin group with response error detection
# text: >
# az cdn origin-group create -g group --profile-name profile --endpoint-name endpoint -n origin-group
# --origins origin-0,origin-1 --response-error-detection-error-types TcpErrorsOnly
# --response-error-detection-failover-threshold 5
# --response-error-detection-status-code-ranges 300-399,500-599
"""
helps['cdn origin-group update'] = """
type: command
short-summary: Update an origin group.
parameters:
- name: --origins
type: int
short-summary: >
The origins load balanced by this origin group, as a comma-separated list of origin names from the
parent endpoint origin IDs.
- name: --probe-interval
type: int
short-summary: >
The frequency to perform health probes in seconds.
- name: --probe-path
type: str
short-summary: >
The path relative to the origin that is used to determine the health of the origin.
- name: --probe-protocol
type: string
short-summary: >
The protocol to use for health probes.
- name: --probe-method
type: string
short-summary: >
The request method to use for health probes.
# Uncomment this once response error detection support is added in RP:
# - name: --response-error-detection-error-types
# type: string
# short-summary: >
# The type of response errors for real user requests for which the origin will be deemed unhealthy.
# - name: --response-error-detection-failover-threshold
# type: int
# short-summary: >
# The threshold of failed requests required to trigger failover as a percent of 100.
# - name: --response-error-detection-status-code-ranges
# type: string
# short-summary: >
# The HTTP response status codes to count toward the response error detection failover threshold.
examples:
- name: Update which origins are included in an origin group.
text: >
az cdn origin-group update -g group --profile-name profile --endpoint-name endpoint -n origin-group
--origins origin-0,origin-2
- name: Update an origin group with a custom health probe
text: >
az cdn origin-group update -g group --profile-name profile --endpoint-name endpoint -n origin-group
--origins origin-0,origin-1 --probe-path /healthz --probe-interval 90
--probe-protocol HTTPS --probe-method GET
# Uncomment this once response error detection support is added in RP:
# - name: Update an origin group with response error detection
# text: >
# az cdn origin-group update -g group --profile-name profile --endpoint-name endpoint -n origin-group
# --origins origin-0,origin-1 --response-error-detection-error-types TcpErrorsOnly
# --response-error-detection-failover-threshold 5
# --response-error-detection-status-code-ranges 300-399,500-599
"""
helps['cdn profile delete'] = """
type: command
short-summary: Delete a CDN profile.
examples:
- name: Delete a CDN profile.
text: >
az cdn profile delete -g group -n profile
"""
helps['cdn profile list'] = """
type: command
short-summary: List CDN profiles.
examples:
- name: List CDN profiles in a resource group.
text: >
az cdn profile list -g group
"""
helps['cdn profile show'] = """
type: command
short-summary: Show CDN profile details.
examples:
- name: Show CDN profile details.
text: >
az cdn profile show -g group -n profile
"""
helps['cdn profile update'] = """
type: command
short-summary: Update a CDN profile.
examples:
- name: Update a CDN profile. (autogenerated)
text: az cdn profile update --name MyCDNProfileWhichIsUniqueWithinResourceGroup --resource-group MyResourceGroup
crafted: true
"""
helps['afd'] = """
type: group
short-summary: Manage Azure Front Door Standard/Premium. For classical Azure Front Door, please refer https://docs.microsoft.com/en-us/cli/azure/network/front-door?view=azure-cli-latest
"""
helps['afd profile'] = """
type: group
short-summary: Manage AFD profiles.
"""
helps['afd profile create'] = """
type: command
short-summary: Create a new AFD profile.
examples:
- name: Create an AFD profile using Standard SKU.
text: >
az afd profile create -g group --profile-name profile --sku Standard_AzureFrontDoor
"""
helps['afd profile delete'] = """
type: command
short-summary: Delete an AFD profile.
examples:
- name: Delete an AFD profile.
text: >
az afd profile delete -g group --profile-name profile
"""
helps['afd profile usage'] = """
type: command
short-summary: List resource usage within the specific AFD profile.
examples:
- name: List resource usage within the specific AFD profile.
text: >
az afd profile usage -g group --profile-name profile
"""
helps['afd profile show'] = """
type: command
short-summary: Show details of an AFD profile.
examples:
- name: Show details of an AFD profile.
text: >
az afd profile show -g group --profile-name profile
"""
helps['afd profile list'] = """
type: command
short-summary: List AFD profiles.
examples:
- name: List AFD profiles in a resource group.
text: >
az afd profile list -g group
"""
helps['afd profile update'] = """
type: command
short-summary: Update an AFD profile.
examples:
- name: Update an AFD profile with tags.
text: az afd profile update --profile-name profile --resource-group MyResourceGroup --tags tag1=value1
"""
helps['afd origin-group'] = """
type: group
short-summary: Manage origin groups under the specified profile.
long-summary: >
An origin group is a set of origins to which Front Door load balances your client requests.
"""
helps['afd origin-group create'] = """
type: command
short-summary: Creates a new origin group within the specified profile.
examples:
- name: Creates a new origin group within the specified profile.
text: >
az afd origin-group create -g group --origin-group-name og1 --profile-name profile
--probe-request-type GET --probe-protocol Http --probe-interval-in-seconds 120 --probe-path /test1/azure.txt
--sample-size 4 --successful-samples-required 3
--additional-latency-in-milliseconds 50
"""
helps['afd origin-group update'] = """
type: command
short-summary: Updates an existing origin group within the specified profile.
examples:
- name: Update the probe setting of the specified origin group.
text: >
az afd origin-group update -g group --origin-group-name og1 --profile-name profile
--probe-request-type HEAD --probe-protocol Https --probe-interval-in-seconds 120 --probe-path /test1/azure.txt
"""
helps['afd origin-group delete'] = """
type: command
short-summary: Deletes an existing origin group within the specified profile.
examples:
- name: Deletes an existing origin group within a profile.
text: >
az afd origin-group delete -g group --origin-group-name og1 --profile-name profile
"""
helps['afd origin'] = """
type: group
short-summary: Manage origins within the specified origin group.
long-summary: >
Origins are the application servers where Front Door will route your client requests.
Utilize any publicly accessible application server, including App Service, Traffic Manager, Private Link, and many others.
"""
helps['afd origin create'] = """
type: command
short-summary: Create an AFD origin.
examples:
- name: Create an regular origin
text: >
az afd origin create -g group --host-name example.contoso.com --profile-name profile --origin-group-name originGroup
--origin-name origin1 --origin-host-header example.contoso.com --priority 1 --weight 500 --enabled-state Enabled
--http-port 80 --https-port 443
- name: Create a private link origin
text: >
az afd origin create -g group --host-name example.contoso.com --profile-name profile --origin-group-name originGroup
--origin-name origin1 --origin-host-header example.contoso.com --priority 1 --weight 500 --enabled-state Enabled
--http-port 80 --https-port 443 --private-link-resource
/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group/providers/Microsoft.Storage/storageAccounts/plstest
--private-link-location EastUS --private-link-request-message 'Please approve this request' --private-link-sub-resource-type table
"""
helps['afd origin update'] = """
type: command
short-summary: Update the settings of the specified AFD origin.
examples:
- name: Update the host header and priority of the specified origin.
text: >
az afd origin update -g group --host-name example.contoso.com --profile-name profile --origin-group-name originGroup
--origin-name origin1 --origin-host-header example.contoso.com --priority 3
- name: Disable private link of the origin.
text: >
az afd origin update -g group --host-name example.contoso.com --profile-name profile --origin-group-name originGroup
--origin-name origin1 --enable-private-link False
"""
helps['afd custom-domain'] = """
type: group
short-summary: Manage custom domains within the specified profile.
"""
helps['afd custom-domain create'] = """
type: command
short-summary: Create a custom domain within the specified profile.
long-summary: >
The operation will complete with a created custom domain with its validation state set to 'Pending.
You have to create a DNS TXT record "_dnsauth.<your_custom_domain>" with the validation token as its value to make the domain's validation state become 'Approved' to server traffic.
Use "az afd custom-domain show" to obtain the validation token.
The validation token will expire after 7 days and your domain's validation state will become "Timeout" if no correct TXT record detected in that period.
You could use 'az afd custom-domain regenerate-validation-token' to regenerate the validation token to restart the validation process.
examples:
- name: Create a custom domain that uses AFD managed certificate for SSL/TLS encryption.
text: >
az afd custom-domain create -g group --custom-domain-name customDomain --profile-name profile --host-name www.contoso.com
--minimum-tls-version TLS12 --certificate-type ManagedCertificate
- name: Create a custom domain that uses your own certificate for SSL/TLS encryption, the certificate is stored in Azure Key Vault and referenced by an AFD secret.
text: >
az afd custom-domain create -g group --custom-domain-name customDomain --profile-name profile --host-name www.contoso.com
--minimum-tls-version TLS12 --certificate-type CustomerCertificate --secret secretName
"""
helps['afd custom-domain update'] = """
type: command
short-summary: Update a custom domain within the specified profile.
examples:
- name: Update the custom domain's supported minimum TLS version.
text: >
az afd custom-domain update -g group --custom-domain-name customDomain --profile-name profile --minimum-tls-version TLS12
- name: Update the custom domain's certificate type to AFD managed certificate.
text: >
az afd custom-domain update -g group --custom-domain-name customDomain --profile-name profile --certificate-type ManagedCertificate
"""
helps['afd custom-domain delete'] = """
type: command
short-summary: Delete a custom domain.
examples:
- name: Delete a custom domain.
text: >
az afd custom-domain delete -g group --profile-name profile --custom-domain-name customDomainName
"""
helps['afd custom-domain show'] = """
type: command
short-summary: Show the custom domain details.
examples:
- name: show details of the custom domain within the specified profile.
text: >
az afd custom-domain show -g group --profile-name profile --custom-domain-name customDomainName
"""
helps['afd custom-domain list'] = """
type: command
short-summary: List all the custom domains within the specified profile.
examples:
- name: List all the custom domains within the specified profile.
text: >
az afd custom-domain list -g group --profile-name profile
"""
helps['afd custom-domain wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the custom domain is met.
examples:
- name: Wait until a custom domain is created.
text: az afd custom-domain wait -g MyResourceGroup --profile-name MyProfle --custom-domain-name MyCustomDomain --created
"""
helps['afd custom-domain regenerate-validation-token'] = """
type: command
short-summary: Regenerate the domain validation token to restart the validation process.
examples:
- name: Regenerate the domain validation token.
text: az afd custom-domain regenerate-validation-token -g MyResourceGroup --profile-name MyProfle --custom-domain-name MyCustomDomain
"""
helps['afd endpoint'] = """
type: group
short-summary: Manage AFD endpoints within the specified profile.
long-summary: >
An endpoint is a logical grouping of domains and their associated configurations.
"""
helps['afd endpoint create'] = """
type: command
short-summary: Creates an endpoint within the specified profile.
long-summary: >
Azure Front Door will generate a deterministic DNS domain based on the customer input endpoint name in the form of <endpoint name>-<hash>.z01.azurefd.net,
the deterministic DNS domain could be reused within the tenant, subscription, or resource group depends on the --name-reuse-scope option.
Customer will get the same DNS domain in the reuse scope if the endpoint get deleted and recreated.
examples:
- name: Creates an enabled endpoint
text: >
az afd endpoint create -g group --endpoint-name endpoint1 --profile-name profile --enabled-state Enabled
"""
helps['afd endpoint update'] = """
type: command
short-summary: Update an endpoint within the specified profile.
examples:
- name: Update an endpoint's state to disabled.
text: >
az afd endpoint update -g group --endpoint-name endpoint1 --profile-name profile --enabled-state Disabled
"""
helps['afd endpoint delete'] = """
type: command
short-summary: Delete an endpoint within the specified profile.
examples:
- name: Delete an endpoint named endpoint1.
text: >
az afd endpoint delete -g group --profile-name profile --endpoint-name endpoint1
"""
helps['afd endpoint show'] = """
type: command
short-summary: Show details of an endpoint within the specified profile.
examples:
- name: show details of the endpoint named endpoint1.
text: >
az afd endpoint show -g group --profile-name profile --endpoint-name endpoint1
"""
helps['afd endpoint list'] = """
type: command
short-summary: List all the endpoints within the specified profile.
examples:
- name: List all the endpoints within the specified profile.
text: >
az afd endpoint list -g group --profile-name profile
"""
helps['afd endpoint purge'] = """
type: command
short-summary: Removes cached contents from Azure Front Door.
examples:
- name: Remove all cached contents under directory "/script" for domain www.contoso.com
text: >
az afd endpoint purge -g group --profile-name profile --domains www.contoso.com --content-paths '/scripts/*'
"""
helps['afd route'] = """
type: group
short-summary: Manage routes under an AFD endpoint.
long-summary: >
A route maps your domains and matching URL path patterns to a specific origin group.
"""
helps['afd route create'] = """
type: command
short-summary: Creates a new route within the specified endpoint.
examples:
- name: Creates a route to associate the endpoint's default domain with an origin group for all HTTPS requests.
text: >
az afd route create -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --https-redirect Disabled
--origin-group og001 --supported-protocols Https --link-to-default-domain Enabled --forwarding-protocol MatchRequest
- name: Creates a route to associate the endpoint's default domain with an origin group for all requests and use the specified rule sets to customize the route behavior.
text: >
az afd route create -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --rule-sets ruleset1 rulseset2
--origin-group og001 --supported-protocols Http Https --link-to-default-domain Enabled --forwarding-protocol MatchRequest --https-redirect Disabled
- name: Creates a route to associate the endpoint's default domain and a custom domain with an origin group for all requests with the specified path patterns and redirect all trafic to use Https.
text: >
az afd route create -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --patterns-to-match /test1/* /tes2/*
--origin-group og001 --supported-protocols Http Https --custom-domains cd001 --forwarding-protocol MatchRequest --https-redirect Enabled --link-to-default-domain Enabled
"""
helps['afd route update'] = """
type: command
short-summary: Update an existing route within the specified endpoint.
examples:
- name: Update a route to accept both Http and Https requests and redirect all trafic to use Https.
text: >
az afd route update -g group --endpoint-name endpoint1 --profile-name profile --route-name route1
--supported-protocols Http Https --https-redirect Enabled
- name: Update a route's rule sets settings to customize the route behavior.
text: >
az afd route update -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --rule-sets ruleset1 rulseset2
- name: Update a route's compression settings to enable compression for the specified content types.
text: >
az afd route update -g group --endpoint-name endpoint1 --profile-name profile --route-name route1 --query-string-caching-behavior IgnoreQueryString
--enable-compression true --content-types-to-compress text/javascript text/plain
"""
helps['afd security-policy'] = """
type: group
short-summary: Manage security policies within the specified profile.
long-summary: >
Security policies could be used to apply a web application firewall policy to protect your web applications against OWASP top-10 vulnerabilities and
block malicious bots.
"""
helps['afd security-policy create'] = """
type: command
short-summary: Creates a new security policy within the specified profile.
examples:
- name: Creates a security policy to apply the specified WAF policy to an endpoint's default domain and a custom domain.
text: >
az afd security-policy create -g group --profile-name profile --security-policy-name sp1 --domains
/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.Cdn/profiles/profile1/afdEndpoints/endpoint1
/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.Cdn/profiles/profile1/customDomains/customDomain1
--waf-policy
/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/waf1
"""
helps['afd security-policy update'] = """
type: command
short-summary: Update an existing security policy within the specified profile.
examples:
- name: Update the specified security policy's domain list.
text: >
az afd security-policy update -g group --security-policy-name sp1 --profile-name profile --domains
/subscriptions/sub1/resourcegroups/rg1/providers/Microsoft.Cdn/profiles/profile1/customDomains/customDomain1
"""
helps['afd route delete'] = """
type: command
short-summary: Delete an existing route within the specified endpoint.
examples:
- name: Delete an route named route1.
text: >
az afd route delete -g group --profile-name profile --endpoint-name endpoint1 --route-name route1
"""
helps['afd secret'] = """
type: group
short-summary: Manage secrets within the specified profile.
long-summary: >