Skip to content

Commit 26ad748

Browse files
authored
app_service / web - deprecate Visual Studio versions for remote_debugging_version (#28770)
* deprecate VS versions * update 5.0 upgrade guide * fix minor inconsistency in description
1 parent 9613c5f commit 26ad748

18 files changed

+160
-42
lines changed

internal/services/appservice/helpers/function_app_schema.go

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/hashicorp/go-azure-helpers/lang/pointer"
1212
"github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-12-01/webapps"
1313
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
14+
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
1415
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
1516
apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate"
1617
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
@@ -64,7 +65,7 @@ type SiteConfigLinuxFunctionApp struct {
6465
}
6566

6667
func SiteConfigSchemaLinuxFunctionApp() *pluginsdk.Schema {
67-
return &pluginsdk.Schema{
68+
s := &pluginsdk.Schema{
6869
Type: pluginsdk.TypeList,
6970
Required: true,
7071
MaxItems: 1,
@@ -233,11 +234,9 @@ func SiteConfigSchemaLinuxFunctionApp() *pluginsdk.Schema {
233234
Optional: true,
234235
Computed: true,
235236
ValidateFunc: validation.StringInSlice([]string{
236-
"VS2017",
237-
"VS2019",
238237
"VS2022",
239238
}, false),
240-
Description: "The Remote Debugging Version. Possible values include `VS2017`, `VS2019`, and `VS2022``",
239+
Description: "The Remote Debugging Version. Currently only `VS2022` is supported.",
241240
},
242241

243242
"runtime_scale_monitoring_enabled": {
@@ -336,6 +335,16 @@ func SiteConfigSchemaLinuxFunctionApp() *pluginsdk.Schema {
336335
},
337336
},
338337
}
338+
339+
if !features.FivePointOh() {
340+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
341+
"VS2017",
342+
"VS2019",
343+
"VS2022",
344+
}, false)
345+
}
346+
347+
return s
339348
}
340349

341350
func SiteConfigSchemaLinuxFunctionAppComputed() *pluginsdk.Schema {
@@ -568,7 +577,7 @@ type SiteConfigWindowsFunctionApp struct {
568577
}
569578

570579
func SiteConfigSchemaWindowsFunctionApp() *pluginsdk.Schema {
571-
return &pluginsdk.Schema{
580+
s := &pluginsdk.Schema{
572581
Type: pluginsdk.TypeList,
573582
Required: true,
574583
MaxItems: 1,
@@ -720,11 +729,9 @@ func SiteConfigSchemaWindowsFunctionApp() *pluginsdk.Schema {
720729
Optional: true,
721730
Computed: true,
722731
ValidateFunc: validation.StringInSlice([]string{
723-
"VS2017",
724-
"VS2019",
725732
"VS2022",
726733
}, false),
727-
Description: "The Remote Debugging Version. Possible values include `VS2017`, `VS2019`, and `VS2022`",
734+
Description: "The Remote Debugging Version. Currently only `VS2022` is supported.",
728735
},
729736

730737
"runtime_scale_monitoring_enabled": {
@@ -823,6 +830,16 @@ func SiteConfigSchemaWindowsFunctionApp() *pluginsdk.Schema {
823830
},
824831
},
825832
}
833+
834+
if !features.FivePointOh() {
835+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
836+
"VS2017",
837+
"VS2019",
838+
"VS2022",
839+
}, false)
840+
}
841+
842+
return s
826843
}
827844

828845
func SiteConfigSchemaWindowsFunctionAppComputed() *pluginsdk.Schema {

internal/services/appservice/helpers/function_app_slot_schema.go

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/hashicorp/go-azure-helpers/lang/pointer"
1212
"github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-12-01/webapps"
13+
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
1314
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
1415
apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate"
1516
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
@@ -57,7 +58,7 @@ type SiteConfigWindowsFunctionAppSlot struct {
5758
}
5859

5960
func SiteConfigSchemaWindowsFunctionAppSlot() *pluginsdk.Schema {
60-
return &pluginsdk.Schema{
61+
s := &pluginsdk.Schema{
6162
Type: pluginsdk.TypeList,
6263
Required: true,
6364
MaxItems: 1,
@@ -218,11 +219,9 @@ func SiteConfigSchemaWindowsFunctionAppSlot() *pluginsdk.Schema {
218219
Optional: true,
219220
Computed: true,
220221
ValidateFunc: validation.StringInSlice([]string{
221-
"VS2017",
222-
"VS2019",
223222
"VS2022",
224223
}, false),
225-
Description: "The Remote Debugging Version. Possible values include `VS2017`, `VS2019`, and `VS2022`",
224+
Description: "The Remote Debugging Version. Currently only `VS2022` is supported.",
226225
},
227226

228227
"runtime_scale_monitoring_enabled": {
@@ -324,6 +323,16 @@ func SiteConfigSchemaWindowsFunctionAppSlot() *pluginsdk.Schema {
324323
},
325324
},
326325
}
326+
327+
if !features.FivePointOh() {
328+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
329+
"VS2017",
330+
"VS2019",
331+
"VS2022",
332+
}, false)
333+
}
334+
335+
return s
327336
}
328337

