Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class Create(AAZCommand):
"""

_aaz_info = {
"version": "2024-10-01",
"version": "2025-07-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationgateways/{}", "2024-10-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationgateways/{}", "2025-07-01"],
]
}

Expand Down Expand Up @@ -1651,7 +1651,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-10-01",
"api-version", "2025-07-01",
required=True,
),
}
Expand Down Expand Up @@ -3268,6 +3268,7 @@ def _build_schema_on_200_201(cls):

properties = cls._schema_on_200_201.properties.ssl_certificates.Element.properties
properties.data = AAZStrType()
properties.hsm = AAZObjectType()
properties.key_vault_secret_id = AAZStrType(
serialized_name="keyVaultSecretId",
)
Expand All @@ -3281,6 +3282,14 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)

hsm = cls._schema_on_200_201.properties.ssl_certificates.Element.properties.hsm
hsm.key_id = AAZStrType(
serialized_name="keyId",
)
hsm.public_cert_data = AAZStrType(
serialized_name="publicCertData",
)

ssl_profiles = cls._schema_on_200_201.properties.ssl_profiles
ssl_profiles.Element = AAZObjectType()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class Show(AAZCommand):
"""

_aaz_info = {
"version": "2024-10-01",
"version": "2025-07-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationgateways/{}", "2024-10-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationgateways/{}", "2025-07-01"],
]
}

Expand Down Expand Up @@ -117,7 +117,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-10-01",
"api-version", "2025-07-01",
required=True,
),
Comment on lines 117 to 122
}
Expand Down Expand Up @@ -1062,6 +1062,7 @@ def _build_schema_on_200(cls):

properties = cls._schema_on_200.properties.ssl_certificates.Element.properties
properties.data = AAZStrType()
properties.hsm = AAZObjectType()
properties.key_vault_secret_id = AAZStrType(
serialized_name="keyVaultSecretId",
)
Expand All @@ -1075,6 +1076,14 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)

hsm = cls._schema_on_200.properties.ssl_certificates.Element.properties.hsm
hsm.key_id = AAZStrType(
serialized_name="keyId",
)
hsm.public_cert_data = AAZStrType(
serialized_name="publicCertData",
)

ssl_profiles = cls._schema_on_200.properties.ssl_profiles
ssl_profiles.Element = AAZObjectType()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class Update(AAZCommand):
"""

_aaz_info = {
"version": "2024-10-01",
"version": "2025-07-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationgateways/{}", "2024-10-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/applicationgateways/{}", "2025-07-01"],
]
}

Expand Down Expand Up @@ -452,7 +452,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-10-01",
"api-version", "2025-07-01",
required=True,
),
}
Expand Down Expand Up @@ -551,7 +551,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-10-01",
"api-version", "2025-07-01",
required=True,
),
}
Expand Down Expand Up @@ -1864,6 +1864,7 @@ def _build_schema_application_gateway_read(cls, _schema):

properties = _schema_application_gateway_read.properties.ssl_certificates.Element.properties
properties.data = AAZStrType()
properties.hsm = AAZObjectType()
properties.key_vault_secret_id = AAZStrType(
serialized_name="keyVaultSecretId",
)
Expand All @@ -1877,6 +1878,14 @@ def _build_schema_application_gateway_read(cls, _schema):
flags={"read_only": True},
)

hsm = _schema_application_gateway_read.properties.ssl_certificates.Element.properties.hsm
hsm.key_id = AAZStrType(
serialized_name="keyId",
)
hsm.public_cert_data = AAZStrType(
serialized_name="publicCertData",
)

ssl_profiles = _schema_application_gateway_read.properties.ssl_profiles
ssl_profiles.Element = AAZObjectType()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,51 @@ def test_no_shared_key_without_cert_auth_should_raise(self):
self.assertIn('--shared-key is required', str(ctx.exception))


def test_application_gateway_parent_api_version(self):
"""Parent application-gateway operations must use API version 2025-07-01 so that
Managed HSM SSL certificate fields (hsm.keyId / hsm.publicCertData) are preserved."""
from azure.cli.command_modules.network.aaz.latest.network.application_gateway import _show, _create, _update

for module, name in [(_show, "Show"), (_create, "Create"), (_update, "Update")]:
cls = getattr(module, name)
Comment on lines +131 to +134
self.assertEqual(
cls._aaz_info["version"],
"2025-07-01",
msg=f"application-gateway {name}._aaz_info['version'] must be 2025-07-01",
)
for resource in cls._aaz_info["resources"]:
self.assertEqual(
resource[-1],
"2025-07-01",
msg=f"application-gateway {name} resources entry must reference 2025-07-01",
)

def test_application_gateway_show_ssl_cert_hsm_schema(self):
"""The parent application-gateway show response schema must include the
sslCertificates[].properties.hsm object with keyId and publicCertData."""
from azure.cli.command_modules.network.aaz.latest.network.application_gateway._show import Show

inner_cls = Show.ApplicationGatewaysGet
inner_cls._build_schema_on_200()
ssl_cert_props = inner_cls._schema_on_200.properties.ssl_certificates.Element.properties
fields = ssl_cert_props._fields
self.assertIn(
"hsm",
fields,
"ssl_certificates.Element.properties must contain 'hsm'",
)
hsm_fields = fields["hsm"]._fields
self.assertIn(
"key_id",
hsm_fields,
"ssl_certificates.Element.properties.hsm must contain 'key_id'",
)
self.assertIn(
"public_cert_data",
hsm_fields,
"ssl_certificates.Element.properties.hsm must contain 'public_cert_data'",
)


if __name__ == '__main__':
unittest.main()
Loading