From 82c06b5bee78f86b414bd3ec159612205d9b7664 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Tue, 18 Feb 2025 14:00:34 +0800 Subject: [PATCH 1/2] Add example for Microsoft.AppPlatform/Spring/buildServices --- .../{ => basic}/main.tf | 7 +++ .../main.tf | 58 +++++++++++++++++++ 2 files changed, 65 insertions(+) rename examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/{ => basic}/main.tf (84%) create mode 100644 examples/Microsoft.Web_staticSites_config@2022-03-01/main.tf diff --git a/examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/main.tf b/examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/basic/main.tf similarity index 84% rename from examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/main.tf rename to examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/basic/main.tf index 5d5c3ca76..6668e5972 100644 --- a/examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/main.tf +++ b/examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/basic/main.tf @@ -60,3 +60,10 @@ resource "azapi_resource_action" "buildService" { response_export_values = ["*"] } +data "azapi_resource" "buildService" { + type = "Microsoft.AppPlatform/Spring/buildServices@2023-05-01-preview" + name = "default" + parent_id = azapi_resource.Spring.id + + depends_on = [azapi_resource_action.buildService] +} diff --git a/examples/Microsoft.Web_staticSites_config@2022-03-01/main.tf b/examples/Microsoft.Web_staticSites_config@2022-03-01/main.tf new file mode 100644 index 000000000..adb72f271 --- /dev/null +++ b/examples/Microsoft.Web_staticSites_config@2022-03-01/main.tf @@ -0,0 +1,58 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "resource_name" { + type = string + default = "acctest0001" +} + +variable "location" { + type = string + default = "westeurope" +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "staticSite" { + type = "Microsoft.Web/staticSites@2021-02-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + } + sku = { + name = "Free" + tier = "Free" + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "config" { + type = "Microsoft.Web/staticSites/config@2022-03-01" + name = "appsettings" + parent_id = azapi_resource.staticSite.id + + body = { + properties = { + password = "Password123!@" + secretState = "Password" + applicableEnvironmentsMode = "AllEnvironments" + } + } +} From fa4d711ca6eac9a416925110ae5614a52b53f950 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Tue, 18 Feb 2025 14:01:43 +0800 Subject: [PATCH 2/2] update pr --- .../main.tf | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 examples/Microsoft.Web_staticSites_config@2022-03-01/main.tf diff --git a/examples/Microsoft.Web_staticSites_config@2022-03-01/main.tf b/examples/Microsoft.Web_staticSites_config@2022-03-01/main.tf deleted file mode 100644 index adb72f271..000000000 --- a/examples/Microsoft.Web_staticSites_config@2022-03-01/main.tf +++ /dev/null @@ -1,58 +0,0 @@ -terraform { - required_providers { - azapi = { - source = "Azure/azapi" - } - } -} - -provider "azapi" { - skip_provider_registration = false -} - -variable "resource_name" { - type = string - default = "acctest0001" -} - -variable "location" { - type = string - default = "westeurope" -} - -resource "azapi_resource" "resourceGroup" { - type = "Microsoft.Resources/resourceGroups@2020-06-01" - name = var.resource_name - location = var.location -} - -resource "azapi_resource" "staticSite" { - type = "Microsoft.Web/staticSites@2021-02-01" - parent_id = azapi_resource.resourceGroup.id - name = var.resource_name - location = var.location - body = { - properties = { - } - sku = { - name = "Free" - tier = "Free" - } - } - schema_validation_enabled = false - response_export_values = ["*"] -} - -resource "azapi_resource" "config" { - type = "Microsoft.Web/staticSites/config@2022-03-01" - name = "appsettings" - parent_id = azapi_resource.staticSite.id - - body = { - properties = { - password = "Password123!@" - secretState = "Password" - applicableEnvironmentsMode = "AllEnvironments" - } - } -}