329338
type SiteConfigLinuxFunctionAppSlot struct {
@@ -369,7 +378,7 @@ type SiteConfigLinuxFunctionAppSlot struct {
369378
}
370379

371380
func SiteConfigSchemaLinuxFunctionAppSlot() *pluginsdk.Schema {
372-
return &pluginsdk.Schema{
381+
s := &pluginsdk.Schema{
373382
Type: pluginsdk.TypeList,
374383
Required: true,
375384
MaxItems: 1,
@@ -544,11 +553,9 @@ func SiteConfigSchemaLinuxFunctionAppSlot() *pluginsdk.Schema {
544553
Optional: true,
545554
Computed: true,
546555
ValidateFunc: validation.StringInSlice([]string{
547-
"VS2017",
548-
"VS2019",
549556
"VS2022",
550557
}, false),
551-
Description: "The Remote Debugging Version. Possible values include `VS2017`, `VS2019`, and `VS2022`",
558+
Description: "The Remote Debugging Version. Currently only `VS2022` is supported.",
552559
},
553560

554561
"runtime_scale_monitoring_enabled": {
@@ -650,6 +657,16 @@ func SiteConfigSchemaLinuxFunctionAppSlot() *pluginsdk.Schema {
650657
},
651658
},
652659
}
660+
661+
if !features.FivePointOh() {
662+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
663+
"VS2017",
664+
"VS2019",
665+
"VS2022",
666+
}, false)
667+
}
668+
669+
return s
653670
}
654671

655672
func ExpandSiteConfigWindowsFunctionAppSlot(siteConfig []SiteConfigWindowsFunctionAppSlot, existing *webapps.SiteConfig, metadata sdk.ResourceMetaData, version string, storageString string, storageUsesMSI bool) (*webapps.SiteConfig, error) {

internal/services/appservice/helpers/linux_web_app_schema.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/hashicorp/go-azure-helpers/lang/pointer"
1212
"github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-12-01/webapps"
13+
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
1314
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
1415
"github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate"
1516
appServiceValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/validate"
@@ -55,7 +56,7 @@ type SiteConfigLinux struct {
5556
}
5657

5758
func SiteConfigSchemaLinux() *pluginsdk.Schema {
58-
return &pluginsdk.Schema{
59+
s := &pluginsdk.Schema{
5960
Type: pluginsdk.TypeList,
6061
Required: true,
6162
MaxItems: 1,
@@ -180,8 +181,6 @@ func SiteConfigSchemaLinux() *pluginsdk.Schema {
180181
Optional: true,
181182
Computed: true,
182183
ValidateFunc: validation.StringInSlice([]string{
183-
"VS2017",
184-
"VS2019",
185184
"VS2022",
186185
}, false),
187186
},
@@ -270,6 +269,16 @@ func SiteConfigSchemaLinux() *pluginsdk.Schema {
270269
},
271270
},
272271
}
272+
273+
if !features.FivePointOh() {
274+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
275+
"VS2017",
276+
"VS2019",
277+
"VS2022",
278+
}, false)
279+
}
280+
281+
return s
273282
}
274283

275284
func SiteConfigSchemaLinuxComputed() *pluginsdk.Schema {

internal/services/appservice/helpers/web_app_slot_schema.go

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/hashicorp/go-azure-helpers/lang/pointer"
1212
"github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-12-01/webapps"
13+
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
1314
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
1415
apimValidate "github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate"
1516
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
@@ -55,7 +56,7 @@ type SiteConfigLinuxWebAppSlot struct {
5556
}
5657

5758
func SiteConfigSchemaLinuxWebAppSlot() *pluginsdk.Schema {
58-
return &pluginsdk.Schema{
59+
s := &pluginsdk.Schema{
5960
Type: pluginsdk.TypeList,
6061
Required: true,
6162
MaxItems: 1,
@@ -171,8 +172,6 @@ func SiteConfigSchemaLinuxWebAppSlot() *pluginsdk.Schema {
171172
Optional: true,
172173
Computed: true,
173174
ValidateFunc: validation.StringInSlice([]string{
174-
"VS2017",
175-
"VS2019",
176175
"VS2022",
177176
}, false),
178177
},
@@ -263,6 +262,16 @@ func SiteConfigSchemaLinuxWebAppSlot() *pluginsdk.Schema {
263262
},
264263
},
265264
}
265+
266+
if !features.FivePointOh() {
267+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
268+
"VS2017",
269+
"VS2019",
270+
"VS2022",
271+
}, false)
272+
}
273+
274+
return s
266275
}
267276

