Skip to content

Commit 930ec5d

Browse files
Ptnan7Jingnan
andauthored
{cdn} Upgraded version to 2025-04-15, added support for cipher (#31375)
Co-authored-by: Jingnan <jingnanxu@microsoft.com>
1 parent a0c45a7 commit 930ec5d

File tree

9 files changed

+1268
-858
lines changed

9 files changed

+1268
-858
lines changed

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/custom_domain/_create.py

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class Create(AAZCommand):
2525
"""
2626

2727
_aaz_info = {
28-
"version": "2024-09-01",
28+
"version": "2025-04-15",
2929
"resources": [
30-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/customdomains/{}", "2024-09-01"],
30+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/customdomains/{}", "2025-04-15"],
3131
]
3232
}
3333

@@ -57,6 +57,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
5757
options=["--profile-name"],
5858
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
5959
required=True,
60+
fmt=AAZStrArgFormat(
61+
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
62+
max_length=260,
63+
min_length=1,
64+
),
6065
)
6166
_args_schema.resource_group = AAZResourceGroupNameArg(
6267
required=True,
@@ -98,11 +103,42 @@ def _build_arguments_schema(cls, *args, **kwargs):
98103
help="Defines the source of the SSL certificate.",
99104
enum={"AzureFirstPartyManagedCertificate": "AzureFirstPartyManagedCertificate", "CustomerCertificate": "CustomerCertificate", "ManagedCertificate": "ManagedCertificate"},
100105
)
106+
_args_schema.cipher_suite_set_type = AAZStrArg(
107+
options=["--cipher-suite-set-type"],
108+
arg_group="TlsSettings",
109+
help="cipher suite set type that will be used for Https",
110+
enum={"Customized": "Customized", "TLS10_2019": "TLS10_2019", "TLS12_2022": "TLS12_2022", "TLS12_2023": "TLS12_2023"},
111+
)
112+
_args_schema.customized_cipher_suite_set = AAZObjectArg(
113+
options=["--customized-cipher-suite-set"],
114+
arg_group="TlsSettings",
115+
help="Customized cipher suites object that will be used for Https when cipherSuiteSetType is Customized.",
116+
)
101117
_args_schema.minimum_tls_version = AAZStrArg(
102118
options=["--minimum-tls-version"],
103119
arg_group="TlsSettings",
104120
help="TLS protocol version that will be used for Https",
105-
enum={"TLS10": "TLS10", "TLS12": "TLS12"},
121+
enum={"TLS10": "TLS10", "TLS12": "TLS12", "TLS13": "TLS13"},
122+
)
123+
124+
customized_cipher_suite_set = cls._args_schema.customized_cipher_suite_set
125+
customized_cipher_suite_set.cipher_suite_set_for_tls12 = AAZListArg(
126+
options=["cipher-suite-set-for-tls12"],
127+
help="Cipher suites for TLS 1.2. Required at least one in minimumTlsVersion TLS 1.2.",
128+
)
129+
customized_cipher_suite_set.cipher_suite_set_for_tls13 = AAZListArg(
130+
options=["cipher-suite-set-for-tls13"],
131+
help="Cipher suites for TLS 1.3. Required at least one in minimumTlsVersion TLS 1.2, TLS 1.3.",
132+
)
133+
134+
cipher_suite_set_for_tls12 = cls._args_schema.customized_cipher_suite_set.cipher_suite_set_for_tls12
135+
cipher_suite_set_for_tls12.Element = AAZStrArg(
136+
enum={"DHE_RSA_AES128_GCM_SHA256": "DHE_RSA_AES128_GCM_SHA256", "DHE_RSA_AES256_GCM_SHA384": "DHE_RSA_AES256_GCM_SHA384", "ECDHE_RSA_AES128_GCM_SHA256": "ECDHE_RSA_AES128_GCM_SHA256", "ECDHE_RSA_AES128_SHA256": "ECDHE_RSA_AES128_SHA256", "ECDHE_RSA_AES256_GCM_SHA384": "ECDHE_RSA_AES256_GCM_SHA384", "ECDHE_RSA_AES256_SHA384": "ECDHE_RSA_AES256_SHA384"},
137+
)
138+
139+
cipher_suite_set_for_tls13 = cls._args_schema.customized_cipher_suite_set.cipher_suite_set_for_tls13
140+
cipher_suite_set_for_tls13.Element = AAZStrArg(
141+
enum={"TLS_AES_128_GCM_SHA256": "TLS_AES_128_GCM_SHA256", "TLS_AES_256_GCM_SHA384": "TLS_AES_256_GCM_SHA384"},
106142
)
107143
return cls._args_schema
108144

@@ -209,7 +245,7 @@ def url_parameters(self):
209245
def query_parameters(self):
210246
parameters = {
211247
**self.serialize_query_param(
212-
"api-version", "2024-09-01",
248+
"api-version", "2025-04-15",
213249
required=True,
214250
),
215251
}
@@ -249,9 +285,24 @@ def content(self):
249285
tls_settings = _builder.get(".properties.tlsSettings")
250286
if tls_settings is not None:
251287
tls_settings.set_prop("certificateType", AAZStrType, ".certificate_type", typ_kwargs={"flags": {"required": True}})
288+
tls_settings.set_prop("cipherSuiteSetType", AAZStrType, ".cipher_suite_set_type")
289+
tls_settings.set_prop("customizedCipherSuiteSet", AAZObjectType, ".customized_cipher_suite_set")
252290
tls_settings.set_prop("minimumTlsVersion", AAZStrType, ".minimum_tls_version")
253291
tls_settings.set_prop("secret", AAZObjectType)
254292

293+
customized_cipher_suite_set = _builder.get(".properties.tlsSettings.customizedCipherSuiteSet")
294+
if customized_cipher_suite_set is not None:
295+
customized_cipher_suite_set.set_prop("cipherSuiteSetForTls12", AAZListType, ".cipher_suite_set_for_tls12")
296+
customized_cipher_suite_set.set_prop("cipherSuiteSetForTls13", AAZListType, ".cipher_suite_set_for_tls13")
297+
298+
cipher_suite_set_for_tls12 = _builder.get(".properties.tlsSettings.customizedCipherSuiteSet.cipherSuiteSetForTls12")
299+
if cipher_suite_set_for_tls12 is not None:
300+
cipher_suite_set_for_tls12.set_elements(AAZStrType, ".")
301+
302+
cipher_suite_set_for_tls13 = _builder.get(".properties.tlsSettings.customizedCipherSuiteSet.cipherSuiteSetForTls13")
303+
if cipher_suite_set_for_tls13 is not None:
304+
cipher_suite_set_for_tls13.set_elements(AAZStrType, ".")
305+
255306
secret = _builder.get(".properties.tlsSettings.secret")
256307
if secret is not None:
257308
secret.set_prop("id", AAZStrType, ".secret")
@@ -368,12 +419,32 @@ def _build_schema_afd_domain_read(cls, _schema):
368419
serialized_name="certificateType",
369420
flags={"required": True},
370421
)
422+
tls_settings.cipher_suite_set_type = AAZStrType(
423+
serialized_name="cipherSuiteSetType",
424+
)
425+
tls_settings.customized_cipher_suite_set = AAZObjectType(
426+
serialized_name="customizedCipherSuiteSet",
427+
)
371428
tls_settings.minimum_tls_version = AAZStrType(
372429
serialized_name="minimumTlsVersion",
373430
)
374431
tls_settings.secret = AAZObjectType()
375432
cls._build_schema_resource_reference_read(tls_settings.secret)
376433

434+
customized_cipher_suite_set = _schema_afd_domain_read.properties.tls_settings.customized_cipher_suite_set
435+
customized_cipher_suite_set.cipher_suite_set_for_tls12 = AAZListType(
436+
serialized_name="cipherSuiteSetForTls12",
437+
)
438+
customized_cipher_suite_set.cipher_suite_set_for_tls13 = AAZListType(
439+
serialized_name="cipherSuiteSetForTls13",
440+
)
441+
442+
cipher_suite_set_for_tls12 = _schema_afd_domain_read.properties.tls_settings.customized_cipher_suite_set.cipher_suite_set_for_tls12
443+
cipher_suite_set_for_tls12.Element = AAZStrType()
444+
445+
cipher_suite_set_for_tls13 = _schema_afd_domain_read.properties.tls_settings.customized_cipher_suite_set.cipher_suite_set_for_tls13
446+
cipher_suite_set_for_tls13.Element = AAZStrType()
447+
377448
validation_properties = _schema_afd_domain_read.properties.validation_properties
378449
validation_properties.expiration_date = AAZStrType(
379450
serialized_name="expirationDate",

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/custom_domain/_delete.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class Delete(AAZCommand):
2323
"""
2424

2525
_aaz_info = {
26-
"version": "2024-09-01",
26+
"version": "2025-04-15",
2727
"resources": [
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/customdomains/{}", "2024-09-01"],
28+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/customdomains/{}", "2025-04-15"],
2929
]
3030
}
3131

@@ -57,6 +57,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
5757
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
5858
required=True,
5959
id_part="name",
60+
fmt=AAZStrArgFormat(
61+
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
62+
max_length=260,
63+
min_length=1,
64+
),
6065
)
6166
_args_schema.resource_group = AAZResourceGroupNameArg(
6267
required=True,
@@ -153,7 +158,7 @@ def url_parameters(self):
153158
def query_parameters(self):
154159
parameters = {
155160
**self.serialize_query_param(
156-
"api-version", "2024-09-01",
161+
"api-version", "2025-04-15",
157162
required=True,
158163
),
159164
}

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/custom_domain/_list.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class List(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-09-01",
25+
"version": "2025-04-15",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/customdomains", "2024-09-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/customdomains", "2025-04-15"],
2828
]
2929
}
3030

