From 602363b37c7827d0a2326ac16b57a2d9ed455d84 Mon Sep 17 00:00:00 2001 From: Heng Lu <79895375+ms-henglu@users.noreply.github.com> Date: Wed, 16 Oct 2024 11:22:24 +0800 Subject: [PATCH] skip resource group's latest api-version as it's unavailable (#640) --- internal/azure/loader.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/azure/loader.go b/internal/azure/loader.go index f77b9f487..7b046f3a0 100644 --- a/internal/azure/loader.go +++ b/internal/azure/loader.go @@ -9,6 +9,7 @@ import ( "strings" "sync" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/terraform-provider-azapi/internal/azure/types" ) @@ -50,6 +51,18 @@ func GetApiVersions(resourceType string) []string { } } } + + // TODO: remove the below codes when Resources RP 2024-07-01 is available + if strings.EqualFold(resourceType, arm.ResourceGroupResourceType.String()) { + temp := make([]string, 0) + for _, v := range res { + if v != "2024-07-01" { + temp = append(temp, v) + } + } + res = temp + } + sort.Strings(res) return res }