Skip to content

Commit 5e5d819

Browse files
authored
Re-model preflight response to avoid breaking change in .NET SDK (#32255)
* Re-model preflight response to avoid breaking change in .NET SDK * Add examples for 400 responses to preflight * Add 'id', 'name', and 'type' properties to preflight response model to reflect API beavhior * Update Microsoft.Resources readme files * Add back removed readme configs to clear Swagger Avocado error
1 parent db8e7d3 commit 5e5d819

File tree

9 files changed

+230
-25
lines changed

9 files changed

+230
-25
lines changed

specification/resources/resource-manager/Microsoft.Resources/stable/2024-07-01/resources.json

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
"200": {
284284
"description": "The template deployment validation succeeded. Please inspect 'warnings' property since some resources might have been skipped from validation.",
285285
"schema": {
286-
"$ref": "#/definitions/DeploymentExtended"
286+
"$ref": "#/definitions/DeploymentValidateResult"
287287
}
288288
},
289289
"202": {
@@ -292,7 +292,7 @@
292292
"400": {
293293
"description": "The template deployment validation detected failures.",
294294
"schema": {
295-
"$ref": "#/definitions/DeploymentValidationError"
295+
"$ref": "#/definitions/DeploymentValidateResult"
296296
}
297297
},
298298
"default": {
@@ -593,7 +593,7 @@
593593
"200": {
594594
"description": "The template deployment validation succeeded. Please inspect 'warnings' property since some resources might have been skipped from validation.",
595595
"schema": {
596-
"$ref": "#/definitions/DeploymentExtended"
596+
"$ref": "#/definitions/DeploymentValidateResult"
597597
}
598598
},
599599
"202": {
@@ -602,7 +602,7 @@
602602
"400": {
603603
"description": "The template deployment validation detected failures.",
604604
"schema": {
605-
"$ref": "#/definitions/DeploymentValidationError"
605+
"$ref": "#/definitions/DeploymentValidateResult"
606606
}
607607
},
608608
"default": {
@@ -977,7 +977,7 @@
977977
"200": {
978978
"description": "The template deployment validation succeeded. Please inspect 'warnings' property since some resources might have been skipped from validation.",
979979
"schema": {
980-
"$ref": "#/definitions/DeploymentExtended"
980+
"$ref": "#/definitions/DeploymentValidateResult"
981981
}
982982
},
983983
"202": {
@@ -986,7 +986,7 @@
986986
"400": {
987987
"description": "The template deployment validation detected failures.",
988988
"schema": {
989-
"$ref": "#/definitions/DeploymentValidationError"
989+
"$ref": "#/definitions/DeploymentValidateResult"
990990
}
991991
},
992992
"default": {
@@ -1370,7 +1370,7 @@
13701370
"200": {
13711371
"description": "The template deployment validation succeeded. Please inspect 'warnings' property since some resources might have been skipped from validation.",
13721372
"schema": {
1373-
"$ref": "#/definitions/DeploymentExtended"
1373+
"$ref": "#/definitions/DeploymentValidateResult"
13741374
}
13751375
},
13761376
"202": {
@@ -1379,7 +1379,7 @@
13791379
"400": {
13801380
"description": "The template deployment validation detected failures.",
13811381
"schema": {
1382-
"$ref": "#/definitions/DeploymentValidationError"
1382+
"$ref": "#/definitions/DeploymentValidateResult"
13831383
}
13841384
},
13851385
"default": {
@@ -1832,7 +1832,7 @@
18321832
"200": {
18331833
"description": "The template deployment validation succeeded. Please inspect 'warnings' property since some resources might have been skipped from validation.",
18341834
"schema": {
1835-
"$ref": "#/definitions/DeploymentExtended"
1835+
"$ref": "#/definitions/DeploymentValidateResult"
18361836
}
18371837
},
18381838
"202": {
@@ -1841,7 +1841,7 @@
18411841
"400": {
18421842
"description": "The template deployment validation detected failures.",
18431843
"schema": {
1844-
"$ref": "#/definitions/DeploymentValidationError"
1844+
"$ref": "#/definitions/DeploymentValidateResult"
18451845
}
18461846
},
18471847
"default": {
@@ -5521,13 +5521,34 @@
55215521
},
55225522
"description": "Deployment on error behavior with additional details."
55235523
},
5524-
"DeploymentValidationError": {
5524+
"DeploymentValidateResult": {
55255525
"properties": {
55265526
"error": {
5527-
"$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorDetail"
5527+
"readOnly": true,
5528+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse",
5529+
"description": "The deployment validation error."
5530+
},
5531+
"id": {
5532+
"readOnly": true,
5533+
"type": "string",
5534+
"description": "The ID of the deployment."
5535+
},
5536+
"name": {
5537+
"readOnly": true,
5538+
"type": "string",
5539+
"description": "The name of the deployment."
5540+
},
5541+
"type": {
5542+
"readOnly": true,
5543+
"type": "string",
5544+
"description": "The type of the deployment."
5545+
},
5546+
"properties": {
5547+
"$ref": "#/definitions/DeploymentPropertiesExtended",
5548+
"description": "The template deployment properties."
55285549
}
55295550
},
5530-
"description": "The template deployment validation detected failures."
5551+
"description": "Information from validate template deployment response."
55315552
},
55325553
"DeploymentExtended": {
55335554
"properties": {

specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentValidateOnManagementGroup.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@
7575
"headers": {
7676
"Location": "/providers/Microsoft.Resources/operationResults/XXXXXXXXXXXXXXX?api-version=2024-11-01"
7777
}
78+
},
79+
"400": {
80+
"headers": {
81+
"x-ms-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0",
82+
"x-ms-correlation-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0"
83+
},
84+
"body": {
85+
"error": {
86+
"code": "InvalidTemplateDeployment",
87+
"message": "The template deployment 'my-deployment' is not valid according to the validation procedure. The tracking id is 'dccf336d-c3ee-4057-a902-9efc0e023cd0'. See inner errors for details.",
88+
"details": [
89+
{
90+
"code": "PreflightValidationCheckFailed",
91+
"message": "Preflight validation failed. Please refer to the details for the specific errors.",
92+
"details": [
93+
{
94+
"code": "AccountNameInvalid",
95+
"target": "a",
96+
"message": "a is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only."
97+
}
98+
]
99+
}
100+
]
101+
}
102+
}
78103
}
79104
}
80105
}

specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentValidateOnResourceGroup.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,31 @@
7676
"headers": {
7777
"Location": "/subscriptions/00000000-0000-0000-0000-000000000001/operationResults/XXXXXXXXXXXXXXX?api-version=2024-11-01"
7878
}
79+
},
80+
"400": {
81+
"headers": {
82+
"x-ms-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0",
83+
"x-ms-correlation-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0"
84+
},
85+
"body": {
86+
"error": {
87+
"code": "InvalidTemplateDeployment",
88+
"message": "The template deployment 'my-deployment' is not valid according to the validation procedure. The tracking id is 'dccf336d-c3ee-4057-a902-9efc0e023cd0'. See inner errors for details.",
89+
"details": [
90+
{
91+
"code": "PreflightValidationCheckFailed",
92+
"message": "Preflight validation failed. Please refer to the details for the specific errors.",
93+
"details": [
94+
{
95+
"code": "AccountNameInvalid",
96+
"target": "a",
97+
"message": "a is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only."
98+
}
99+
]
100+
}
101+
]
102+
}
103+
}
79104
}
80105
}
81106
}

specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentValidateOnScope.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@
7575
"headers": {
7676
"Location": "/subscriptions/00000000-0000-0000-0000-000000000001/operationResults/XXXXXXXXXXXXXXX?api-version=2024-11-01"
7777
}
78+
},
79+
"400": {
80+
"headers": {
81+
"x-ms-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0",
82+
"x-ms-correlation-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0"
83+
},
84+
"body": {
85+
"error": {
86+
"code": "InvalidTemplateDeployment",
87+
"message": "The template deployment 'my-deployment' is not valid according to the validation procedure. The tracking id is 'dccf336d-c3ee-4057-a902-9efc0e023cd0'. See inner errors for details.",
88+
"details": [
89+
{
90+
"code": "PreflightValidationCheckFailed",
91+
"message": "Preflight validation failed. Please refer to the details for the specific errors.",
92+
"details": [
93+
{
94+
"code": "AccountNameInvalid",
95+
"target": "a",
96+
"message": "a is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only."
97+
}
98+
]
99+
}
100+
]
101+
}
102+
}
78103
}
79104
}
80105
}

specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentValidateOnSubscription.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@
7575
"headers": {
7676
"Location": "/subscriptions/00000000-0000-0000-0000-000000000001/operationResults/XXXXXXXXXXXXXXX?api-version=2024-11-01"
7777
}
78+
},
79+
"400": {
80+
"headers": {
81+
"x-ms-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0",
82+
"x-ms-correlation-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0"
83+
},
84+
"body": {
85+
"error": {
86+
"code": "InvalidTemplateDeployment",
87+
"message": "The template deployment 'my-deployment' is not valid according to the validation procedure. The tracking id is 'dccf336d-c3ee-4057-a902-9efc0e023cd0'. See inner errors for details.",
88+
"details": [
89+
{
90+
"code": "PreflightValidationCheckFailed",
91+
"message": "Preflight validation failed. Please refer to the details for the specific errors.",
92+
"details": [
93+
{
94+
"code": "AccountNameInvalid",
95+
"target": "a",
96+
"message": "a is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only."
97+
}
98+
]
99+
}
100+
]
101+
}
102+
}
78103
}
79104
}
80105
}

specification/resources/resource-manager/Microsoft.Resources/stable/2024-11-01/examples/PostDeploymentValidateOnTenant.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,31 @@
7474
"headers": {
7575
"Location": "/providers/Microsoft.Resources/operationResults/XXXXXXXXXXXXXXX?api-version=2024-11-01"
7676
}
77+
},
78+
"400": {
79+
"headers": {
80+
"x-ms-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0",
81+
"x-ms-correlation-request-id": "dccf336d-c3ee-4057-a902-9efc0e023cd0"
82+
},
83+
"body": {
84+
"error": {
85+
"code": "InvalidTemplateDeployment",
86+
"message": "The template deployment 'my-deployment' is not valid according to the validation procedure. The tracking id is 'dccf336d-c3ee-4057-a902-9efc0e023cd0'. See inner errors for details.",
87+
"details": [
88+
{
89+
"code": "PreflightValidationCheckFailed",
90+
"message": "Preflight validation failed. Please refer to the details for the specific errors.",
91+
"details": [
92+
{
93+
"code": "AccountNameInvalid",
94+
"target": "a",
95+
"message": "a is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only."
96+
}
97+
]
98+
}
99+
]
100+
}
101+
}
77102
}
78103
}
79104
}

0 commit comments

Comments
 (0)