@@ -49,6 +49,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
4949
options=["--profile-name"],
5050
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
5151
required=True,
52+
fmt=AAZStrArgFormat(
53+
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
54+
max_length=260,
55+
min_length=1,
56+
),
5257
)
5358
_args_schema.resource_group = AAZResourceGroupNameArg(
5459
required=True,
@@ -121,7 +126,7 @@ def url_parameters(self):
121126
def query_parameters(self):
122127
parameters = {
123128
**self.serialize_query_param(
124-
"api-version", "2024-09-01",
129+
"api-version", "2025-04-15",
125130
required=True,
126131
),
127132
}
@@ -230,12 +235,32 @@ def _build_schema_on_200(cls):
230235
serialized_name="certificateType",
231236
flags={"required": True},
232237
)
238+
tls_settings.cipher_suite_set_type = AAZStrType(
239+
serialized_name="cipherSuiteSetType",
240+
)
241+
tls_settings.customized_cipher_suite_set = AAZObjectType(
242+
serialized_name="customizedCipherSuiteSet",
243+
)
233244
tls_settings.minimum_tls_version = AAZStrType(
234245
serialized_name="minimumTlsVersion",
235246
)
236247
tls_settings.secret = AAZObjectType()
237248
_ListHelper._build_schema_resource_reference_read(tls_settings.secret)
238249

