From d6903d857ce220d05f9ba094cfae705b4c5bfc80 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 12 Feb 2025 14:41:08 +0800 Subject: [PATCH 1/3] Add example for Microsoft.Web_connections@2016-06-01 --- .../main.tf | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 examples/Microsoft.Web_connections@2016-06-01/main.tf diff --git a/examples/Microsoft.Web_connections@2016-06-01/main.tf b/examples/Microsoft.Web_connections@2016-06-01/main.tf new file mode 100644 index 000000000..a19e84b2b --- /dev/null +++ b/examples/Microsoft.Web_connections@2016-06-01/main.tf @@ -0,0 +1,103 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +provider "azurerm" { + features { + + } +} + +variable "resource_name" { + type = string + default = "acctest0001" +} + +variable "location" { + type = string + default = "eastus" +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "workflows" { + type = "Microsoft.Logic/workflows@2019-05-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + identity = { + type = "None" + userAssignedIdentities = null + } + properties = { + definition = { + "$schema" = "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#" + contentVersion = "1.0.0.0" + } + state = "Enabled" + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "namespaces" { + type = "Microsoft.ServiceBus/namespaces@2022-10-01-preview" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + identity = { + type = "None" + userAssignedIdentities = null + } + properties = { + disableLocalAuth = false + minimumTlsVersion = "1.2" + premiumMessagingPartitions = 0 + publicNetworkAccess = "Enabled" + } + sku = { + capacity = 0 + name = "Basic" + tier = "Basic" + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +data "azurerm_managed_api" "test" { + name = "servicebus" + location = var.location +} + +resource "azapi_resource" "connections" { + type = "Microsoft.Web/connections@2016-06-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + api = { + id = data.azurerm_managed_api.test.id + } + displayName = "Service Bus" + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} From c793f6c28a9bf5b54337698386813cbcb7854164 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Mon, 17 Feb 2025 11:44:47 +0800 Subject: [PATCH 2/3] update pr --- examples/Microsoft.Web_connections@2016-06-01/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Microsoft.Web_connections@2016-06-01/main.tf b/examples/Microsoft.Web_connections@2016-06-01/main.tf index a19e84b2b..c1e54e3b8 100644 --- a/examples/Microsoft.Web_connections@2016-06-01/main.tf +++ b/examples/Microsoft.Web_connections@2016-06-01/main.tf @@ -85,7 +85,7 @@ data "azurerm_managed_api" "test" { location = var.location } -resource "azapi_resource" "connections" { +resource "azapi_resource" "connection" { type = "Microsoft.Web/connections@2016-06-01" parent_id = azapi_resource.resourceGroup.id name = var.resource_name From f288de9fb622b451d75e0aa4a649e2f428e9116a Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Tue, 18 Feb 2025 11:33:32 +0800 Subject: [PATCH 3/3] update pr --- examples/Microsoft.Web_connections@2016-06-01/main.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/Microsoft.Web_connections@2016-06-01/main.tf b/examples/Microsoft.Web_connections@2016-06-01/main.tf index c1e54e3b8..d456852ce 100644 --- a/examples/Microsoft.Web_connections@2016-06-01/main.tf +++ b/examples/Microsoft.Web_connections@2016-06-01/main.tf @@ -12,7 +12,6 @@ provider "azapi" { provider "azurerm" { features { - } } @@ -83,6 +82,8 @@ resource "azapi_resource" "namespaces" { data "azurerm_managed_api" "test" { name = "servicebus" location = var.location + + depends_on = [azapi_resource.workflows, azapi_resource.namespaces] } resource "azapi_resource" "connection" {