268277
type SiteConfigWindowsWebAppSlot struct {
@@ -305,7 +314,7 @@ type SiteConfigWindowsWebAppSlot struct {
305314
}
306315

307316
func SiteConfigSchemaWindowsWebAppSlot() *pluginsdk.Schema {
308-
return &pluginsdk.Schema{
317+
s := &pluginsdk.Schema{
309318
Type: pluginsdk.TypeList,
310319
Required: true,
311320
MaxItems: 1,
@@ -426,8 +435,6 @@ func SiteConfigSchemaWindowsWebAppSlot() *pluginsdk.Schema {
426435
Optional: true,
427436
Computed: true,
428437
ValidateFunc: validation.StringInSlice([]string{
429-
"VS2017",
430-
"VS2019",
431438
"VS2022",
432439
}, false),
433440
},
@@ -516,6 +523,16 @@ func SiteConfigSchemaWindowsWebAppSlot() *pluginsdk.Schema {
516523
},
517524
},
518525
}
526+
527+
if !features.FivePointOh() {
528+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
529+
"VS2017",
530+
"VS2019",
531+
"VS2022",
532+
}, false)
533+
}
534+
535+
return s
519536
}
520537

521538
func (s *SiteConfigLinuxWebAppSlot) ExpandForCreate(appSettings map[string]string) (*webapps.SiteConfig, error) {

internal/services/appservice/helpers/windows_web_app_schema.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/hashicorp/go-azure-helpers/lang/pointer"
1212
"github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-12-01/webapps"
13+
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
1314
"github.com/hashicorp/terraform-provider-azurerm/internal/sdk"
1415
"github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/parse"
1516
"github.com/hashicorp/terraform-provider-azurerm/internal/services/apimanagement/validate"
@@ -59,7 +60,7 @@ type SiteConfigWindows struct {
5960
}
6061

6162
func SiteConfigSchemaWindows() *pluginsdk.Schema {
62-
return &pluginsdk.Schema{
63+
s := &pluginsdk.Schema{
6364
Type: pluginsdk.TypeList,
6465
Required: true,
6566
MaxItems: 1,
@@ -184,8 +185,6 @@ func SiteConfigSchemaWindows() *pluginsdk.Schema {
184185
Optional: true,
185186
Computed: true,
186187
ValidateFunc: validation.StringInSlice([]string{
187-
"VS2017",
188-
"VS2019",
189188
"VS2022",
190189
}, false),
191190
},
@@ -283,6 +282,16 @@ func SiteConfigSchemaWindows() *pluginsdk.Schema {
283282
},
284283
},
285284
}
285+
286+
if !features.FivePointOh() {
287+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
288+
"VS2017",
289+
"VS2019",
290+
"VS2022",
291+
}, false)
292+
}
293+
294+
return s
286295
}
287296

288297
func SiteConfigSchemaWindowsComputed() *pluginsdk.Schema {

internal/services/web/app_service.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
"github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" // nolint: staticcheck
1313
"github.com/hashicorp/go-azure-helpers/resourcemanager/identity"
14+
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
1415
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
1516
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
1617
"github.com/hashicorp/terraform-provider-azurerm/utils"
@@ -229,7 +230,7 @@ func schemaAppServiceAuthSettings() *pluginsdk.Schema {
229230
}
230231

231232
func schemaAppServiceSiteConfig() *pluginsdk.Schema {
232-
return &pluginsdk.Schema{
233+
s := &pluginsdk.Schema{
233234
Type: pluginsdk.TypeList,
234235
Optional: true,
235236
Computed: true,
@@ -352,8 +353,6 @@ func schemaAppServiceSiteConfig() *pluginsdk.Schema {
352353
Optional: true,
353354
Computed: true,
354355
ValidateFunc: validation.StringInSlice([]string{
355-
"VS2017",
356-
"VS2019",
357356
"VS2022",
358357
}, false),
359358
},
@@ -463,6 +462,16 @@ func schemaAppServiceSiteConfig() *pluginsdk.Schema {
463462
},
464463
},
465464
}
465+
466+
if !features.FivePointOh() {
467+
s.Elem.(*pluginsdk.Resource).Schema["remote_debugging_version"].ValidateFunc = validation.StringInSlice([]string{
468+
"VS2017",
469+
"VS2019",
470+
"VS2022",
471+
}, false)
472+
}
473+
474+
return s
466475
}
467476

468477
func schemaAppServiceLogsConfig() *pluginsdk.Schema {

0 commit comments

Comments
 (0)