250+
customized_cipher_suite_set = cls._schema_on_200.value.Element.properties.tls_settings.customized_cipher_suite_set
251+
customized_cipher_suite_set.cipher_suite_set_for_tls12 = AAZListType(
252+
serialized_name="cipherSuiteSetForTls12",
253+
)
254+
customized_cipher_suite_set.cipher_suite_set_for_tls13 = AAZListType(
255+
serialized_name="cipherSuiteSetForTls13",
256+
)
257+
258+
cipher_suite_set_for_tls12 = cls._schema_on_200.value.Element.properties.tls_settings.customized_cipher_suite_set.cipher_suite_set_for_tls12
259+
cipher_suite_set_for_tls12.Element = AAZStrType()
260+
261+
cipher_suite_set_for_tls13 = cls._schema_on_200.value.Element.properties.tls_settings.customized_cipher_suite_set.cipher_suite_set_for_tls13
262+
cipher_suite_set_for_tls13.Element = AAZStrType()
263+
239264
validation_properties = cls._schema_on_200.value.Element.properties.validation_properties
240265
validation_properties.expiration_date = AAZStrType(
241266
serialized_name="expirationDate",

src/azure-cli/azure/cli/command_modules/cdn/aaz/latest/afd/custom_domain/_show.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class Show(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2024-09-01",
25+
"version": "2025-04-15",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/customdomains/{}", "2024-09-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.cdn/profiles/{}/customdomains/{}", "2025-04-15"],
2828
]
2929
}
3030

@@ -55,6 +55,11 @@ def _build_arguments_schema(cls, *args, **kwargs):
5555
help="Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.",
5656
required=True,
5757
id_part="name",
58+
fmt=AAZStrArgFormat(
59+
pattern="^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$",
60+
max_length=260,
61+
min_length=1,
62+
),
5863
)
5964
_args_schema.resource_group = AAZResourceGroupNameArg(
6065
required=True,
@@ -130,7 +135,7 @@ def url_parameters(self):
130135
def query_parameters(self):
131136
parameters = {
132137
**self.serialize_query_param(
133-
"api-version", "2024-09-01",
138+
"api-version", "2025-04-15",
134139
required=True,
135140
),
136141
}
@@ -228,12 +233,32 @@ def _build_schema_on_200(cls):
228233
serialized_name="certificateType",
229234
flags={"required": True},
230235
)
236+
tls_settings.cipher_suite_set_type = AAZStrType(
237+
serialized_name="cipherSuiteSetType",
238+
)
239+
tls_settings.customized_cipher_suite_set = AAZObjectType(
240+
serialized_name="customizedCipherSuiteSet",
241+
)
231242
tls_settings.minimum_tls_version = AAZStrType(
232243
serialized_name="minimumTlsVersion",
233244
)
234245
tls_settings.secret = AAZObjectType()
235246
_ShowHelper._build_schema_resource_reference_read(tls_settings.secret)
236247

248+
customized_cipher_suite_set = cls._schema_on_200.properties.tls_settings.customized_cipher_suite_set
249+
customized_cipher_suite_set.cipher_suite_set_for_tls12 = AAZListType(
250+
serialized_name="cipherSuiteSetForTls12",
251+
)
252+
customized_cipher_suite_set.cipher_suite_set_for_tls13 = AAZListType(
253+
serialized_name="cipherSuiteSetForTls13",
254+
)
255+
256+
cipher_suite_set_for_tls12 = cls._schema_on_200.properties.tls_settings.customized_cipher_suite_set.cipher_suite_set_for_tls12
257+
cipher_suite_set_for_tls12.Element = AAZStrType()
258+
259+
cipher_suite_set_for_tls13 = cls._schema_on_200.properties.tls_settings.customized_cipher_suite_set.cipher_suite_set_for_tls13
260+
cipher_suite_set_for_tls13.Element = AAZStrType()
261+
237262
validation_properties = cls._schema_on_200.properties.validation_properties
238263
validation_properties.expiration_date = AAZStrType(
239264
serialized_name="expirationDate",

0 commit comments

Comments
 (0)