From 480f9803dad098c4f2ccf1cb8d22be13b7d68853 Mon Sep 17 00:00:00 2001 From: Nacho Alonso Portillo Date: Fri, 16 Oct 2026 16:09:52 +0200 Subject: [PATCH 1/7] Update HorizonDB 2026-10-01-preview samples Replace obsolete HorizonDB examples with the complete merged PUT/PATCH scenario set and correct API-version sample filtering. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../remarks/microsoft.horizondb/remarks.json | 686 ++++++++++++++++-- .../create-microsoft-entra-disabled.bicep | 9 + .../create-microsoft-entra-disabled.json | 23 + .../create-microsoft-entra-disabled.tf | 35 + .../create-microsoft-entra-enabled.bicep | 9 + .../create-microsoft-entra-enabled.json | 23 + .../create-microsoft-entra-enabled.tf | 35 + .../authentications/enable-password.bicep | 14 + .../authentications/enable-password.json | 31 + .../enable-password.tf} | 35 +- .../clusters/changedatacapture/enable.bicep | 10 + .../clusters/changedatacapture/enable.json | 24 + .../clusters/changedatacapture/enable.tf | 36 + .../clusters/changedatacapture/update.bicep | 9 + .../clusters/changedatacapture/update.json | 23 + .../clusters/changedatacapture/update.tf | 35 + .../disable.bicep | 11 + .../disable.json | 30 + .../disable.tf | 41 ++ .../enroll-database.bicep | 14 + .../enroll-database.json | 33 + .../enroll-database.tf | 44 ++ .../create-fabric.bicep | 16 + .../create-fabric.json | 35 + .../create-fabric.tf | 46 ++ .../disable.bicep | 11 + .../disable.json | 30 + .../changedatacapturedestinations/disable.tf | 41 ++ .../identityassignments/create.bicep | 13 + .../identityassignments/create.json | 37 + .../identityassignments/create.tf | 47 ++ .../connect-parameter-group-to-cluster.bicep | 18 - .../connect-parameter-group-to-cluster.json | 46 -- .../connect-parameter-group-to-cluster.tf | 55 -- .../clusters/create-minimum-defaults.bicep | 13 + .../clusters/create-minimum-defaults.json | 27 + .../clusters/create-minimum-defaults.tf | 39 + .../create-with-data-encryption.bicep | 26 + .../clusters/create-with-data-encryption.json | 39 + .../clusters/create-with-data-encryption.tf | 52 ++ .../samples/clusters/create.bicep | 56 +- .../samples/clusters/create.json | 97 +-- .../samples/clusters/create.tf | 96 +-- .../logcaptureconfigurations/disable.bicep | 11 + .../logcaptureconfigurations/disable.json | 30 + .../logcaptureconfigurations/disable.tf | 41 ++ .../microsoftentraadministrators/create.bicep | 13 + .../microsoftentraadministrators/create.json | 32 + .../microsoftentraadministrators/create.tf | 43 ++ .../samples/clusters/pools/create.bicep | 27 + .../samples/clusters/pools/create.json | 46 ++ .../samples/clusters/pools/create.tf | 57 ++ .../clusters/pools/firewallrules/create.bicep | 42 +- .../clusters/pools/firewallrules/create.json | 89 +-- .../clusters/pools/firewallrules/create.tf | 104 +-- .../add-no-specific-availability-zone.bicep | 17 - .../add-no-specific-availability-zone.json | 50 -- .../add-no-specific-availability-zone.tf | 170 ----- .../add-specific-availability-zone.bicep | 14 - .../add-specific-availability-zone.json | 42 -- .../add-specific-availability-zone.tf | 177 ----- .../clusters/pools/update-compute.bicep | 16 + .../clusters/pools/update-compute.json | 35 + .../samples/clusters/pools/update-compute.tf | 46 ++ .../pools/update-high-availability.bicep | 13 + .../pools/update-high-availability.json | 32 + .../pools/update-high-availability.tf | 43 ++ .../pools/use-default-parameter-group.bicep | 14 + .../pools/use-default-parameter-group.json | 33 + .../pools/use-default-parameter-group.tf | 44 ++ .../use-parameter-group-after-reboot.bicep | 14 + .../use-parameter-group-after-reboot.json | 33 + .../pools/use-parameter-group-after-reboot.tf | 44 ++ .../use-parameter-group-immediately.bicep | 14 + .../use-parameter-group-immediately.json | 33 + .../pools/use-parameter-group-immediately.tf | 44 ++ .../clusters/restore-cross-region.bicep | 20 + .../clusters/restore-cross-region.json | 34 + .../samples/clusters/restore-cross-region.tf | 46 ++ .../clusters/restore-point-in-time.bicep | 19 + .../clusters/restore-point-in-time.json | 33 + .../samples/clusters/restore-point-in-time.tf | 45 ++ .../clusters/rotate-data-encryption-key.bicep | 11 + .../clusters/rotate-data-encryption-key.json | 25 + .../clusters/rotate-data-encryption-key.tf | 37 + .../clusters/scale-cluster-vertically.bicep | 16 - .../clusters/scale-cluster-vertically.json | 45 -- .../clusters/scale-cluster-vertically.tf | 54 -- .../update-administrator-login-password.bicep | 17 - .../update-administrator-login-password.json | 44 -- .../samples/clusters/update.bicep | 18 + .../samples/clusters/update.json | 32 + .../samples/clusters/update.tf | 44 ++ .../samples/parametergroups/create.bicep | 68 +- .../samples/parametergroups/create.json | 98 +-- .../samples/parametergroups/create.tf | 99 +-- .../samples/parametergroups/update.bicep | 35 + .../samples/parametergroups/update.json | 49 ++ .../samples/parametergroups/update.tf | 61 ++ .../RemarksLoaderTests.cs | 52 ++ .../Config/RemarksLoader.cs | 4 +- 101 files changed, 3114 insertions(+), 1405 deletions(-) create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.json rename settings/remarks/microsoft.horizondb/samples/clusters/{update-administrator-login-password.tf => authentications/enable-password.tf} (52%) create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.tf delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.bicep delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.json delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/create.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/create.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/create.tf delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.bicep delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.json delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.tf delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.bicep delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.json delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.tf delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.bicep delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.json delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.tf delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.bicep delete mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/update.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/update.json create mode 100644 settings/remarks/microsoft.horizondb/samples/clusters/update.tf create mode 100644 settings/remarks/microsoft.horizondb/samples/parametergroups/update.bicep create mode 100644 settings/remarks/microsoft.horizondb/samples/parametergroups/update.json create mode 100644 settings/remarks/microsoft.horizondb/samples/parametergroups/update.tf create mode 100644 src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs diff --git a/settings/remarks/microsoft.horizondb/remarks.json b/settings/remarks/microsoft.horizondb/remarks.json index 41624cce..7531148d 100644 --- a/settings/remarks/microsoft.horizondb/remarks.json +++ b/settings/remarks/microsoft.horizondb/remarks.json @@ -2,128 +2,680 @@ "$schema": "../../schemas/remarks.schema.json", "TerraformSamples": [ { - "ResourceType": "Microsoft.HorizonDB/clusters", + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCapture", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapture/enable.tf", + "Description": "Enable the cluster change data capture capability." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCapture", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapture/update.tf", + "Description": "Update the cluster change data capture capability." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacaptureconfigurations/enroll-database.tf", + "Description": "Enroll a database for Microsoft Fabric Mirroring." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacaptureconfigurations/disable.tf", + "Description": "Disable a Microsoft Fabric Mirroring configuration." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/create-fabric.tf", + "Description": "Create a Microsoft Fabric change data capture destination." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/disable.tf", + "Description": "Disable a Microsoft Fabric change data capture destination." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, "Path": "samples/clusters/create.tf", - "Description": "Create a cluster." + "Description": "Create or replace a HorizonDB cluster." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/update-administrator-login-password.tf", - "Description": "Update a cluster's administrator login password." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/restore-cross-region.tf", + "Description": "Restore a HorizonDB cluster across Azure regions from the latest available backup." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/scale-cluster-vertically.tf", - "Description": "Scale a cluster vertically." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/create-minimum-defaults.tf", + "Description": "Create a PostgreSQL 18 HorizonDB cluster with minimum configuration and service defaults." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/connect-parameter-group-to-cluster.tf", - "Description": "Connect a parameter group to a cluster." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/restore-point-in-time.tf", + "Description": "Restore a HorizonDB cluster to a point in time." }, { - "ResourceType": "Microsoft.HorizonDB/parameterGroups", - "Path": "samples/parametergroups/create.tf", - "Description": "Create a parameter group." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/create-with-data-encryption.tf", + "Description": "Create a HorizonDB cluster with customer-managed key data encryption." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/update.tf", + "Description": "Update a HorizonDB cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/rotate-data-encryption-key.tf", + "Description": "Rotate the customer-managed key used by a HorizonDB cluster." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/firewallRules", + "ResourceType": "Microsoft.HorizonDb/clusters/pools/firewallRules", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, "Path": "samples/clusters/pools/firewallrules/create.tf", - "Description": "Create a firewall rule on a cluster." + "Description": "Create or replace a firewall rule on a HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations/identityAssignments", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/identityassignments/create.tf", + "Description": "Create a change data capture identity assignment for a UAMI attached to the parent cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/logCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/logcaptureconfigurations/disable.tf", + "Description": "Disable PostgreSQL server log capture." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/microsoftEntraAdministrators", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/microsoftentraadministrators/create.tf", + "Description": "Create or replace a Microsoft Entra administrator for a HorizonDB cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/create-microsoft-entra-disabled.tf", + "Description": "Disable Microsoft Entra authentication declaratively." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/create-microsoft-entra-enabled.tf", + "Description": "Enable Microsoft Entra authentication declaratively." + }, + { + "ResourceType": "Microsoft.HorizonDb/parameterGroups", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/parametergroups/create.tf", + "Description": "Create or replace a HorizonDB parameter group for a PostgreSQL version." + }, + { + "ResourceType": "Microsoft.HorizonDb/parameterGroups", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/parametergroups/update.tf", + "Description": "Update a HorizonDB parameter group." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/replicas", - "Path": "samples/clusters/pools/replicas/add-no-specific-availability-zone.tf", - "Description": "Add a replica without a specific availability zone to a pool." + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/enable-password.tf", + "Description": "Enable password authentication and set the administrator login and password during initial setup." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/replicas", - "Path": "samples/clusters/pools/replicas/add-specific-availability-zone.tf", - "Description": "Add a replica in a specific availability zone to a pool." + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/create.tf", + "Description": "Create a minimum provisioned HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/update-compute.tf", + "Description": "Update a single HorizonDB pool compute property." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/update-high-availability.tf", + "Description": "Require zone-redundant placement for a HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-default-parameter-group.tf", + "Description": "Switch a HorizonDB pool back to its corresponding default parameter group." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-parameter-group-immediately.tf", + "Description": "Associate a HorizonDB pool with a parameter group immediately." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-parameter-group-after-reboot.tf", + "Description": "Associate a HorizonDB pool with a parameter group pending reboot." } ], "BicepSamples": [ { - "ResourceType": "Microsoft.HorizonDB/clusters", + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCapture", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapture/enable.bicep", + "Description": "Enable the cluster change data capture capability." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCapture", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapture/update.bicep", + "Description": "Update the cluster change data capture capability." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacaptureconfigurations/enroll-database.bicep", + "Description": "Enroll a database for Microsoft Fabric Mirroring." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacaptureconfigurations/disable.bicep", + "Description": "Disable a Microsoft Fabric Mirroring configuration." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/create-fabric.bicep", + "Description": "Create a Microsoft Fabric change data capture destination." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/disable.bicep", + "Description": "Disable a Microsoft Fabric change data capture destination." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, "Path": "samples/clusters/create.bicep", - "Description": "Create a cluster." + "Description": "Create or replace a HorizonDB cluster." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/update-administrator-login-password.bicep", - "Description": "Update a cluster's administrator login password." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/restore-cross-region.bicep", + "Description": "Restore a HorizonDB cluster across Azure regions from the latest available backup." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/scale-cluster-vertically.bicep", - "Description": "Scale a cluster vertically." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/create-minimum-defaults.bicep", + "Description": "Create a PostgreSQL 18 HorizonDB cluster with minimum configuration and service defaults." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/connect-parameter-group-to-cluster.bicep", - "Description": "Connect a parameter group to a cluster." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/restore-point-in-time.bicep", + "Description": "Restore a HorizonDB cluster to a point in time." }, { - "ResourceType": "Microsoft.HorizonDB/parameterGroups", - "Path": "samples/parametergroups/create.bicep", - "Description": "Create a parameter group." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/create-with-data-encryption.bicep", + "Description": "Create a HorizonDB cluster with customer-managed key data encryption." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/firewallRules", + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/update.bicep", + "Description": "Update a HorizonDB cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/rotate-data-encryption-key.bicep", + "Description": "Rotate the customer-managed key used by a HorizonDB cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools/firewallRules", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, "Path": "samples/clusters/pools/firewallrules/create.bicep", - "Description": "Create a firewall rule on a cluster." + "Description": "Create or replace a firewall rule on a HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations/identityAssignments", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/identityassignments/create.bicep", + "Description": "Create a change data capture identity assignment for a UAMI attached to the parent cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/logCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/logcaptureconfigurations/disable.bicep", + "Description": "Disable PostgreSQL server log capture." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/replicas", - "Path": "samples/clusters/pools/replicas/add-no-specific-availability-zone.bicep", - "Description": "Add a replica without a specific availability zone to a pool." + "ResourceType": "Microsoft.HorizonDb/clusters/microsoftEntraAdministrators", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/microsoftentraadministrators/create.bicep", + "Description": "Create or replace a Microsoft Entra administrator for a HorizonDB cluster." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/replicas", - "Path": "samples/clusters/pools/replicas/add-specific-availability-zone.bicep", - "Description": "Add a replica in a specific availability zone to a pool." + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/create-microsoft-entra-disabled.bicep", + "Description": "Disable Microsoft Entra authentication declaratively." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/create-microsoft-entra-enabled.bicep", + "Description": "Enable Microsoft Entra authentication declaratively." + }, + { + "ResourceType": "Microsoft.HorizonDb/parameterGroups", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/parametergroups/create.bicep", + "Description": "Create or replace a HorizonDB parameter group for a PostgreSQL version." + }, + { + "ResourceType": "Microsoft.HorizonDb/parameterGroups", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/parametergroups/update.bicep", + "Description": "Update a HorizonDB parameter group." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/enable-password.bicep", + "Description": "Enable password authentication and set the administrator login and password during initial setup." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/create.bicep", + "Description": "Create a minimum provisioned HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/update-compute.bicep", + "Description": "Update a single HorizonDB pool compute property." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/update-high-availability.bicep", + "Description": "Require zone-redundant placement for a HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-default-parameter-group.bicep", + "Description": "Switch a HorizonDB pool back to its corresponding default parameter group." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-parameter-group-immediately.bicep", + "Description": "Associate a HorizonDB pool with a parameter group immediately." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-parameter-group-after-reboot.bicep", + "Description": "Associate a HorizonDB pool with a parameter group pending reboot." } ], "ArmTemplateSamples": [ { - "ResourceType": "Microsoft.HorizonDB/clusters", + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCapture", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapture/enable.json", + "Description": "Enable the cluster change data capture capability." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCapture", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapture/update.json", + "Description": "Update the cluster change data capture capability." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacaptureconfigurations/enroll-database.json", + "Description": "Enroll a database for Microsoft Fabric Mirroring." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacaptureconfigurations/disable.json", + "Description": "Disable a Microsoft Fabric Mirroring configuration." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/create-fabric.json", + "Description": "Create a Microsoft Fabric change data capture destination." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/disable.json", + "Description": "Disable a Microsoft Fabric change data capture destination." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, "Path": "samples/clusters/create.json", - "Description": "Create a cluster." + "Description": "Create or replace a HorizonDB cluster." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/update-administrator-login-password.json", - "Description": "Update a cluster's administrator login password." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/restore-cross-region.json", + "Description": "Restore a HorizonDB cluster across Azure regions from the latest available backup." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/scale-cluster-vertically.json", - "Description": "Scale a cluster vertically." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/create-minimum-defaults.json", + "Description": "Create a PostgreSQL 18 HorizonDB cluster with minimum configuration and service defaults." }, { - "ResourceType": "Microsoft.HorizonDB/clusters", - "Path": "samples/clusters/connect-parameter-group-to-cluster.json", - "Description": "Connect a parameter group to a cluster." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/restore-point-in-time.json", + "Description": "Restore a HorizonDB cluster to a point in time." }, { - "ResourceType": "Microsoft.HorizonDB/parameterGroups", - "Path": "samples/parametergroups/create.json", - "Description": "Create a parameter group." + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/create-with-data-encryption.json", + "Description": "Create a HorizonDB cluster with customer-managed key data encryption." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/update.json", + "Description": "Update a HorizonDB cluster." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/firewallRules", + "ResourceType": "Microsoft.HorizonDb/clusters", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/rotate-data-encryption-key.json", + "Description": "Rotate the customer-managed key used by a HorizonDB cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools/firewallRules", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, "Path": "samples/clusters/pools/firewallrules/create.json", - "Description": "Create a firewall rule on a cluster." + "Description": "Create or replace a firewall rule on a HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations/identityAssignments", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/changedatacapturedestinations/identityassignments/create.json", + "Description": "Create a change data capture identity assignment for a UAMI attached to the parent cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/logCaptureConfigurations", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/logcaptureconfigurations/disable.json", + "Description": "Disable PostgreSQL server log capture." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/microsoftEntraAdministrators", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/microsoftentraadministrators/create.json", + "Description": "Create or replace a Microsoft Entra administrator for a HorizonDB cluster." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/create-microsoft-entra-disabled.json", + "Description": "Disable Microsoft Entra authentication declaratively." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/create-microsoft-entra-enabled.json", + "Description": "Enable Microsoft Entra authentication declaratively." + }, + { + "ResourceType": "Microsoft.HorizonDb/parameterGroups", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/parametergroups/create.json", + "Description": "Create or replace a HorizonDB parameter group for a PostgreSQL version." + }, + { + "ResourceType": "Microsoft.HorizonDb/parameterGroups", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/parametergroups/update.json", + "Description": "Update a HorizonDB parameter group." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/authentications", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/authentications/enable-password.json", + "Description": "Enable password authentication and set the administrator login and password during initial setup." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/create.json", + "Description": "Create a minimum provisioned HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/update-compute.json", + "Description": "Update a single HorizonDB pool compute property." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/update-high-availability.json", + "Description": "Require zone-redundant placement for a HorizonDB pool." + }, + { + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-default-parameter-group.json", + "Description": "Switch a HorizonDB pool back to its corresponding default parameter group." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/replicas", - "Path": "samples/clusters/pools/replicas/add-no-specific-availability-zone.json", - "Description": "Add a replica without a specific availability zone to a pool." + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-parameter-group-immediately.json", + "Description": "Associate a HorizonDB pool with a parameter group immediately." }, { - "ResourceType": "Microsoft.HorizonDB/clusters/pools/replicas", - "Path": "samples/clusters/pools/replicas/add-specific-availability-zone.json", - "Description": "Add a replica in a specific availability zone to a pool." + "ResourceType": "Microsoft.HorizonDb/clusters/pools", + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Path": "samples/clusters/pools/use-parameter-group-after-reboot.json", + "Description": "Associate a HorizonDB pool with a parameter group pending reboot." } ] -} \ No newline at end of file +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.bicep new file mode 100644 index 00000000..28abba5e --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.bicep @@ -0,0 +1,9 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/authentications@2026-10-01-preview' = { + name: '${clusterName}/microsoftEntra' + properties: { + state: 'Disabled' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.json b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.json new file mode 100644 index 00000000..fc542beb --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/authentications", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), 'microsoftEntra')]", + "properties": { + "state": "Disabled" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.tf b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.tf new file mode 100644 index 00000000..014a274b --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-disabled.tf @@ -0,0 +1,35 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "authentications" { + type = "Microsoft.HorizonDb/clusters/authentications@2026-10-01-preview" + name = "microsoftEntra" + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + state = "Disabled" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.bicep new file mode 100644 index 00000000..9a119750 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.bicep @@ -0,0 +1,9 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/authentications@2026-10-01-preview' = { + name: '${clusterName}/microsoftEntra' + properties: { + state: 'Enabled' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.json b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.json new file mode 100644 index 00000000..b27f4675 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/authentications", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), 'microsoftEntra')]", + "properties": { + "state": "Enabled" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.tf b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.tf new file mode 100644 index 00000000..344b6cc5 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/create-microsoft-entra-enabled.tf @@ -0,0 +1,35 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "authentications" { + type = "Microsoft.HorizonDb/clusters/authentications@2026-10-01-preview" + name = "microsoftEntra" + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + state = "Enabled" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.bicep new file mode 100644 index 00000000..174a9121 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.bicep @@ -0,0 +1,14 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@secure() +@description('The administrator login password') +param administratorLoginPassword string + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/authentications@2026-10-01-preview' = { + name: '${clusterName}/passwordMethod' + properties: { + state: 'Enabled' + administratorLogin: 'adminlogin1' + administratorLoginPassword: administratorLoginPassword + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.json b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.json new file mode 100644 index 00000000..a46206fa --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "administratorLoginPassword": { + "type": "secureString", + "metadata": { + "description": "The administrator login password" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/authentications", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), 'passwordMethod')]", + "properties": { + "state": "Enabled", + "administratorLogin": "adminlogin1", + "administratorLoginPassword": "[parameters('administratorLoginPassword')]" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.tf b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.tf similarity index 52% rename from settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.tf rename to settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.tf index 4ee973be..ce6c6db6 100644 --- a/settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.tf +++ b/settings/remarks/microsoft.horizondb/samples/clusters/authentications/enable-password.tf @@ -10,38 +10,30 @@ provider "azapi" { skip_provider_registration = false } -variable "location" { - type = string - default = "eastus" - description = "The location for the cluster" -} - variable "cluster_name" { type = string - description = "The name for the cluster" -} - -variable "create_mode" { - type = string - default = "Update" - description = "The create mode for cluster" + default = "example-cluster" + description = "The name of the HorizonDB cluster" } variable "administrator_login_password" { type = string - description = "The administrator login password for cluster" + description = "The administrator login password" sensitive = true } -resource "azapi_resource" "cluster" { - type = "Microsoft.HorizonDB/clusters@2026-01-20-preview" - name = var.cluster_name - location = var.location - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}" +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "authentications" { + type = "Microsoft.HorizonDb/clusters/authentications@2026-10-01-preview" + name = "passwordMethod" + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" body = { properties = { - createMode = var.create_mode + state = "Enabled" + administratorLogin = "adminlogin1" administratorLoginPassword = var.administrator_login_password } } @@ -49,6 +41,3 @@ resource "azapi_resource" "cluster" { schema_validation_enabled = false response_export_values = ["*"] } - -data "azapi_client_config" "current" { -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.bicep new file mode 100644 index 00000000..5737065c --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.bicep @@ -0,0 +1,10 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/changeDataCapture@2026-10-01-preview' = { + name: '${clusterName}/default' + properties: { + desiredState: 'Enabled' + autoUpgradeExtension: true + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.json b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.json new file mode 100644 index 00000000..4b6e2074 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/changeDataCapture", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), 'default')]", + "properties": { + "desiredState": "Enabled", + "autoUpgradeExtension": true + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.tf b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.tf new file mode 100644 index 00000000..9be899f4 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/enable.tf @@ -0,0 +1,36 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "change_data_capture" { + type = "Microsoft.HorizonDb/clusters/changeDataCapture@2026-10-01-preview" + name = "default" + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + desiredState = "Enabled" + autoUpgradeExtension = true + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.bicep new file mode 100644 index 00000000..18cac0d6 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.bicep @@ -0,0 +1,9 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/changeDataCapture@2026-10-01-preview' = { + name: '${clusterName}/default' + properties: { + autoUpgradeExtension: false + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.json b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.json new file mode 100644 index 00000000..821545f1 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/changeDataCapture", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), 'default')]", + "properties": { + "autoUpgradeExtension": false + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.tf b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.tf new file mode 100644 index 00000000..3f092d37 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapture/update.tf @@ -0,0 +1,35 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_update_resource" "change_data_capture" { + type = "Microsoft.HorizonDb/clusters/changeDataCapture@2026-10-01-preview" + name = "default" + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + autoUpgradeExtension = false + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.bicep new file mode 100644 index 00000000..b3fbdaee --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.bicep @@ -0,0 +1,11 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the change data capture configuration') +param configurationName string = 'sales-database' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations@2026-10-01-preview' = { + name: '${clusterName}/${configurationName}' + properties: { + desiredState: 'Disabled' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.json b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.json new file mode 100644 index 00000000..62cdacb2 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "configurationName": { + "type": "string", + "defaultValue": "sales-database", + "metadata": { + "description": "The name of the change data capture configuration" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('configurationName'))]", + "properties": { + "desiredState": "Disabled" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.tf b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.tf new file mode 100644 index 00000000..78ac23d1 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/disable.tf @@ -0,0 +1,41 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "configuration_name" { + type = string + default = "sales-database" + description = "The name of the change data capture configuration" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_update_resource" "change_data_capture_configurations" { + type = "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations@2026-10-01-preview" + name = var.configuration_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + desiredState = "Disabled" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.bicep new file mode 100644 index 00000000..d99d2951 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.bicep @@ -0,0 +1,14 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the change data capture configuration') +param configurationName string = 'sales-database' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations@2026-10-01-preview' = { + name: '${clusterName}/${configurationName}' + properties: { + databaseName: 'sales' + usageProfile: 'Mirroring' + destinationResourceId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/example-cluster/changeDataCaptureDestinations/fabric-mirroring' + desiredState: 'Enabled' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.json b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.json new file mode 100644 index 00000000..e48ac361 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "configurationName": { + "type": "string", + "defaultValue": "sales-database", + "metadata": { + "description": "The name of the change data capture configuration" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('configurationName'))]", + "properties": { + "databaseName": "sales", + "usageProfile": "Mirroring", + "destinationResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/example-cluster/changeDataCaptureDestinations/fabric-mirroring", + "desiredState": "Enabled" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.tf b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.tf new file mode 100644 index 00000000..f52fa1e0 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacaptureconfigurations/enroll-database.tf @@ -0,0 +1,44 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "configuration_name" { + type = string + default = "sales-database" + description = "The name of the change data capture configuration" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "change_data_capture_configurations" { + type = "Microsoft.HorizonDb/clusters/changeDataCaptureConfigurations@2026-10-01-preview" + name = var.configuration_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + databaseName = "sales" + usageProfile = "Mirroring" + destinationResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/example-cluster/changeDataCaptureDestinations/fabric-mirroring" + desiredState = "Enabled" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.bicep new file mode 100644 index 00000000..d7585e32 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.bicep @@ -0,0 +1,16 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the change data capture destination') +param destinationName string = 'fabric-mirroring' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/changeDataCaptureDestinations@2026-10-01-preview' = { + name: '${clusterName}/${destinationName}' + properties: { + destination: { + destinationType: 'Fabric' + protocol: 'Native' + workspaceId: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' + } + desiredState: 'Enabled' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.json b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.json new file mode 100644 index 00000000..4165da74 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "destinationName": { + "type": "string", + "defaultValue": "fabric-mirroring", + "metadata": { + "description": "The name of the change data capture destination" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('destinationName'))]", + "properties": { + "destination": { + "destinationType": "Fabric", + "protocol": "Native", + "workspaceId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + }, + "desiredState": "Enabled" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.tf b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.tf new file mode 100644 index 00000000..501d9794 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/create-fabric.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "destination_name" { + type = string + default = "fabric-mirroring" + description = "The name of the change data capture destination" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "change_data_capture_destinations" { + type = "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations@2026-10-01-preview" + name = var.destination_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + destination = { + destinationType = "Fabric" + protocol = "Native" + workspaceId = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + } + desiredState = "Enabled" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.bicep new file mode 100644 index 00000000..060181e9 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.bicep @@ -0,0 +1,11 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the change data capture destination') +param destinationName string = 'fabric-mirroring' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/changeDataCaptureDestinations@2026-10-01-preview' = { + name: '${clusterName}/${destinationName}' + properties: { + desiredState: 'Disabled' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.json b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.json new file mode 100644 index 00000000..29cea84f --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "destinationName": { + "type": "string", + "defaultValue": "fabric-mirroring", + "metadata": { + "description": "The name of the change data capture destination" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('destinationName'))]", + "properties": { + "desiredState": "Disabled" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.tf b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.tf new file mode 100644 index 00000000..26112b35 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/disable.tf @@ -0,0 +1,41 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "destination_name" { + type = string + default = "fabric-mirroring" + description = "The name of the change data capture destination" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_update_resource" "change_data_capture_destinations" { + type = "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations@2026-10-01-preview" + name = var.destination_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + desiredState = "Disabled" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.bicep new file mode 100644 index 00000000..e94993a9 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.bicep @@ -0,0 +1,13 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the change data capture destination') +param destinationName string = 'fabric-mirroring' +@description('The name of the identity assignment') +param assignmentName string = 'fabric-writer' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/changeDataCaptureDestinations/identityAssignments@2026-10-01-preview' = { + name: '${clusterName}/${destinationName}/${assignmentName}' + properties: { + identityResourceId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fabric-writer' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.json b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.json new file mode 100644 index 00000000..21777a03 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "destinationName": { + "type": "string", + "defaultValue": "fabric-mirroring", + "metadata": { + "description": "The name of the change data capture destination" + } + }, + "assignmentName": { + "type": "string", + "defaultValue": "fabric-writer", + "metadata": { + "description": "The name of the identity assignment" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations/identityAssignments", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}/{2}', parameters('clusterName'), parameters('destinationName'), parameters('assignmentName'))]", + "properties": { + "identityResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fabric-writer" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.tf b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.tf new file mode 100644 index 00000000..9bceffc2 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/changedatacapturedestinations/identityassignments/create.tf @@ -0,0 +1,47 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "destination_name" { + type = string + default = "fabric-mirroring" + description = "The name of the change data capture destination" +} + +variable "assignment_name" { + type = string + default = "fabric-writer" + description = "The name of the identity assignment" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "identity_assignments" { + type = "Microsoft.HorizonDb/clusters/changeDataCaptureDestinations/identityAssignments@2026-10-01-preview" + name = var.assignment_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}/changeDataCaptureDestinations/${var.destination_name}" + + body = { + properties = { + identityResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fabric-writer" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.bicep deleted file mode 100644 index 825bf38d..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.bicep +++ /dev/null @@ -1,18 +0,0 @@ -@description('The location for the cluster') -param location string = 'eastus' -@description('The name for the cluster') -param clusterName string -@description('The create mode for cluster') -param createMode string = 'Update' -@description('The identifier of the parameter group to connect to the cluster') -param parameterGroupId string -resource flexibleServer 'Microsoft.HorizonDB/clusters@2026-01-20-preview' = { - name: clusterName - location: location - properties: { - createMode: createMode - parameterGroup: { - id: parameterGroupId - } - } -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.json b/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.json deleted file mode 100644 index 837e0ed0..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "location": { - "type": "string", - "defaultValue": "eastus", - "metadata": { - "description": "The location for the cluster" - } - }, - "clusterName": { - "type": "string", - "metadata": { - "description": "The name for the cluster" - } - }, - "createMode": { - "type": "string", - "defaultValue": "Update", - "metadata": { - "description": "The create mode for cluster" - } - }, - "parameterGroupId": { - "type": "string", - "metadata": { - "description": "The identifier of the parameter group to connect to the cluster" - } - } - }, - "resources": [ - { - "type": "Microsoft.HorizonDB/clusters", - "apiVersion": "2026-01-20-preview", - "name": "[parameters('clusterName')]", - "location": "[parameters('location')]", - "properties": { - "createMode": "[parameters('createMode')]", - "parameterGroup": { - "id": "[parameters('parameterGroupId')]" - } - } - } - ] -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.tf b/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.tf deleted file mode 100644 index 6769c9c3..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/connect-parameter-group-to-cluster.tf +++ /dev/null @@ -1,55 +0,0 @@ -terraform { - required_providers { - azapi = { - source = "Azure/azapi" - } - } -} - -provider "azapi" { - skip_provider_registration = false -} - -variable "location" { - type = string - default = "eastus" - description = "The location for the cluster" -} - -variable "cluster_name" { - type = string - description = "The name for the cluster" -} - -variable "create_mode" { - type = string - default = "Update" - description = "The create mode for cluster" -} - -variable "parameter_group_id" { - type = string - description = "The identifier of the parameter group to connect to the cluster" -} - -resource "azapi_resource" "cluster" { - type = "Microsoft.HorizonDB/clusters@2026-01-20-preview" - name = var.cluster_name - location = var.location - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}" - - body = { - properties = { - createMode = var.create_mode - parameterGroup = { - id = var.parameter_group_id - } - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - -data "azapi_client_config" "current" { -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.bicep new file mode 100644 index 00000000..b513058c --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.bicep @@ -0,0 +1,13 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'minimum-defaults' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters@2026-10-01-preview' = { + name: clusterName + location: 'eastus2' + properties: { + postgreSqlVersion: '18' + backup: { + geoRedundancy: 'Disabled' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.json b/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.json new file mode 100644 index 00000000..3eb14db5 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "minimum-defaults", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters", + "apiVersion": "2026-10-01-preview", + "name": "[parameters('clusterName')]", + "location": "eastus2", + "properties": { + "postgreSqlVersion": "18", + "backup": { + "geoRedundancy": "Disabled" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.tf b/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.tf new file mode 100644 index 00000000..c8e0f1f7 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create-minimum-defaults.tf @@ -0,0 +1,39 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "minimum-defaults" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "clusters" { + type = "Microsoft.HorizonDb/clusters@2026-10-01-preview" + name = var.cluster_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + location = "eastus2" + + body = { + properties = { + postgreSqlVersion = "18" + backup = { + geoRedundancy = "Disabled" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.bicep new file mode 100644 index 00000000..db4494c2 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.bicep @@ -0,0 +1,26 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters@2026-10-01-preview' = { + name: clusterName + location: 'eastus2' + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/primary-encryption-identity': { + } + } + } + properties: { + postgreSqlVersion: '17' + backup: { + geoRedundancy: 'Disabled' + retentionDays: 14 + } + dataEncryption: { + type: 'AzureKeyVault' + primaryKeyUri: 'https://primary-key-vault.vault.azure.net/keys/horizondb-primary-key' + primaryUserAssignedIdentityId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/primary-encryption-identity' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.json b/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.json new file mode 100644 index 00000000..c637e908 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters", + "apiVersion": "2026-10-01-preview", + "name": "[parameters('clusterName')]", + "location": "eastus2", + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/primary-encryption-identity": {} + } + }, + "properties": { + "postgreSqlVersion": "17", + "backup": { + "geoRedundancy": "Disabled", + "retentionDays": 14 + }, + "dataEncryption": { + "type": "AzureKeyVault", + "primaryKeyUri": "https://primary-key-vault.vault.azure.net/keys/horizondb-primary-key", + "primaryUserAssignedIdentityId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/primary-encryption-identity" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.tf b/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.tf new file mode 100644 index 00000000..fbc47b75 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create-with-data-encryption.tf @@ -0,0 +1,52 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "clusters" { + type = "Microsoft.HorizonDb/clusters@2026-10-01-preview" + name = var.cluster_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + location = "eastus2" + + body = { + identity = { + type = "UserAssigned" + userAssignedIdentities = { + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/primary-encryption-identity" = { + } + } + } + properties = { + postgreSqlVersion = "17" + backup = { + geoRedundancy = "Disabled" + retentionDays = 14 + } + dataEncryption = { + type = "AzureKeyVault" + primaryKeyUri = "https://primary-key-vault.vault.azure.net/keys/horizondb-primary-key" + primaryUserAssignedIdentityId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/primary-encryption-identity" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/create.bicep index 64c30bfb..86b80f79 100644 --- a/settings/remarks/microsoft.horizondb/samples/clusters/create.bicep +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create.bicep @@ -1,37 +1,27 @@ -@description('The location for the cluster') -param location string = 'eastus' -@description('The name for the cluster') -param clusterName string -@description('The tags for the cluster') -param tags object = { - env: 'dev' -} -@description('The create mode for cluster') -param createMode string = 'Create' -@description('The major version of server') -param version int = 17 -@description('The administrator login name for cluster') -param administratorLogin string -@secure() -@description('The administrator login password for cluster') -param administratorLoginPassword string -@description('The number of vCores for each replica of the cluster') -param vCores int = 4 -@description('The number of replicas for the cluster, including the primary replica, which is the only one in which writes are allowed. The other replicas are read-only.') -param replicaCount int = 2 -@description('The name of the SKU for cluster') -param zonePlacementPolicy string = 'BestEffort' -resource flexibleServer 'Microsoft.HorizonDB/clusters@2026-01-20-preview' = { +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters@2026-10-01-preview' = { name: clusterName - location: location - tags: tags + location: 'eastus2' + tags: { + environment: 'production' + } + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fabric-writer': { + } + } + } properties: { - createMode: createMode - version: version - administratorLogin: administratorLogin - administratorLoginPassword: administratorLoginPassword - vCores: vCores - replicaCount: replicaCount - zonePlacementPolicy: zonePlacementPolicy + postgreSqlVersion: '17' + network: { + publicAccess: 'Enabled' + } + backup: { + geoRedundancy: 'Enabled' + retentionDays: 14 + } } } diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create.json b/settings/remarks/microsoft.horizondb/samples/clusters/create.json index 64d266e8..3de6ae8b 100644 --- a/settings/remarks/microsoft.horizondb/samples/clusters/create.json +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create.json @@ -2,91 +2,38 @@ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { - "location": { - "type": "string", - "defaultValue": "eastus", - "metadata": { - "description": "The location for the cluster" - } - }, "clusterName": { "type": "string", + "defaultValue": "example-cluster", "metadata": { - "description": "The name for the cluster" - } - }, - "tags": { - "type": "object", - "defaultValue": { - "env": "dev" - }, - "metadata": { - "description": "The tags for the cluster" - } - }, - "createMode": { - "type": "string", - "defaultValue": "Create", - "metadata": { - "description": "The create mode for cluster" - } - }, - "version": { - "type": "int", - "defaultValue": 17, - "metadata": { - "description": "The major version of server" - } - }, - "administratorLogin": { - "type": "string", - "metadata": { - "description": "The administrator login name for cluster" - } - }, - "administratorLoginPassword": { - "type": "secureString", - "metadata": { - "description": "The administrator login password for cluster" - } - }, - "vCores": { - "type": "int", - "defaultValue": 4, - "metadata": { - "description": "The number of vCores for each replica of the cluster" - } - }, - "replicaCount": { - "type": "int", - "defaultValue": 2, - "metadata": { - "description": "The number of replicas for the cluster, including the primary replica, which is the only one in which writes are allowed. The other replicas are read-only." - } - }, - "zonePlacementPolicy": { - "type": "string", - "defaultValue": "BestEffort", - "metadata": { - "description": "The name of the SKU for cluster" + "description": "The name of the HorizonDB cluster" } } }, "resources": [ { - "type": "Microsoft.HorizonDB/clusters", - "apiVersion": "2026-01-20-preview", + "type": "Microsoft.HorizonDb/clusters", + "apiVersion": "2026-10-01-preview", "name": "[parameters('clusterName')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", + "location": "eastus2", + "tags": { + "environment": "production" + }, + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fabric-writer": {} + } + }, "properties": { - "createMode": "[parameters('createMode')]", - "version": "[parameters('version')]", - "administratorLogin": "[parameters('administratorLogin')]", - "administratorLoginPassword": "[parameters('administratorLoginPassword')]", - "vCores": "[parameters('vCores')]", - "replicaCount": "[parameters('replicaCount')]", - "zonePlacementPolicy": "[parameters('zonePlacementPolicy')]" + "postgreSqlVersion": "17", + "network": { + "publicAccess": "Enabled" + }, + "backup": { + "geoRedundancy": "Enabled", + "retentionDays": 14 + } } } ] diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/create.tf b/settings/remarks/microsoft.horizondb/samples/clusters/create.tf index 7c37fc5d..0a37f8da 100644 --- a/settings/remarks/microsoft.horizondb/samples/clusters/create.tf +++ b/settings/remarks/microsoft.horizondb/samples/clusters/create.tf @@ -12,88 +12,42 @@ provider "azapi" { variable "cluster_name" { type = string - description = "The name for the cluster" + default = "example-cluster" + description = "The name of the HorizonDB cluster" } -variable "location" { - type = string - default = "eastus" - description = "The location for the cluster" -} - -variable "administrator_login" { - type = string - description = "The administrator login name for cluster" -} - -variable "administrator_login_password" { - type = string - description = "The administrator login password for cluster" - sensitive = true -} - -variable "create_mode" { - type = string - default = "Create" - description = "The create mode for cluster" -} - -variable "version" { - type = number - default = 17 - description = "The major version of server" -} - -variable "v_cores" { - type = number - default = 4 - description = "The number of vCores for each replica of the cluster" -} - -variable "replica_count" { - type = number - default = 2 - description = "The number of replicas for the cluster, including the primary replica, which is the only one in which writes are allowed. The other replicas are read-only." -} - -variable "zone_placement_policy" { - type = string - default = "BestEffort" - description = "The name of the SKU for cluster" -} - -variable "tags" { - type = object({ - env = optional(string) - }) - default = { - env = "dev" - } - description = "The tags for the cluster" +data "azapi_client_config" "current" { } -resource "azapi_resource" "cluster" { - type = "Microsoft.HorizonDB/clusters@2026-01-20-preview" +resource "azapi_resource" "clusters" { + type = "Microsoft.HorizonDb/clusters@2026-10-01-preview" name = var.cluster_name - location = var.location - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}" + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + location = "eastus2" body = { - tags = var.tags + tags = { + environment = "production" + } + identity = { + type = "UserAssigned" + userAssignedIdentities = { + "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/identity-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/fabric-writer" = { + } + } + } properties = { - createMode = var.create_mode - version = var.version - administratorLogin = var.administrator_login - administratorLoginPassword = var.administrator_login_password - vCores = var.v_cores - replicaCount = var.replica_count - zonePlacementPolicy = var.zone_placement_policy + postgreSqlVersion = "17" + network = { + publicAccess = "Enabled" + } + backup = { + geoRedundancy = "Enabled" + retentionDays = 14 + } } } schema_validation_enabled = false response_export_values = ["*"] } - -data "azapi_client_config" "current" { -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.bicep new file mode 100644 index 00000000..933cce4e --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.bicep @@ -0,0 +1,11 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the log capture configuration') +param logCaptureConfigurationName string = 'PostgreSqlServer' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/logCaptureConfigurations@2026-10-01-preview' = { + name: '${clusterName}/${logCaptureConfigurationName}' + properties: { + state: 'Disabled' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.json b/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.json new file mode 100644 index 00000000..440a465b --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "logCaptureConfigurationName": { + "type": "string", + "defaultValue": "PostgreSqlServer", + "metadata": { + "description": "The name of the log capture configuration" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/logCaptureConfigurations", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('logCaptureConfigurationName'))]", + "properties": { + "state": "Disabled" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.tf b/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.tf new file mode 100644 index 00000000..2b459b4a --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/logcaptureconfigurations/disable.tf @@ -0,0 +1,41 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "log_capture_configuration_name" { + type = string + default = "PostgreSqlServer" + description = "The name of the log capture configuration" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_update_resource" "log_capture_configurations" { + type = "Microsoft.HorizonDb/clusters/logCaptureConfigurations@2026-10-01-preview" + name = var.log_capture_configuration_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + state = "Disabled" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.bicep new file mode 100644 index 00000000..2207bf93 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.bicep @@ -0,0 +1,13 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The object ID of the Microsoft Entra administrator') +param objectId string = '11111111-1111-1111-1111-111111111111' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/microsoftEntraAdministrators@2026-10-01-preview' = { + name: '${clusterName}/${objectId}' + properties: { + principalName: 'database.administrators@contoso.com' + principalType: 'Group' + tenantId: '22222222-2222-2222-2222-222222222222' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.json b/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.json new file mode 100644 index 00000000..a2d426e5 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "objectId": { + "type": "string", + "defaultValue": "11111111-1111-1111-1111-111111111111", + "metadata": { + "description": "The object ID of the Microsoft Entra administrator" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/microsoftEntraAdministrators", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('objectId'))]", + "properties": { + "principalName": "database.administrators@contoso.com", + "principalType": "Group", + "tenantId": "22222222-2222-2222-2222-222222222222" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.tf b/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.tf new file mode 100644 index 00000000..694d3f06 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/microsoftentraadministrators/create.tf @@ -0,0 +1,43 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "object_id" { + type = string + default = "11111111-1111-1111-1111-111111111111" + description = "The object ID of the Microsoft Entra administrator" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "microsoft_entra_administrators" { + type = "Microsoft.HorizonDb/clusters/microsoftEntraAdministrators@2026-10-01-preview" + name = var.object_id + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + principalName = "database.administrators@contoso.com" + principalType = "Group" + tenantId = "22222222-2222-2222-2222-222222222222" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.bicep new file mode 100644 index 00000000..aa9c0b73 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.bicep @@ -0,0 +1,27 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the HorizonDB pool') +param poolName string = 'example-pool-01' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/pools@2026-10-01-preview' = { + name: '${clusterName}/${poolName}' + properties: { + computeModel: { + type: 'Provisioned' + computeProcessor: 'AMD' + computeGeneration: 3 + vCores: 2 + } + parameterGroup: { + parameterGroupResourceId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.HorizonDb/locations/eastus2/parameterGroups/default-postgresql-17-provisioned' + applyMethod: 'Immediate' + } + scheduledMaintenance: { + maintenanceManagementType: 'System' + } + nodeCount: 1 + highAvailability: { + mode: 'Disabled' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.json new file mode 100644 index 00000000..286e8d3a --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "poolName": { + "type": "string", + "defaultValue": "example-pool-01", + "metadata": { + "description": "The name of the HorizonDB pool" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/pools", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('poolName'))]", + "properties": { + "computeModel": { + "type": "Provisioned", + "computeProcessor": "AMD", + "computeGeneration": 3, + "vCores": 2 + }, + "parameterGroup": { + "parameterGroupResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.HorizonDb/locations/eastus2/parameterGroups/default-postgresql-17-provisioned", + "applyMethod": "Immediate" + }, + "scheduledMaintenance": { + "maintenanceManagementType": "System" + }, + "nodeCount": 1, + "highAvailability": { + "mode": "Disabled" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.tf new file mode 100644 index 00000000..13619e9f --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/create.tf @@ -0,0 +1,57 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "pool_name" { + type = string + default = "example-pool-01" + description = "The name of the HorizonDB pool" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "pools" { + type = "Microsoft.HorizonDb/clusters/pools@2026-10-01-preview" + name = var.pool_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + computeModel = { + type = "Provisioned" + computeProcessor = "AMD" + computeGeneration = 3 + vCores = 2 + } + parameterGroup = { + parameterGroupResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.HorizonDb/locations/eastus2/parameterGroups/default-postgresql-17-provisioned" + applyMethod = "Immediate" + } + scheduledMaintenance = { + maintenanceManagementType = "System" + } + nodeCount = 1 + highAvailability = { + mode = "Disabled" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.bicep index 9cd062c3..5af6ca54 100644 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.bicep +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.bicep @@ -1,35 +1,15 @@ -@description('The name for the cluster') -param clusterName string -@description('The name for the pool') -param poolName string = 'DefaultPool' -@description('The name for the firewall rule') -param firewallRuleName string = 'DataAnalyticsDepartment' -@description('The start IP address for the firewall rule') -param firewallRuleStartIp string = '10.0.0.1' -@description('The end IP address for the firewall rule') -param firewallRuleEndIp string = '10.0.0.10' -@description('The description for the firewall rule') -param firewallRuleDescription string = 'Allow all IP addresses from the Data Analytics department' -@description('The create mode for cluster') -param createMode string = 'Create' -@description('The major version of server') -param version int = 17 -@description('The administrator login name for cluster') -param administratorLogin string -@secure() -@description('The administrator login password for cluster') -param administratorLoginPassword string -@description('The number of vCores for each replica of the cluster') -param vCores int = 4 -@description('The number of replicas for the cluster, including the primary replica, which is the only one in which writes are allowed. The other replicas are read-only.') -param replicaCount int = 2 -@description('The name of the SKU for cluster') -param zonePlacementPolicy string = 'BestEffort' -resource flexibleServer 'Microsoft.HorizonDB/clusters/pools/firewallRules@2026-01-20-preview' = { +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the HorizonDB pool') +param poolName string = 'example-pool-01' +@description('The name of the firewall rule') +param firewallRuleName string = 'example-firewall-rule-01' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/pools/firewallRules@2026-10-01-preview' = { name: '${clusterName}/${poolName}/${firewallRuleName}' properties: { - startIp: firewallRuleStartIp - endIp: firewallRuleEndIp - description: firewallRuleDescription + startIpAddress: '10.0.0.1' + endIpAddress: '10.0.0.254' + description: 'Allow access from the corporate network' } } diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.json index e58d8226..1659ab57 100644 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.json +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.json @@ -4,102 +4,35 @@ "parameters": { "clusterName": { "type": "string", + "defaultValue": "example-cluster", "metadata": { - "description": "The name for the cluster" + "description": "The name of the HorizonDB cluster" } }, "poolName": { "type": "string", - "defaultValue": "DefaultPool", + "defaultValue": "example-pool-01", "metadata": { - "description": "The name for the pool" + "description": "The name of the HorizonDB pool" } }, "firewallRuleName": { "type": "string", - "defaultValue": "DataAnalyticsDepartment", + "defaultValue": "example-firewall-rule-01", "metadata": { - "description": "The name for the firewall rule" - } - }, - "firewallRuleStartIp": { - "type": "string", - "defaultValue": "10.0.0.1", - "metadata": { - "description": "The start IP address for the firewall rule" - } - }, - "firewallRuleEndIp": { - "type": "string", - "defaultValue": "10.0.0.10", - "metadata": { - "description": "The end IP address for the firewall rule" - } - }, - "firewallRuleDescription": { - "type": "string", - "defaultValue": "Allow all IP addresses from the Data Analytics department", - "metadata": { - "description": "The description for the firewall rule" - } - }, - "createMode": { - "type": "string", - "defaultValue": "Create", - "metadata": { - "description": "The create mode for cluster" - } - }, - "version": { - "type": "int", - "defaultValue": 17, - "metadata": { - "description": "The major version of server" - } - }, - "administratorLogin": { - "type": "string", - "metadata": { - "description": "The administrator login name for cluster" - } - }, - "administratorLoginPassword": { - "type": "secureString", - "metadata": { - "description": "The administrator login password for cluster" - } - }, - "vCores": { - "type": "int", - "defaultValue": 4, - "metadata": { - "description": "The number of vCores for each replica of the cluster" - } - }, - "replicaCount": { - "type": "int", - "defaultValue": 2, - "metadata": { - "description": "The number of replicas for the cluster, including the primary replica, which is the only one in which writes are allowed. The other replicas are read-only." - } - }, - "zonePlacementPolicy": { - "type": "string", - "defaultValue": "BestEffort", - "metadata": { - "description": "The name of the SKU for cluster" + "description": "The name of the firewall rule" } } }, "resources": [ { - "type": "Microsoft.HorizonDB/clusters/pools/firewallRules", - "apiVersion": "2026-01-20-preview", + "type": "Microsoft.HorizonDb/clusters/pools/firewallRules", + "apiVersion": "2026-10-01-preview", "name": "[format('{0}/{1}/{2}', parameters('clusterName'), parameters('poolName'), parameters('firewallRuleName'))]", "properties": { - "startIp": "[parameters('firewallRuleStartIp')]", - "endIp": "[parameters('firewallRuleEndIp')]", - "description": "[parameters('firewallRuleDescription')]" + "startIpAddress": "10.0.0.1", + "endIpAddress": "10.0.0.254", + "description": "Allow access from the corporate network" } } ] diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.tf index 7d1e3004..b274bdbe 100644 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.tf +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/firewallrules/create.tf @@ -12,118 +12,38 @@ provider "azapi" { variable "cluster_name" { type = string - description = "The name for the cluster" + default = "example-cluster" + description = "The name of the HorizonDB cluster" } variable "pool_name" { type = string - default = "DefaultPool" - description = "The name for the pool" + default = "example-pool-01" + description = "The name of the HorizonDB pool" } variable "firewall_rule_name" { type = string - default = "DataAnalyticsDepartment" - description = "The name for the firewall rule" -} - -variable "firewall_rule_start_ip" { - type = string - default = "10.0.0.1" - description = "The start IP address for the firewall rule" -} - -variable "firewall_rule_end_ip" { - type = string - default = "10.0.0.10" - description = "The end IP address for the firewall rule" -} - -variable "firewall_rule_description" { - type = string - default = "Allow all IP addresses from the Data Analytics department" - description = "The description for the firewall rule" -} - -variable "administrator_login" { - type = string - description = "The administrator login name for cluster" -} - -variable "administrator_login_password" { - type = string - description = "The administrator login password for cluster" - sensitive = true -} - -variable "create_mode" { - type = string - default = "Create" - description = "The create mode for cluster" -} - -variable "version" { - type = number - default = 17 - description = "The major version of server" -} - -variable "v_cores" { - type = number - default = 4 - description = "The number of vCores for each replica of the cluster" -} - -variable "replica_count" { - type = number - default = 2 - description = "The number of replicas for the cluster, including the primary replica, which is the only one in which writes are allowed. The other replicas are read-only." -} - -variable "zone_placement_policy" { - type = string - default = "BestEffort" - description = "The name of the SKU for cluster" + default = "example-firewall-rule-01" + description = "The name of the firewall rule" } data "azapi_client_config" "current" { } -resource "azapi_resource" "cluster" { - type = "Microsoft.HorizonDB/clusters@2026-01-20-preview" - name = var.cluster_name - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}" - - body = { - properties = { - createMode = var.create_mode - version = var.version - administratorLogin = var.administrator_login - administratorLoginPassword = var.administrator_login_password - vCores = var.v_cores - replicaCount = var.replica_count - zonePlacementPolicy = var.zone_placement_policy - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - -resource "azapi_resource" "firewall_rule" { - type = "Microsoft.HorizonDB/clusters/pools/firewallRules@2026-01-20-preview" - parent_id = "${azapi_resource.cluster.id}/pools/${var.pool_name}" +resource "azapi_resource" "firewall_rules" { + type = "Microsoft.HorizonDb/clusters/pools/firewallRules@2026-10-01-preview" name = var.firewall_rule_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}/pools/${var.pool_name}" body = { properties = { - startIp = var.firewall_rule_start_ip - endIp = var.firewall_rule_end_ip - description = var.firewall_rule_description + startIpAddress = "10.0.0.1" + endIpAddress = "10.0.0.254" + description = "Allow access from the corporate network" } } schema_validation_enabled = false response_export_values = ["*"] } - diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.bicep deleted file mode 100644 index 5c220421..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.bicep +++ /dev/null @@ -1,17 +0,0 @@ -@description('The name for the cluster') -param clusterName string -@description('The name for the pool') -param poolName string = 'DefaultPool' -@description('The name for the replica') -param replicaName string -@description('The role for the replica') -param role string = 'Read' -@description('The availability zone for the replica') -param availabilityZone string = '1' -resource replica 'Microsoft.HorizonDB/clusters/pools/replicas@2026-01-20-preview' = { - name: '${clusterName}/${poolName}/${replicaName}' - properties: { - role: role - availabilityZone: availabilityZone - } -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.json deleted file mode 100644 index 6ceca951..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "clusterName": { - "type": "string", - "metadata": { - "description": "The name for the cluster" - } - }, - "poolName": { - "type": "string", - "defaultValue": "DefaultPool", - "metadata": { - "description": "The name for the pool" - } - }, - "replicaName": { - "type": "string", - "metadata": { - "description": "The name for the replica" - } - }, - "role": { - "type": "string", - "defaultValue": "Read", - "metadata": { - "description": "The role for the replica" - } - }, - "availabilityZone": { - "type": "string", - "defaultValue": "1", - "metadata": { - "description": "The availability zone for the replica" - } - } - }, - "resources": [ - { - "type": "Microsoft.HorizonDB/clusters/pools/replicas", - "apiVersion": "2026-01-20-preview", - "name": "[format('{0}/{1}/{2}', parameters('clusterName'), parameters('poolName'), parameters('replicaName'))]", - "properties": { - "role": "[parameters('role')]", - "availabilityZone": "[parameters('availabilityZone')]" - } - } - ] -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.tf deleted file mode 100644 index 92c686a2..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-no-specific-availability-zone.tf +++ /dev/null @@ -1,170 +0,0 @@ -terraform { - required_providers { - azapi = { - source = "Azure/azapi" - } - } -} - -provider "azapi" { - skip_provider_registration = false -} - -variable "cluster_name" { - type = string - description = "The name for the cluster" -} - -variable "pool_name" { - type = string - default = "DefaultPool" - description = "The name for the pool" -} - -variable "replica_name" { - type = string - description = "The name for the replica" -} - -variable "role" { - type = string - default = "Read" - description = "The role for the replica" -} - -data "azapi_client_config" "current" { -} - -resource "azapi_resource" "replica" { - type = "Microsoft.HorizonDB/clusters/pools/replicas@2026-01-20-preview" - name = var.replica_name - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDB/clusters/${var.cluster_name}/pools/${var.pool_name}" - - body = { - properties = { - role = var.role - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - - -variable "cluster_name" { - type = string - description = "The name for the cluster" -} - -variable "pool_name" { - type = string - default = "DefaultPool" - description = "The name for the pool" -} - -variable "firewall_rule_name" { - type = string - default = "DataAnalyticsDepartment" - description = "The name for the firewall rule" -} - -variable "firewall_rule_start_ip" { - type = string - default = "10.0.0.1" - description = "The start IP address for the firewall rule" -} - -variable "firewall_rule_end_ip" { - type = string - default = "10.0.0.10" - description = "The end IP address for the firewall rule" -} - -variable "firewall_rule_description" { - type = string - default = "Allow all IP addresses from the Data Analytics department" - description = "The description for the firewall rule" -} - -variable "administrator_login" { - type = string - description = "The administrator login name for cluster" -} - -variable "administrator_login_password" { - type = string - description = "The administrator login password for cluster" - sensitive = true -} - -variable "create_mode" { - type = string - default = "Create" - description = "The create mode for cluster" -} - -variable "version" { - type = number - default = 17 - description = "The major version of server" -} - -variable "v_cores" { - type = number - default = 4 - description = "The number of vCores for each replica of the cluster" -} - -variable "replica_count" { - type = number - default = 2 - description = "The number of replicas for the cluster, including the primary replica, which is the only one in which writes are allowed. The other replicas are read-only." -} - -variable "zone_placement_policy" { - type = string - default = "BestEffort" - description = "The name of the SKU for cluster" -} - -data "azapi_client_config" "current" { -} - -resource "azapi_resource" "cluster" { - type = "Microsoft.HorizonDB/clusters@2026-01-20-preview" - name = var.cluster_name - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}" - - body = { - properties = { - createMode = var.create_mode - version = var.version - administratorLogin = var.administrator_login - administratorLoginPassword = var.administrator_login_password - vCores = var.v_cores - replicaCount = var.replica_count - zonePlacementPolicy = var.zone_placement_policy - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - -resource "azapi_resource" "firewall_rule" { - type = "Microsoft.HorizonDB/clusters/pools/firewallRules@2026-01-20-preview" - parent_id = "${azapi_resource.cluster.id}/pools/${var.pool_name}" - name = var.firewall_rule_name - - body = { - properties = { - startIp = var.firewall_rule_start_ip - endIp = var.firewall_rule_end_ip - description = var.firewall_rule_description - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.bicep deleted file mode 100644 index b4f7bfd9..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.bicep +++ /dev/null @@ -1,14 +0,0 @@ -@description('The name for the cluster') -param clusterName string -@description('The name for the pool') -param poolName string = 'DefaultPool' -@description('The name for the replica') -param replicaName string -@description('The role for the replica') -param role string = 'Read' -resource replica 'Microsoft.HorizonDB/clusters/pools/replicas@2026-01-20-preview' = { - name: '${clusterName}/${poolName}/${replicaName}' - properties: { - role: role - } -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.json deleted file mode 100644 index 35019c91..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "clusterName": { - "type": "string", - "metadata": { - "description": "The name for the cluster" - } - }, - "poolName": { - "type": "string", - "defaultValue": "DefaultPool", - "metadata": { - "description": "The name for the pool" - } - }, - "replicaName": { - "type": "string", - "metadata": { - "description": "The name for the replica" - } - }, - "role": { - "type": "string", - "defaultValue": "Read", - "metadata": { - "description": "The role for the replica" - } - } - }, - "resources": [ - { - "type": "Microsoft.HorizonDB/clusters/pools/replicas", - "apiVersion": "2026-01-20-preview", - "name": "[format('{0}/{1}/{2}', parameters('clusterName'), parameters('poolName'), parameters('replicaName'))]", - "properties": { - "role": "[parameters('role')]" - } - } - ] -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.tf deleted file mode 100644 index 34f04b78..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/pools/replicas/add-specific-availability-zone.tf +++ /dev/null @@ -1,177 +0,0 @@ -terraform { - required_providers { - azapi = { - source = "Azure/azapi" - } - } -} - -provider "azapi" { - skip_provider_registration = false -} - -variable "cluster_name" { - type = string - description = "The name for the cluster" -} - -variable "pool_name" { - type = string - default = "DefaultPool" - description = "The name for the pool" -} - -variable "replica_name" { - type = string - description = "The name for the replica" -} - -variable "role" { - type = string - default = "Read" - description = "The role for the replica" -} - -variable "availability_zone" { - type = string - default = "1" - description = "The availability zone for the replica" -} - -data "azapi_client_config" "current" { -} - -resource "azapi_resource" "replica" { - type = "Microsoft.HorizonDB/clusters/pools/replicas@2026-01-20-preview" - name = var.replica_name - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDB/clusters/${var.cluster_name}/pools/${var.pool_name}" - - body = { - properties = { - role = var.role - availabilityZone = var.availability_zone - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - - -variable "cluster_name" { - type = string - description = "The name for the cluster" -} - -variable "pool_name" { - type = string - default = "DefaultPool" - description = "The name for the pool" -} - -variable "firewall_rule_name" { - type = string - default = "DataAnalyticsDepartment" - description = "The name for the firewall rule" -} - -variable "firewall_rule_start_ip" { - type = string - default = "10.0.0.1" - description = "The start IP address for the firewall rule" -} - -variable "firewall_rule_end_ip" { - type = string - default = "10.0.0.10" - description = "The end IP address for the firewall rule" -} - -variable "firewall_rule_description" { - type = string - default = "Allow all IP addresses from the Data Analytics department" - description = "The description for the firewall rule" -} - -variable "administrator_login" { - type = string - description = "The administrator login name for cluster" -} - -variable "administrator_login_password" { - type = string - description = "The administrator login password for cluster" - sensitive = true -} - -variable "create_mode" { - type = string - default = "Create" - description = "The create mode for cluster" -} - -variable "version" { - type = number - default = 17 - description = "The major version of server" -} - -variable "v_cores" { - type = number - default = 4 - description = "The number of vCores for each replica of the cluster" -} - -variable "replica_count" { - type = number - default = 2 - description = "The number of replicas for the cluster, including the primary replica, which is the only one in which writes are allowed. The other replicas are read-only." -} - -variable "zone_placement_policy" { - type = string - default = "BestEffort" - description = "The name of the SKU for cluster" -} - -data "azapi_client_config" "current" { -} - -resource "azapi_resource" "cluster" { - type = "Microsoft.HorizonDB/clusters@2026-01-20-preview" - name = var.cluster_name - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}" - - body = { - properties = { - createMode = var.create_mode - version = var.version - administratorLogin = var.administrator_login - administratorLoginPassword = var.administrator_login_password - vCores = var.v_cores - replicaCount = var.replica_count - zonePlacementPolicy = var.zone_placement_policy - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - -resource "azapi_resource" "firewall_rule" { - type = "Microsoft.HorizonDB/clusters/pools/firewallRules@2026-01-20-preview" - parent_id = "${azapi_resource.cluster.id}/pools/${var.pool_name}" - name = var.firewall_rule_name - - body = { - properties = { - startIp = var.firewall_rule_start_ip - endIp = var.firewall_rule_end_ip - description = var.firewall_rule_description - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.bicep new file mode 100644 index 00000000..ced0dd6b --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.bicep @@ -0,0 +1,16 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the HorizonDB pool') +param poolName string = 'example-pool-01' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/pools@2026-10-01-preview' = { + name: '${clusterName}/${poolName}' + properties: { + computeModel: { + vCores: 16 + } + scheduledMaintenance: { + maintenanceManagementType: 'System' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.json new file mode 100644 index 00000000..034b8bff --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.json @@ -0,0 +1,35 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "poolName": { + "type": "string", + "defaultValue": "example-pool-01", + "metadata": { + "description": "The name of the HorizonDB pool" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/pools", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('poolName'))]", + "properties": { + "computeModel": { + "vCores": 16 + }, + "scheduledMaintenance": { + "maintenanceManagementType": "System" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.tf new file mode 100644 index 00000000..bb8f59a4 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-compute.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "pool_name" { + type = string + default = "example-pool-01" + description = "The name of the HorizonDB pool" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_update_resource" "pools" { + type = "Microsoft.HorizonDb/clusters/pools@2026-10-01-preview" + name = var.pool_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + computeModel = { + vCores = 16 + } + scheduledMaintenance = { + maintenanceManagementType = "System" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.bicep new file mode 100644 index 00000000..63255837 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.bicep @@ -0,0 +1,13 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the HorizonDB pool') +param poolName string = 'example-pool-01' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/pools@2026-10-01-preview' = { + name: '${clusterName}/${poolName}' + properties: { + highAvailability: { + mode: 'ZoneRedundant' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.json new file mode 100644 index 00000000..ea32477c --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "poolName": { + "type": "string", + "defaultValue": "example-pool-01", + "metadata": { + "description": "The name of the HorizonDB pool" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/pools", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('poolName'))]", + "properties": { + "highAvailability": { + "mode": "ZoneRedundant" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.tf new file mode 100644 index 00000000..c6699be0 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/update-high-availability.tf @@ -0,0 +1,43 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "pool_name" { + type = string + default = "example-pool-01" + description = "The name of the HorizonDB pool" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "pools" { + type = "Microsoft.HorizonDb/clusters/pools@2026-10-01-preview" + name = var.pool_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + highAvailability = { + mode = "ZoneRedundant" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.bicep new file mode 100644 index 00000000..95d6200a --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.bicep @@ -0,0 +1,14 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the HorizonDB pool') +param poolName string = 'example-pool-01' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/pools@2026-10-01-preview' = { + name: '${clusterName}/${poolName}' + properties: { + parameterGroup: { + parameterGroupResourceId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.HorizonDb/locations/eastus2/parameterGroups/default-postgresql-17-provisioned' + applyMethod: 'Immediate' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.json new file mode 100644 index 00000000..f5c2efb7 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "poolName": { + "type": "string", + "defaultValue": "example-pool-01", + "metadata": { + "description": "The name of the HorizonDB pool" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/pools", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('poolName'))]", + "properties": { + "parameterGroup": { + "parameterGroupResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.HorizonDb/locations/eastus2/parameterGroups/default-postgresql-17-provisioned", + "applyMethod": "Immediate" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.tf new file mode 100644 index 00000000..e89572c1 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-default-parameter-group.tf @@ -0,0 +1,44 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "pool_name" { + type = string + default = "example-pool-01" + description = "The name of the HorizonDB pool" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "pools" { + type = "Microsoft.HorizonDb/clusters/pools@2026-10-01-preview" + name = var.pool_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + parameterGroup = { + parameterGroupResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.HorizonDb/locations/eastus2/parameterGroups/default-postgresql-17-provisioned" + applyMethod = "Immediate" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.bicep new file mode 100644 index 00000000..0caa73c5 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.bicep @@ -0,0 +1,14 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the HorizonDB pool') +param poolName string = 'example-pool-01' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/pools@2026-10-01-preview' = { + name: '${clusterName}/${poolName}' + properties: { + parameterGroup: { + parameterGroupResourceId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/parameterGroups/maintenance-window-parameters' + applyMethod: 'PendingReboot' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.json new file mode 100644 index 00000000..b01df1d1 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "poolName": { + "type": "string", + "defaultValue": "example-pool-01", + "metadata": { + "description": "The name of the HorizonDB pool" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/pools", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('poolName'))]", + "properties": { + "parameterGroup": { + "parameterGroupResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/parameterGroups/maintenance-window-parameters", + "applyMethod": "PendingReboot" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.tf new file mode 100644 index 00000000..70ba3efd --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-after-reboot.tf @@ -0,0 +1,44 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "pool_name" { + type = string + default = "example-pool-01" + description = "The name of the HorizonDB pool" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "pools" { + type = "Microsoft.HorizonDb/clusters/pools@2026-10-01-preview" + name = var.pool_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + parameterGroup = { + parameterGroupResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/parameterGroups/maintenance-window-parameters" + applyMethod = "PendingReboot" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.bicep new file mode 100644 index 00000000..e9270389 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.bicep @@ -0,0 +1,14 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' +@description('The name of the HorizonDB pool') +param poolName string = 'example-pool-01' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters/pools@2026-10-01-preview' = { + name: '${clusterName}/${poolName}' + properties: { + parameterGroup: { + parameterGroupResourceId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/parameterGroups/production-parameters' + applyMethod: 'Immediate' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.json b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.json new file mode 100644 index 00000000..3749aa8c --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + }, + "poolName": { + "type": "string", + "defaultValue": "example-pool-01", + "metadata": { + "description": "The name of the HorizonDB pool" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters/pools", + "apiVersion": "2026-10-01-preview", + "name": "[format('{0}/{1}', parameters('clusterName'), parameters('poolName'))]", + "properties": { + "parameterGroup": { + "parameterGroupResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/parameterGroups/production-parameters", + "applyMethod": "Immediate" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.tf b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.tf new file mode 100644 index 00000000..6f9e765f --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/pools/use-parameter-group-immediately.tf @@ -0,0 +1,44 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +variable "pool_name" { + type = string + default = "example-pool-01" + description = "The name of the HorizonDB pool" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "pools" { + type = "Microsoft.HorizonDb/clusters/pools@2026-10-01-preview" + name = var.pool_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb/clusters/${var.cluster_name}" + + body = { + properties = { + parameterGroup = { + parameterGroupResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/parameterGroups/production-parameters" + applyMethod = "Immediate" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.bicep new file mode 100644 index 00000000..1c3aa8d0 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.bicep @@ -0,0 +1,20 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'cross-region-restored-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters@2026-10-01-preview' = { + name: clusterName + location: 'westus2' + properties: { + creationMode: 'PointInTimeRestore' + pointInTimeUtc: '2026-07-27T12:00:00Z' + creationSourceClusterResourceId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/source-cluster' + creationSourceClusterLocation: 'eastus2' + network: { + publicAccess: 'Disabled' + } + backup: { + geoRedundancy: 'Enabled' + retentionDays: 14 + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.json b/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.json new file mode 100644 index 00000000..0b4b401c --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "cross-region-restored-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters", + "apiVersion": "2026-10-01-preview", + "name": "[parameters('clusterName')]", + "location": "westus2", + "properties": { + "creationMode": "PointInTimeRestore", + "pointInTimeUtc": "2026-07-27T12:00:00Z", + "creationSourceClusterResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/source-cluster", + "creationSourceClusterLocation": "eastus2", + "network": { + "publicAccess": "Disabled" + }, + "backup": { + "geoRedundancy": "Enabled", + "retentionDays": 14 + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.tf b/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.tf new file mode 100644 index 00000000..bd502791 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/restore-cross-region.tf @@ -0,0 +1,46 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "cross-region-restored-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "clusters" { + type = "Microsoft.HorizonDb/clusters@2026-10-01-preview" + name = var.cluster_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + location = "westus2" + + body = { + properties = { + creationMode = "PointInTimeRestore" + pointInTimeUtc = "2026-07-27T12:00:00Z" + creationSourceClusterResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/source-cluster" + creationSourceClusterLocation = "eastus2" + network = { + publicAccess = "Disabled" + } + backup = { + geoRedundancy = "Enabled" + retentionDays = 14 + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.bicep new file mode 100644 index 00000000..e1f40011 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.bicep @@ -0,0 +1,19 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'restored-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters@2026-10-01-preview' = { + name: clusterName + location: 'eastus2' + properties: { + creationMode: 'PointInTimeRestore' + pointInTimeUtc: '2026-07-27T12:00:00Z' + creationSourceClusterResourceId: '/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/source-cluster' + network: { + publicAccess: 'Disabled' + } + backup: { + geoRedundancy: 'Enabled' + retentionDays: 14 + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.json b/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.json new file mode 100644 index 00000000..db84298f --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "restored-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters", + "apiVersion": "2026-10-01-preview", + "name": "[parameters('clusterName')]", + "location": "eastus2", + "properties": { + "creationMode": "PointInTimeRestore", + "pointInTimeUtc": "2026-07-27T12:00:00Z", + "creationSourceClusterResourceId": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/source-cluster", + "network": { + "publicAccess": "Disabled" + }, + "backup": { + "geoRedundancy": "Enabled", + "retentionDays": 14 + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.tf b/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.tf new file mode 100644 index 00000000..684cd0e7 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/restore-point-in-time.tf @@ -0,0 +1,45 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "restored-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "clusters" { + type = "Microsoft.HorizonDb/clusters@2026-10-01-preview" + name = var.cluster_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + location = "eastus2" + + body = { + properties = { + creationMode = "PointInTimeRestore" + pointInTimeUtc = "2026-07-27T12:00:00Z" + creationSourceClusterResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/example-resource-group/providers/Microsoft.HorizonDb/clusters/source-cluster" + network = { + publicAccess = "Disabled" + } + backup = { + geoRedundancy = "Enabled" + retentionDays = 14 + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.bicep new file mode 100644 index 00000000..a74b0927 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.bicep @@ -0,0 +1,11 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters@2026-10-01-preview' = { + name: clusterName + properties: { + dataEncryption: { + primaryKeyUri: 'https://primary-key-vault.vault.azure.net/keys/horizondb-primary-key' + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.json b/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.json new file mode 100644 index 00000000..ce6c7751 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters", + "apiVersion": "2026-10-01-preview", + "name": "[parameters('clusterName')]", + "properties": { + "dataEncryption": { + "primaryKeyUri": "https://primary-key-vault.vault.azure.net/keys/horizondb-primary-key" + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.tf b/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.tf new file mode 100644 index 00000000..1b23d8dc --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/rotate-data-encryption-key.tf @@ -0,0 +1,37 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_resource" "clusters" { + type = "Microsoft.HorizonDb/clusters@2026-10-01-preview" + name = var.cluster_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + + body = { + properties = { + dataEncryption = { + primaryKeyUri = "https://primary-key-vault.vault.azure.net/keys/horizondb-primary-key" + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.bicep deleted file mode 100644 index 596777bf..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.bicep +++ /dev/null @@ -1,16 +0,0 @@ -@description('The location for the cluster') -param location string = 'eastus' -@description('The name for the cluster') -param clusterName string -@description('The create mode for cluster') -param createMode string = 'Update' -@description('The number of vCores for each replica of the cluster') -param vCores int = 8 -resource flexibleServer 'Microsoft.HorizonDB/clusters@2026-01-20-preview' = { - name: clusterName - location: location - properties: { - createMode: createMode - vCores: vCores - } -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.json b/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.json deleted file mode 100644 index 792df980..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "location": { - "type": "string", - "defaultValue": "eastus", - "metadata": { - "description": "The location for the cluster" - } - }, - "clusterName": { - "type": "string", - "metadata": { - "description": "The name for the cluster" - } - }, - "createMode": { - "type": "string", - "defaultValue": "Update", - "metadata": { - "description": "The create mode for cluster" - } - }, - "vCores": { - "type": "int", - "defaultValue": 8, - "metadata": { - "description": "The number of vCores for each replica of the cluster" - } - } - }, - "resources": [ - { - "type": "Microsoft.HorizonDB/clusters", - "apiVersion": "2026-01-20-preview", - "name": "[parameters('clusterName')]", - "location": "[parameters('location')]", - "properties": { - "createMode": "[parameters('createMode')]", - "vCores": "[parameters('vCores')]" - } - } - ] -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.tf b/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.tf deleted file mode 100644 index 2206a20d..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/scale-cluster-vertically.tf +++ /dev/null @@ -1,54 +0,0 @@ -terraform { - required_providers { - azapi = { - source = "Azure/azapi" - } - } -} - -provider "azapi" { - skip_provider_registration = false -} - -variable "location" { - type = string - default = "eastus" - description = "The location for the cluster" -} - -variable "cluster_name" { - type = string - description = "The name for the cluster" -} - -variable "create_mode" { - type = string - default = "Update" - description = "The create mode for cluster" -} - -variable "v_cores" { - type = number - default = 8 - description = "The number of vCores for each replica of the cluster" -} - -resource "azapi_resource" "cluster" { - type = "Microsoft.HorizonDB/clusters@2026-01-20-preview" - name = var.cluster_name - location = var.location - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}" - - body = { - properties = { - createMode = var.create_mode - vCores = var.v_cores - } - } - - schema_validation_enabled = false - response_export_values = ["*"] -} - -data "azapi_client_config" "current" { -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.bicep deleted file mode 100644 index e4bac308..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.bicep +++ /dev/null @@ -1,17 +0,0 @@ -@description('The location for the cluster') -param location string = 'eastus' -@description('The name for the cluster') -param clusterName string -@description('The create mode for cluster') -param createMode string = 'Update' -@secure() -@description('The administrator login password for cluster') -param administratorLoginPassword string -resource flexibleServer 'Microsoft.HorizonDB/clusters@2026-01-20-preview' = { - name: clusterName - location: location - properties: { - createMode: createMode - administratorLoginPassword: administratorLoginPassword - } -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.json b/settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.json deleted file mode 100644 index fff11895..00000000 --- a/settings/remarks/microsoft.horizondb/samples/clusters/update-administrator-login-password.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "location": { - "type": "string", - "defaultValue": "eastus", - "metadata": { - "description": "The location for the cluster" - } - }, - "clusterName": { - "type": "string", - "metadata": { - "description": "The name for the cluster" - } - }, - "createMode": { - "type": "string", - "defaultValue": "Update", - "metadata": { - "description": "The create mode for cluster" - } - }, - "administratorLoginPassword": { - "type": "secureString", - "metadata": { - "description": "The administrator login password for cluster" - } - } - }, - "resources": [ - { - "type": "Microsoft.HorizonDB/clusters", - "apiVersion": "2026-01-20-preview", - "name": "[parameters('clusterName')]", - "location": "[parameters('location')]", - "properties": { - "createMode": "[parameters('createMode')]", - "administratorLoginPassword": "[parameters('administratorLoginPassword')]" - } - } - ] -} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/update.bicep b/settings/remarks/microsoft.horizondb/samples/clusters/update.bicep new file mode 100644 index 00000000..d19352e9 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/update.bicep @@ -0,0 +1,18 @@ +@description('The name of the HorizonDB cluster') +param clusterName string = 'example-cluster' + +resource horizonDbResource 'Microsoft.HorizonDb/clusters@2026-10-01-preview' = { + name: clusterName + tags: { + environment: 'production' + team: 'data-platform' + } + properties: { + network: { + publicAccess: 'Disabled' + } + backup: { + retentionDays: 21 + } + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/update.json b/settings/remarks/microsoft.horizondb/samples/clusters/update.json new file mode 100644 index 00000000..aa943838 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/update.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "clusterName": { + "type": "string", + "defaultValue": "example-cluster", + "metadata": { + "description": "The name of the HorizonDB cluster" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/clusters", + "apiVersion": "2026-10-01-preview", + "name": "[parameters('clusterName')]", + "tags": { + "environment": "production", + "team": "data-platform" + }, + "properties": { + "network": { + "publicAccess": "Disabled" + }, + "backup": { + "retentionDays": 21 + } + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/clusters/update.tf b/settings/remarks/microsoft.horizondb/samples/clusters/update.tf new file mode 100644 index 00000000..9957034d --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/clusters/update.tf @@ -0,0 +1,44 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "cluster_name" { + type = string + default = "example-cluster" + description = "The name of the HorizonDB cluster" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_update_resource" "clusters" { + type = "Microsoft.HorizonDb/clusters@2026-10-01-preview" + name = var.cluster_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + + body = { + tags = { + environment = "production" + team = "data-platform" + } + properties = { + network = { + publicAccess = "Disabled" + } + backup = { + retentionDays = 21 + } + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/settings/remarks/microsoft.horizondb/samples/parametergroups/create.bicep b/settings/remarks/microsoft.horizondb/samples/parametergroups/create.bicep index 92ac3998..d088f271 100644 --- a/settings/remarks/microsoft.horizondb/samples/parametergroups/create.bicep +++ b/settings/remarks/microsoft.horizondb/samples/parametergroups/create.bicep @@ -1,40 +1,36 @@ -@description('The name for the parameter group') -param parameterGroupName string -@description('The location for the parameter group') -param location string = 'eastus' -@description('The tags for the parameter group') -param tags object = { - env: 'dev' -} -@description('The database parameters for the parameter group') -param parameters array = [ - { - name: 'max_connections' - value: '200' - } - { - name: 'log_min_error_statement' - value: 'error' - } - { - name: 'shared_buffers' - value: '2000' - } -] -@description('The description of the parameter group') -param parameterGroupDescription string = 'Parameter group for high-throughput workloads' -@description('The PostgreSQL version for the parameter group') -param pgVersion int = 17 -@description('Whether to apply changes immediately') -param applyImmediately bool = true -resource parameterGroup 'Microsoft.HorizonDB/parameterGroups@2026-01-20-preview' = { +@description('The name of the parameter group') +param parameterGroupName string = 'production-parameters' + +resource horizonDbResource 'Microsoft.HorizonDb/parameterGroups@2026-10-01-preview' = { name: parameterGroupName - location: location - tags: tags + location: 'eastus2' + tags: { + environment: 'production' + } properties: { - parameters: parameters - description: parameterGroupDescription - pgVersion: pgVersion - applyImmediately: applyImmediately + postgreSqlVersion: '17' + parameters: [ + { + name: 'application_name' + value: 'horizondb-production' + } + { + name: 'autovacuum' + value: 'off' + } + { + name: 'wal_receiver_timeout' + value: '45000' + } + { + name: 'work_mem' + value: '8192' + } + { + name: 'xmlbinary' + value: 'base64' + } + ] + description: 'Parameters for production transactional workloads' } } diff --git a/settings/remarks/microsoft.horizondb/samples/parametergroups/create.json b/settings/remarks/microsoft.horizondb/samples/parametergroups/create.json index 2e18c3b4..6bd3e788 100644 --- a/settings/remarks/microsoft.horizondb/samples/parametergroups/create.json +++ b/settings/remarks/microsoft.horizondb/samples/parametergroups/create.json @@ -4,80 +4,46 @@ "parameters": { "parameterGroupName": { "type": "string", + "defaultValue": "production-parameters", "metadata": { - "description": "The name for the parameter group" - } - }, - "location": { - "type": "string", - "defaultValue": "eastus", - "metadata": { - "description": "The location for the parameter group" - } - }, - "tags": { - "type": "object", - "defaultValue": { - "env": "dev" - }, - "metadata": { - "description": "The tags for the parameter group" - } - }, - "parameters": { - "type": "array", - "defaultValue": [ - { - "name": "max_connections", - "value": "200" - }, - { - "name": "log_min_error_statement", - "value": "error" - }, - { - "name": "shared_buffers", - "value": "2000" - } - ], - "metadata": { - "description": "The database parameters for the parameter group" - } - }, - "parameterGroupDescription": { - "type": "string", - "defaultValue": "Parameter group for high-throughput workloads", - "metadata": { - "description": "The description of the parameter group" - } - }, - "pgVersion": { - "type": "int", - "defaultValue": 17, - "metadata": { - "description": "The PostgreSQL version for the parameter group" - } - }, - "applyImmediately": { - "type": "bool", - "defaultValue": true, - "metadata": { - "description": "Whether to apply changes immediately" + "description": "The name of the parameter group" } } }, "resources": [ { - "type": "Microsoft.HorizonDB/parameterGroups", - "apiVersion": "2026-01-20-preview", + "type": "Microsoft.HorizonDb/parameterGroups", + "apiVersion": "2026-10-01-preview", "name": "[parameters('parameterGroupName')]", - "location": "[parameters('location')]", - "tags": "[parameters('tags')]", + "location": "eastus2", + "tags": { + "environment": "production" + }, "properties": { - "parameters": "[parameters('parameters')]", - "description": "[parameters('parameterGroupDescription')]", - "pgVersion": "[parameters('pgVersion')]", - "applyImmediately": "[parameters('applyImmediately')]" + "postgreSqlVersion": "17", + "parameters": [ + { + "name": "application_name", + "value": "horizondb-production" + }, + { + "name": "autovacuum", + "value": "off" + }, + { + "name": "wal_receiver_timeout", + "value": "45000" + }, + { + "name": "work_mem", + "value": "8192" + }, + { + "name": "xmlbinary", + "value": "base64" + } + ], + "description": "Parameters for production transactional workloads" } } ] diff --git a/settings/remarks/microsoft.horizondb/samples/parametergroups/create.tf b/settings/remarks/microsoft.horizondb/samples/parametergroups/create.tf index 468ab9f1..6ef17289 100644 --- a/settings/remarks/microsoft.horizondb/samples/parametergroups/create.tf +++ b/settings/remarks/microsoft.horizondb/samples/parametergroups/create.tf @@ -12,81 +12,48 @@ provider "azapi" { variable "parameter_group_name" { type = string - description = "The name for the parameter group" -} - -variable "location" { - type = string - default = "eastus" - description = "The location for the parameter group" -} - -variable "tags" { - type = object({ - env = optional(string) - }) - default = { - env = "dev" - } - description = "The tags for the parameter group" -} - -variable "pg_version" { - type = number - default = 17 - description = "The PostgreSQL version for the parameter group" -} - -variable "apply_immediately" { - type = bool - default = true - description = "Whether to apply changes immediately" -} - -variable "parameter_group_description" { - type = string - default = "Parameter group for high-throughput workloads" - description = "The description of the parameter group" -} - -variable "parameters" { - type = list(object({ - name = string - value = string - })) - default = [ - { - name = "max_connections" - value = "200" - }, - { - name = "log_min_error_statement" - value = "error" - }, - { - name = "shared_buffers" - value = "2000" - } - ] - description = "The database parameters for the parameter group" + default = "production-parameters" + description = "The name of the parameter group" } data "azapi_client_config" "current" { } -resource "azapi_resource" "parameter_group" { - type = "Microsoft.HorizonDB/parameterGroups@2026-01-20-preview" +resource "azapi_resource" "parameter_groups" { + type = "Microsoft.HorizonDb/parameterGroups@2026-10-01-preview" name = var.parameter_group_name - location = var.location - parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}" + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + location = "eastus2" body = { - tags = var.tags + tags = { + environment = "production" + } properties = { - parameters = var.parameters - description = var.parameter_group_description - pgVersion = var.pg_version - applyImmediately = var.apply_immediately + postgreSqlVersion = "17" + parameters = [ + { + name = "application_name" + value = "horizondb-production" + }, + { + name = "autovacuum" + value = "off" + }, + { + name = "wal_receiver_timeout" + value = "45000" + }, + { + name = "work_mem" + value = "8192" + }, + { + name = "xmlbinary" + value = "base64" + }, + ] + description = "Parameters for production transactional workloads" } } diff --git a/settings/remarks/microsoft.horizondb/samples/parametergroups/update.bicep b/settings/remarks/microsoft.horizondb/samples/parametergroups/update.bicep new file mode 100644 index 00000000..4cbfafb3 --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/parametergroups/update.bicep @@ -0,0 +1,35 @@ +@description('The name of the parameter group') +param parameterGroupName string = 'production-parameters' + +resource horizonDbResource 'Microsoft.HorizonDb/parameterGroups@2026-10-01-preview' = { + name: parameterGroupName + tags: { + environment: 'production' + team: 'data-platform' + } + properties: { + parameters: [ + { + name: 'application_name' + value: 'horizondb-production' + } + { + name: 'autovacuum' + value: 'off' + } + { + name: 'wal_receiver_timeout' + value: '45000' + } + { + name: 'work_mem' + value: '8192' + } + { + name: 'xmlbinary' + value: 'base64' + } + ] + description: 'Updated parameters for production transactional workloads' + } +} diff --git a/settings/remarks/microsoft.horizondb/samples/parametergroups/update.json b/settings/remarks/microsoft.horizondb/samples/parametergroups/update.json new file mode 100644 index 00000000..ff0c046a --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/parametergroups/update.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "parameterGroupName": { + "type": "string", + "defaultValue": "production-parameters", + "metadata": { + "description": "The name of the parameter group" + } + } + }, + "resources": [ + { + "type": "Microsoft.HorizonDb/parameterGroups", + "apiVersion": "2026-10-01-preview", + "name": "[parameters('parameterGroupName')]", + "tags": { + "environment": "production", + "team": "data-platform" + }, + "properties": { + "parameters": [ + { + "name": "application_name", + "value": "horizondb-production" + }, + { + "name": "autovacuum", + "value": "off" + }, + { + "name": "wal_receiver_timeout", + "value": "45000" + }, + { + "name": "work_mem", + "value": "8192" + }, + { + "name": "xmlbinary", + "value": "base64" + } + ], + "description": "Updated parameters for production transactional workloads" + } + } + ] +} diff --git a/settings/remarks/microsoft.horizondb/samples/parametergroups/update.tf b/settings/remarks/microsoft.horizondb/samples/parametergroups/update.tf new file mode 100644 index 00000000..0f8a2fab --- /dev/null +++ b/settings/remarks/microsoft.horizondb/samples/parametergroups/update.tf @@ -0,0 +1,61 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "parameter_group_name" { + type = string + default = "production-parameters" + description = "The name of the parameter group" +} + +data "azapi_client_config" "current" { +} + +resource "azapi_update_resource" "parameter_groups" { + type = "Microsoft.HorizonDb/parameterGroups@2026-10-01-preview" + name = var.parameter_group_name + parent_id = "/subscriptions/${data.azapi_client_config.current.subscription_id}/resourceGroups/${data.azapi_client_config.current.resource_group_name}/providers/Microsoft.HorizonDb" + + body = { + tags = { + environment = "production" + team = "data-platform" + } + properties = { + parameters = [ + { + name = "application_name" + value = "horizondb-production" + }, + { + name = "autovacuum" + value = "off" + }, + { + name = "wal_receiver_timeout" + value = "45000" + }, + { + name = "work_mem" + value = "8192" + }, + { + name = "xmlbinary" + value = "base64" + }, + ] + description = "Updated parameters for production transactional workloads" + } + } + + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs b/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs new file mode 100644 index 00000000..6b58bef4 --- /dev/null +++ b/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + + +using FluentAssertions; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TemplateRefGenerator; + +namespace TemplateRefGenerator.Tests; +[TestClass] +public class RemarksLoaderTests +{ + [TestMethod] + [DataRow("2026-10-01-preview", null, "2026-01-20-preview", false)] + [DataRow("2026-10-01-preview", null, "2026-10-01-preview", true)] + [DataRow("2026-10-01-preview", null, "2027-01-01", true)] + [DataRow(null, "2026-10-01-preview", "2026-01-20-preview", true)] + [DataRow(null, "2026-10-01-preview", "2026-10-01-preview", true)] + [DataRow(null, "2026-10-01-preview", "2027-01-01", false)] + public void Code_samples_are_filtered_by_api_version_range( + string? minimum, + string? maximum, + string apiVersion, + bool expected) + { + var sample = new RemarksLoader.CodeSample( + "Microsoft.Test/widgets", + new RemarksLoader.ApiVersionRequirement(minimum, maximum), + "samples/widget.bicep", + "Deploy a widget."); + var remarks = new RemarksLoader.RemarksFile(null, null, null, [sample], null, null); + var resource = new MarkdownGenerator.ResourceMetadata( + "Microsoft.Test", + "Microsoft.Test/widgets", + "widgets", + apiVersion, + null!, + false, + false); + + var samples = remarks.GetBicepSamples(resource); + + if (expected) + { + samples.Should().ContainSingle().Which.Should().Be(sample); + } + else + { + samples.Should().BeEmpty(); + } + } +} diff --git a/src/TemplateRefGenerator/Config/RemarksLoader.cs b/src/TemplateRefGenerator/Config/RemarksLoader.cs index 8cc1aa4c..31e743c6 100644 --- a/src/TemplateRefGenerator/Config/RemarksLoader.cs +++ b/src/TemplateRefGenerator/Config/RemarksLoader.cs @@ -91,8 +91,8 @@ public IEnumerable GetTerraformSamples(MarkdownGenerator.ResourceMet .Where(r => FilterApiVersions(resource, r.ApiVersion)); private static bool FilterApiVersions(MarkdownGenerator.ResourceMetadata resource, ApiVersionRequirement? apiVersionRequirement) - => (apiVersionRequirement?.Minimum is null || ApiVersionComparer.Instance.Compare(apiVersionRequirement.Minimum, resource.ApiVersion) >= 0) && - (apiVersionRequirement?.Maximum is null || ApiVersionComparer.Instance.Compare(apiVersionRequirement.Maximum, resource.ApiVersion) <= 0); + => (apiVersionRequirement?.Minimum is null || ApiVersionComparer.Instance.Compare(apiVersionRequirement.Minimum, resource.ApiVersion) <= 0) && + (apiVersionRequirement?.Maximum is null || ApiVersionComparer.Instance.Compare(apiVersionRequirement.Maximum, resource.ApiVersion) >= 0); } public string GetCodeSample(string providerNamespace, CodeSample sample) From 76ca854c04c3bef02df6011e5062abee684e288f Mon Sep 17 00:00:00 2001 From: Nacho Alonso Portillo Date: Fri, 16 Oct 2026 16:23:24 +0200 Subject: [PATCH 2/7] Update vulnerable cryptography packages Pin patched .NET 8 package versions so NuGet audit no longer fails CI restore. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Directory.Packages.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 5306e326..7d5d73ca 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -15,6 +15,7 @@ - + + From f080a8fcc323bec311868eefa532a6ddf903544a Mon Sep 17 00:00:00 2001 From: Nacho Alonso Portillo Date: Fri, 16 Oct 2026 16:56:07 +0200 Subject: [PATCH 3/7] Handle read-only resource documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../remarks/microsoft.horizondb/remarks.json | 21 ++ settings/schemas/remarks.schema.json | 24 ++ .../MarkdownGeneratorTests.cs | 13 + .../RemarksLoaderTests.cs | 23 +- .../Config/RemarksLoader.cs | 14 +- .../Generators/MarkdownGenerator.cs | 244 +++++++++++------- 6 files changed, 246 insertions(+), 93 deletions(-) diff --git a/settings/remarks/microsoft.horizondb/remarks.json b/settings/remarks/microsoft.horizondb/remarks.json index 7531148d..2507e95f 100644 --- a/settings/remarks/microsoft.horizondb/remarks.json +++ b/settings/remarks/microsoft.horizondb/remarks.json @@ -1,5 +1,26 @@ { "$schema": "../../schemas/remarks.schema.json", + "ReadOnlyResources": [ + { + "ResourceTypes": [ + "Microsoft.HorizonDb/clusters/logFiles" + ], + "ApiVersion": { + "Minimum": "2026-10-01-preview" + } + } + ], + "ResourceRemarks": [ + { + "ResourceTypes": [ + "Microsoft.HorizonDb/clusters/logFiles" + ], + "ApiVersion": { + "Minimum": "2026-10-01-preview" + }, + "Description": "Log file resources are created and managed by HorizonDB when log capture is enabled through the Microsoft.HorizonDb/clusters/logCaptureConfigurations resource." + } + ], "TerraformSamples": [ { "ResourceType": "Microsoft.HorizonDb/clusters/changeDataCapture", diff --git a/settings/schemas/remarks.schema.json b/settings/schemas/remarks.schema.json index 94279dc8..3fb03bb7 100644 --- a/settings/schemas/remarks.schema.json +++ b/settings/schemas/remarks.schema.json @@ -11,6 +11,12 @@ "$ref": "#/definitions/ResourceRemark" } }, + "ReadOnlyResources": { + "type": "array", + "items": { + "$ref": "#/definitions/ReadOnlyResource" + } + }, "PropertyRemarks": { "type": "array", "items": { @@ -78,6 +84,24 @@ ], "additionalProperties": false }, + "ReadOnlyResource": { + "type": "object", + "properties": { + "ResourceTypes": { + "type": "array", + "items": { + "type": "string" + } + }, + "ApiVersion": { + "$ref": "#/definitions/ApiVersionRequirement" + } + }, + "required": [ + "ResourceTypes" + ], + "additionalProperties": false + }, "PropertyRemark": { "type": "object", "properties": { diff --git a/src/TemplateRefGenerator.Tests/MarkdownGeneratorTests.cs b/src/TemplateRefGenerator.Tests/MarkdownGeneratorTests.cs index 6567632c..d84e7f2d 100644 --- a/src/TemplateRefGenerator.Tests/MarkdownGeneratorTests.cs +++ b/src/TemplateRefGenerator.Tests/MarkdownGeneratorTests.cs @@ -7,6 +7,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using Azure.Bicep.Types.Az; +using Azure.Bicep.Types.Concrete; using Azure.Deployments.Testing.Utilities; using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -44,4 +45,16 @@ public void Markdown_generation_works(EmbeddedFile embeddedFile) markdownFile.WriteToOutputFolder(markdown); markdownFile.ShouldHaveExpectedValue(); } + + [TestMethod] + public void Read_only_resources_must_be_explicitly_configured() + { + var typeProvider = new ResourceTypeProvider(new AzTypeLoader()); + var resourceType = typeProvider.GetResourceTypes() + .Select(x => typeProvider.Get(x.resourceType, x.apiVersion)) + .First(x => Utils.HasWritableScope(x, ScopeType.None)); + + MarkdownGenerator.IsReadOnlyResource(resourceType, isConfiguredReadOnly: true).Should().BeTrue(); + MarkdownGenerator.IsReadOnlyResource(resourceType, isConfiguredReadOnly: false).Should().BeFalse(); + } } \ No newline at end of file diff --git a/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs b/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs index 6b58bef4..5e1538ce 100644 --- a/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs +++ b/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs @@ -28,7 +28,7 @@ public void Code_samples_are_filtered_by_api_version_range( new RemarksLoader.ApiVersionRequirement(minimum, maximum), "samples/widget.bicep", "Deploy a widget."); - var remarks = new RemarksLoader.RemarksFile(null, null, null, [sample], null, null); + var remarks = new RemarksLoader.RemarksFile(null, null, null, [sample], null, null, null); var resource = new MarkdownGenerator.ResourceMetadata( "Microsoft.Test", "Microsoft.Test/widgets", @@ -49,4 +49,25 @@ public void Code_samples_are_filtered_by_api_version_range( samples.Should().BeEmpty(); } } + + [TestMethod] + [DataRow("2026-01-20-preview", false)] + [DataRow("2026-10-01-preview", true)] + public void Read_only_resources_are_filtered_by_api_version(string apiVersion, bool expected) + { + var readOnlyResource = new RemarksLoader.ReadOnlyResource( + ["Microsoft.Test/widgets"], + new RemarksLoader.ApiVersionRequirement("2026-10-01-preview", null)); + var remarks = new RemarksLoader.RemarksFile(null, null, null, null, null, null, [readOnlyResource]); + var resource = new MarkdownGenerator.ResourceMetadata( + "Microsoft.Test", + "Microsoft.Test/widgets", + "widgets", + apiVersion, + null!, + false, + false); + + remarks.IsReadOnlyResource(resource).Should().Be(expected); + } } diff --git a/src/TemplateRefGenerator/Config/RemarksLoader.cs b/src/TemplateRefGenerator/Config/RemarksLoader.cs index 31e743c6..eff1cc0a 100644 --- a/src/TemplateRefGenerator/Config/RemarksLoader.cs +++ b/src/TemplateRefGenerator/Config/RemarksLoader.cs @@ -29,6 +29,10 @@ public record ResourceRemark( ApiVersionRequirement? ApiVersion, string Description); + public record ReadOnlyResource( + ImmutableArray ResourceTypes, + ApiVersionRequirement? ApiVersion); + public record PropertyRemark( string ResourceType, ApiVersionRequirement? ApiVersion, @@ -54,10 +58,16 @@ public record RemarksFile( ImmutableArray? DeploymentRemarks, ImmutableArray? BicepSamples, ImmutableArray? ArmTemplateSamples, - ImmutableArray? TerraformSamples) + ImmutableArray? TerraformSamples, + ImmutableArray? ReadOnlyResources) { public static RemarksFile Empty - => new(null, null, null, null, null, null); + => new(null, null, null, null, null, null, null); + + public bool IsReadOnlyResource(MarkdownGenerator.ResourceMetadata resource) + => (ReadOnlyResources ?? []) + .Where(r => r.ResourceTypes.Contains(resource.ResourceType, StringComparer.OrdinalIgnoreCase)) + .Any(r => FilterApiVersions(resource, r.ApiVersion)); public IEnumerable GetResourceRemarks(MarkdownGenerator.ResourceMetadata resource) => (ResourceRemarks ?? []) diff --git a/src/TemplateRefGenerator/Generators/MarkdownGenerator.cs b/src/TemplateRefGenerator/Generators/MarkdownGenerator.cs index 81d4e6bf..e303c313 100644 --- a/src/TemplateRefGenerator/Generators/MarkdownGenerator.cs +++ b/src/TemplateRefGenerator/Generators/MarkdownGenerator.cs @@ -79,15 +79,18 @@ public static IEnumerable> GetOrderedWr => properties.Where(x => !x.Value.Flags.HasFlag(ObjectTypePropertyFlags.ReadOnly)) .OrderBy(x => x.Key, StringComparer.OrdinalIgnoreCase); - private static string GetHeading(ResourceMetadata resource, bool isLatestVersionPage) + private static string GetHeading(ResourceMetadata resource, bool isLatestVersionPage, bool isReadOnly) { var pageTitle = isLatestVersionPage ? resource.ResourceType : $"{resource.ResourceType} {resource.ApiVersion}"; var apiVersion = isLatestVersionPage ? "latest" : resource.ApiVersion; + var description = isReadOnly + ? $"Azure {resource.ResourceType} reference for retrieving the resource. API version {apiVersion}" + : $"Azure {resource.ResourceType} syntax and properties to use in Azure Resource Manager templates for deploying the resource. API version {apiVersion}"; return $""" --- title: {pageTitle} -description: Azure {resource.ResourceType} syntax and properties to use in Azure Resource Manager templates for deploying the resource. API version {apiVersion} +description: {description} zone_pivot_groups: deployment-languages-reference ms.service: azure-resource-manager ms.topic: reference @@ -95,6 +98,9 @@ private static string GetHeading(ResourceMetadata resource, bool isLatestVersion """; } + public static bool IsReadOnlyResource(ResourceType resourceType, bool isConfiguredReadOnly) + => Utils.HasWritableScope(resourceType, ScopeType.None) && isConfiguredReadOnly; + private static string GetApiVersionLinks(GroupedTypes groupedTypes, ResourceMetadata resource, bool isLatestVersionPage) { var pathDepth = resource.UnqualifiedResourceType.Split('/').Length; @@ -278,7 +284,7 @@ private static string GetJsonQuickstartsSection(SamplesFile samples, ResourceMet return sb.ToString(); } - private static string GetBicepZone(ConfigLoader configLoader, RemarksLoader remarksLoader, ResourceMetadata resource, ImmutableArray namedTypes, RemarksFile remarks, int anchorIndex) + private static string GetBicepZone(ConfigLoader configLoader, RemarksLoader remarksLoader, ResourceMetadata resource, ImmutableArray namedTypes, RemarksFile remarks, int anchorIndex, bool isReadOnly) { var sb = new StringBuilder(); sb.Append($""" @@ -286,37 +292,51 @@ private static string GetBicepZone(ConfigLoader configLoader, RemarksLoader rema ## Bicep resource definition +"""); + sb.AppendLine(); + + if (isReadOnly) + { + sb.Append($""" +The {resource.UnqualifiedResourceType} resource type is read-only and cannot be deployed. Existing instances can be retrieved through resource provider operations. + +"""); + } + else + { + sb.Append($""" The {resource.UnqualifiedResourceType} resource type can be deployed with operations that target: """); - if (Utils.HasWritableScope(resource.Type, ScopeType.Tenant)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.Tenant)) + { + sb.Append($""" * **Tenant** - See {MarkdownUtils.GetLink("tenant deployment commands", "/azure/azure-resource-manager/bicep/deploy-to-tenant")} """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.ManagementGroup)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.ManagementGroup)) + { + sb.Append($""" * **Management groups** - See {MarkdownUtils.GetLink("management group deployment commands", "/azure/azure-resource-manager/bicep/deploy-to-management-group")} """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.Subscription)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.Subscription)) + { + sb.Append($""" * **Subscription** - See {MarkdownUtils.GetLink("subscription deployment commands", "/azure/azure-resource-manager/bicep/deploy-to-subscription")} """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.ResourceGroup)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.ResourceGroup)) + { + sb.Append($""" * **Resource groups** - See {MarkdownUtils.GetLink("resource group deployment commands", "/azure/azure-resource-manager/bicep/deploy-to-resource-group")} """); + } } sb.Append($""" @@ -324,16 +344,20 @@ private static string GetBicepZone(ConfigLoader configLoader, RemarksLoader rema For a list of changed properties in each API version, see {MarkdownUtils.GetLink("change log", $"~/{resource.Provider.ToLowerInvariant()}/change-log/{resource.UnqualifiedResourceType.ToLowerInvariant()}.md")}. -{GenerateOptionalSection("Usage Examples", [ +"""); + sb.AppendLine(); + + if (!isReadOnly) + { + sb.Append(GenerateOptionalSection("Usage Examples", [ GetBicepSamplesSection(remarksLoader, resource, remarks), GetAvmSection(configLoader.GetSamples(), AvmLinkType.Bicep, resource), GetBicepQuickstartsSection(configLoader.GetSamples(), resource), -])} -"""); +])); - var samples = CodeSampleGenerator.GetExample(resource, namedTypes, CodeSampleGenerator.Flavor.Bicep); + var samples = CodeSampleGenerator.GetExample(resource, namedTypes, CodeSampleGenerator.Flavor.Bicep); - sb.Append($""" + sb.Append($""" ## Resource format @@ -345,11 +369,11 @@ private static string GetBicepZone(ConfigLoader configLoader, RemarksLoader rema """); - sb.Append(GetDeploymentRemarks(resource, remarks, DeploymentType.Bicep)); + sb.Append(GetDeploymentRemarks(resource, remarks, DeploymentType.Bicep)); - foreach (var (discObjectType, discSamples) in samples.DiscrimatedSamples) - { - sb.Append($""" + foreach (var (discObjectType, discSamples) in samples.DiscrimatedSamples) + { + sb.Append($""" ### {discObjectType.Name} objects Set the **{discObjectType.Discriminator}** property to specify the type of object. @@ -357,9 +381,9 @@ Set the **{discObjectType.Discriminator}** property to specify the type of objec """); - foreach (var discSample in discSamples) - { - sb.Append($""" + foreach (var discSample in discSamples) + { + sb.Append($""" For **{discSample.DiscriminatorValue}**, use: ```bicep @@ -368,6 +392,7 @@ Set the **{discObjectType.Discriminator}** property to specify the type of objec """); + } } } @@ -410,7 +435,7 @@ private static string GenerateOptionalSection(string heading, string?[] sections } - private static string GetArmTemplateZone(ConfigLoader configLoader, RemarksLoader remarksLoader, ResourceMetadata resource, ImmutableArray namedTypes, RemarksFile remarks, int anchorIndex) + private static string GetArmTemplateZone(ConfigLoader configLoader, RemarksLoader remarksLoader, ResourceMetadata resource, ImmutableArray namedTypes, RemarksFile remarks, int anchorIndex, bool isReadOnly) { var sb = new StringBuilder(); sb.Append($""" @@ -418,52 +443,70 @@ private static string GetArmTemplateZone(ConfigLoader configLoader, RemarksLoade ## ARM template resource definition +"""); + sb.AppendLine(); + + if (isReadOnly) + { + sb.Append($""" +The {resource.UnqualifiedResourceType} resource type is read-only and cannot be deployed. Existing instances can be retrieved through resource provider operations. + +"""); + } + else + { + sb.Append($""" The {resource.UnqualifiedResourceType} resource type can be deployed with operations that target: """); - if (Utils.HasWritableScope(resource.Type, ScopeType.Tenant)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.Tenant)) + { + sb.Append($""" * **Tenant** - See {MarkdownUtils.GetLink("tenant deployment commands", "/azure/azure-resource-manager/templates/deploy-to-tenant")} """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.ManagementGroup)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.ManagementGroup)) + { + sb.Append($""" * **Management groups** - See {MarkdownUtils.GetLink("management group deployment commands", "/azure/azure-resource-manager/templates/deploy-to-management-group")} """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.Subscription)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.Subscription)) + { + sb.Append($""" * **Subscription** - See {MarkdownUtils.GetLink("subscription deployment commands", "/azure/azure-resource-manager/templates/deploy-to-subscription")} """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.ResourceGroup)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.ResourceGroup)) + { + sb.Append($""" * **Resource groups** - See {MarkdownUtils.GetLink("resource group deployment commands", "/azure/azure-resource-manager/templates/deploy-to-resource-group")} """); + } } sb.Append($""" For a list of changed properties in each API version, see {MarkdownUtils.GetLink("change log", $"~/{resource.Provider.ToLowerInvariant()}/change-log/{resource.UnqualifiedResourceType.ToLowerInvariant()}.md")}. -{GenerateOptionalSection("Usage Examples", [ +"""); + sb.AppendLine(); + + if (!isReadOnly) + { + sb.Append(GenerateOptionalSection("Usage Examples", [ GetArmTemplateSamplesSection(remarksLoader, resource, remarks), GetJsonQuickstartsSection(configLoader.GetSamples(), resource), -])} -"""); +])); - var samples = CodeSampleGenerator.GetExample(resource, namedTypes, CodeSampleGenerator.Flavor.Json); + var samples = CodeSampleGenerator.GetExample(resource, namedTypes, CodeSampleGenerator.Flavor.Json); - sb.Append($""" + sb.Append($""" ## Resource format @@ -475,11 +518,11 @@ private static string GetArmTemplateZone(ConfigLoader configLoader, RemarksLoade """); - sb.Append(GetDeploymentRemarks(resource, remarks, DeploymentType.Json)); + sb.Append(GetDeploymentRemarks(resource, remarks, DeploymentType.Json)); - foreach (var (discObjectType, discSamples) in samples.DiscrimatedSamples) - { - sb.Append($""" + foreach (var (discObjectType, discSamples) in samples.DiscrimatedSamples) + { + sb.Append($""" ### {discObjectType.Name} objects Set the **{discObjectType.Discriminator}** property to specify the type of object. @@ -487,9 +530,9 @@ Set the **{discObjectType.Discriminator}** property to specify the type of objec """); - foreach (var discSample in discSamples) - { - sb.Append($""" + foreach (var discSample in discSamples) + { + sb.Append($""" For **{discSample.DiscriminatorValue}**, use: ```json @@ -498,6 +541,7 @@ Set the **{discObjectType.Discriminator}** property to specify the type of objec """); + } } } @@ -514,7 +558,7 @@ Set the **{discObjectType.Discriminator}** property to specify the type of objec return sb.ToString(); } - private static string GetTerraformZone(ConfigLoader configLoader, RemarksLoader remarksLoader, ResourceMetadata resource, ImmutableArray namedTypes, RemarksFile remarks, int anchorIndex) + private static string GetTerraformZone(ConfigLoader configLoader, RemarksLoader remarksLoader, ResourceMetadata resource, ImmutableArray namedTypes, RemarksFile remarks, int anchorIndex, bool isReadOnly) { var sb = new StringBuilder(); sb.Append($""" @@ -522,52 +566,70 @@ private static string GetTerraformZone(ConfigLoader configLoader, RemarksLoader ## Terraform (AzAPI provider) resource definition +"""); + sb.AppendLine(); + + if (isReadOnly) + { + sb.Append($""" +The {resource.UnqualifiedResourceType} resource type is read-only and cannot be deployed. Existing instances can be retrieved through resource provider operations. + +"""); + } + else + { + sb.Append($""" The {resource.UnqualifiedResourceType} resource type can be deployed with operations that target: """); - if (Utils.HasWritableScope(resource.Type, ScopeType.Tenant)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.Tenant)) + { + sb.Append($""" * **Tenant** """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.ManagementGroup)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.ManagementGroup)) + { + sb.Append($""" * **Management groups** """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.Subscription)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.Subscription)) + { + sb.Append($""" * **Subscription** """); - } + } - if (Utils.HasWritableScope(resource.Type, ScopeType.ResourceGroup)) - { - sb.Append($""" + if (Utils.HasWritableScope(resource.Type, ScopeType.ResourceGroup)) + { + sb.Append($""" * **Resource groups** """); + } } sb.Append($""" For a list of changed properties in each API version, see {MarkdownUtils.GetLink("change log", $"~/{resource.Provider.ToLowerInvariant()}/change-log/{resource.UnqualifiedResourceType.ToLowerInvariant()}.md")}. -{GenerateOptionalSection("Usage Examples", [ +"""); + sb.AppendLine(); + + if (!isReadOnly) + { + sb.Append(GenerateOptionalSection("Usage Examples", [ GetTerraformSamplesSection(remarksLoader, resource, remarks), GetAvmSection(configLoader.GetSamples(), AvmLinkType.Terraform, resource), -])} -"""); +])); - var samples = CodeSampleGenerator.GetExample(resource, namedTypes, CodeSampleGenerator.Flavor.Terraform); + var samples = CodeSampleGenerator.GetExample(resource, namedTypes, CodeSampleGenerator.Flavor.Terraform); - sb.Append($""" + sb.Append($""" ## Resource format @@ -579,11 +641,11 @@ private static string GetTerraformZone(ConfigLoader configLoader, RemarksLoader """); - sb.Append(GetDeploymentRemarks(resource, remarks, DeploymentType.Terraform)); + sb.Append(GetDeploymentRemarks(resource, remarks, DeploymentType.Terraform)); - foreach (var (discObjectType, discSamples) in samples.DiscrimatedSamples) - { - sb.Append($""" + foreach (var (discObjectType, discSamples) in samples.DiscrimatedSamples) + { + sb.Append($""" ### {discObjectType.Name} objects Set the **{discObjectType.Discriminator}** property to specify the type of object. @@ -591,9 +653,9 @@ Set the **{discObjectType.Discriminator}** property to specify the type of objec """); - foreach (var discSample in discSamples) - { - sb.Append($""" + foreach (var discSample in discSamples) + { + sb.Append($""" For **{discSample.DiscriminatorValue}**, use: ```terraform @@ -602,6 +664,7 @@ Set the **{discObjectType.Discriminator}** property to specify the type of objec """); + } } } @@ -1073,17 +1136,18 @@ public static string GenerateMarkdown(GroupedTypes groupedTypes, ResourceType re var namedTypes = GetNamedTypes(resource); var remarks = remarksLoader.GetRemarks(providerNamespace); + var isReadOnly = IsReadOnlyResource(resource.Type, remarks.IsReadOnlyResource(resource)); var pageTitle = isLatestVersionPage ? $"{resource.Provider} {resource.UnqualifiedResourceType}" : $"{resource.Provider} {resource.UnqualifiedResourceType} {resource.ApiVersion}"; return $""" -{GetHeading(resource, isLatestVersionPage)} +{GetHeading(resource, isLatestVersionPage, isReadOnly)} # {pageTitle} {GetApiVersionLinks(groupedTypes, resource, isLatestVersionPage)} {GetResourceRemarks(resource, remarks)} -{GetBicepZone(configLoader, remarksLoader, resource, namedTypes, remarks, 0)} -{GetArmTemplateZone(configLoader, remarksLoader, resource, namedTypes, remarks, 1)} -{GetTerraformZone(configLoader, remarksLoader, resource, namedTypes, remarks, 2)} +{GetBicepZone(configLoader, remarksLoader, resource, namedTypes, remarks, 0, isReadOnly)} +{GetArmTemplateZone(configLoader, remarksLoader, resource, namedTypes, remarks, 1, isReadOnly)} +{GetTerraformZone(configLoader, remarksLoader, resource, namedTypes, remarks, 2, isReadOnly)} """; } From 39ccfc17ee828e570b6d2d30c2e6e731bc305ec1 Mon Sep 17 00:00:00 2001 From: Nacho Alonso Portillo Date: Fri, 16 Oct 2026 17:00:20 +0200 Subject: [PATCH 4/7] Apply read-only remarks across API versions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- settings/remarks/microsoft.horizondb/remarks.json | 8 +------- settings/schemas/remarks.schema.json | 3 --- .../RemarksLoaderTests.cs | 13 ++++++------- src/TemplateRefGenerator/Config/RemarksLoader.cs | 6 ++---- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/settings/remarks/microsoft.horizondb/remarks.json b/settings/remarks/microsoft.horizondb/remarks.json index 2507e95f..87d6151e 100644 --- a/settings/remarks/microsoft.horizondb/remarks.json +++ b/settings/remarks/microsoft.horizondb/remarks.json @@ -4,10 +4,7 @@ { "ResourceTypes": [ "Microsoft.HorizonDb/clusters/logFiles" - ], - "ApiVersion": { - "Minimum": "2026-10-01-preview" - } + ] } ], "ResourceRemarks": [ @@ -15,9 +12,6 @@ "ResourceTypes": [ "Microsoft.HorizonDb/clusters/logFiles" ], - "ApiVersion": { - "Minimum": "2026-10-01-preview" - }, "Description": "Log file resources are created and managed by HorizonDB when log capture is enabled through the Microsoft.HorizonDb/clusters/logCaptureConfigurations resource." } ], diff --git a/settings/schemas/remarks.schema.json b/settings/schemas/remarks.schema.json index 3fb03bb7..fdff8a5c 100644 --- a/settings/schemas/remarks.schema.json +++ b/settings/schemas/remarks.schema.json @@ -92,9 +92,6 @@ "items": { "type": "string" } - }, - "ApiVersion": { - "$ref": "#/definitions/ApiVersionRequirement" } }, "required": [ diff --git a/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs b/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs index 5e1538ce..32e98354 100644 --- a/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs +++ b/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs @@ -51,17 +51,16 @@ public void Code_samples_are_filtered_by_api_version_range( } [TestMethod] - [DataRow("2026-01-20-preview", false)] - [DataRow("2026-10-01-preview", true)] - public void Read_only_resources_are_filtered_by_api_version(string apiVersion, bool expected) + [DataRow("Microsoft.Test/widgets", "2026-01-20-preview", true)] + [DataRow("Microsoft.Test/widgets", "2026-10-01-preview", true)] + [DataRow("Microsoft.Test/gadgets", "2026-10-01-preview", false)] + public void Read_only_resources_apply_to_all_api_versions(string resourceType, string apiVersion, bool expected) { - var readOnlyResource = new RemarksLoader.ReadOnlyResource( - ["Microsoft.Test/widgets"], - new RemarksLoader.ApiVersionRequirement("2026-10-01-preview", null)); + var readOnlyResource = new RemarksLoader.ReadOnlyResource(["Microsoft.Test/widgets"]); var remarks = new RemarksLoader.RemarksFile(null, null, null, null, null, null, [readOnlyResource]); var resource = new MarkdownGenerator.ResourceMetadata( "Microsoft.Test", - "Microsoft.Test/widgets", + resourceType, "widgets", apiVersion, null!, diff --git a/src/TemplateRefGenerator/Config/RemarksLoader.cs b/src/TemplateRefGenerator/Config/RemarksLoader.cs index eff1cc0a..4cf11536 100644 --- a/src/TemplateRefGenerator/Config/RemarksLoader.cs +++ b/src/TemplateRefGenerator/Config/RemarksLoader.cs @@ -30,8 +30,7 @@ public record ResourceRemark( string Description); public record ReadOnlyResource( - ImmutableArray ResourceTypes, - ApiVersionRequirement? ApiVersion); + ImmutableArray ResourceTypes); public record PropertyRemark( string ResourceType, @@ -66,8 +65,7 @@ public static RemarksFile Empty public bool IsReadOnlyResource(MarkdownGenerator.ResourceMetadata resource) => (ReadOnlyResources ?? []) - .Where(r => r.ResourceTypes.Contains(resource.ResourceType, StringComparer.OrdinalIgnoreCase)) - .Any(r => FilterApiVersions(resource, r.ApiVersion)); + .Any(r => r.ResourceTypes.Contains(resource.ResourceType, StringComparer.OrdinalIgnoreCase)); public IEnumerable GetResourceRemarks(MarkdownGenerator.ResourceMetadata resource) => (ResourceRemarks ?? []) From 9b541d59cbe795e3dec0d93de9713bad382b239f Mon Sep 17 00:00:00 2001 From: Nacho Alonso Portillo Date: Fri, 16 Oct 2026 17:03:55 +0200 Subject: [PATCH 5/7] Mark HorizonDB service-managed resources read-only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- settings/remarks/microsoft.horizondb/remarks.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/settings/remarks/microsoft.horizondb/remarks.json b/settings/remarks/microsoft.horizondb/remarks.json index 87d6151e..555fd19e 100644 --- a/settings/remarks/microsoft.horizondb/remarks.json +++ b/settings/remarks/microsoft.horizondb/remarks.json @@ -3,7 +3,13 @@ "ReadOnlyResources": [ { "ResourceTypes": [ - "Microsoft.HorizonDb/clusters/logFiles" + "Microsoft.HorizonDb/clusters/endpoints", + "Microsoft.HorizonDb/clusters/logFiles", + "Microsoft.HorizonDb/clusters/pools/maintenanceEvents", + "Microsoft.HorizonDb/clusters/pools/nodes", + "Microsoft.HorizonDb/clusters/privateLinkResources", + "Microsoft.HorizonDb/locations/capabilities", + "Microsoft.HorizonDb/locations/parameterGroups" ] } ], From 34df60fd453922cfe0cb720b4e61b9d5b4860cc3 Mon Sep 17 00:00:00 2001 From: Nacho Alonso Portillo Date: Fri, 16 Oct 2026 17:09:52 +0200 Subject: [PATCH 6/7] Support provider API version exclusions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/dev_guide.md | 20 ++++- settings/config/config.json | 9 +++ settings/schemas/config.schema.json | 28 ++++++- .../MainGeneratorTests.cs | 77 +++++++++++++++++++ .../Config/ConfigLoader.cs | 7 +- src/TemplateRefGenerator/MainGenerator.cs | 31 +++++++- 6 files changed, 168 insertions(+), 4 deletions(-) create mode 100644 src/TemplateRefGenerator.Tests/MainGeneratorTests.cs diff --git a/docs/dev_guide.md b/docs/dev_guide.md index c3b09f36..ea765064 100644 --- a/docs/dev_guide.md +++ b/docs/dev_guide.md @@ -46,4 +46,22 @@ Here's an example of how you can run the CLI tool: src/TemplateRefGenerator/bin/Debug/net10.0/TemplateRefGenerator --source-folder ../bicep-types-az/generated --output-folder ./generated ``` -To get detailed logging, use the `--verbose` flag. \ No newline at end of file +To get detailed logging, use the `--verbose` flag. + +## Excluding API versions + +To omit specific API versions for a provider, add an optional `ExcludedApiVersions` entry to `settings/config/config.json`: + +```json +"ExcludedApiVersions": [ + { + "ProviderNamespace": "Microsoft.Example", + "ApiVersions": [ + "2024-01-01", + "2024-06-01-preview" + ] + } +] +``` + +Exclusions are matched case-insensitively. If `ExcludedApiVersions` is omitted or empty, the generator produces documentation for every available API version. Versions that aren't present in the source types are ignored. diff --git a/settings/config/config.json b/settings/config/config.json index a0ae5603..2bf69aaa 100644 --- a/settings/config/config.json +++ b/settings/config/config.json @@ -278,5 +278,14 @@ "microsoft.storage.admin", "microsoft.subscriptions.admin", "microsoft.update.admin" + ], + "ExcludedApiVersions": [ + { + "ProviderNamespace": "Microsoft.HorizonDb", + "ApiVersions": [ + "2026-01-20-preview", + "2026-05-01-preview" + ] + } ] } \ No newline at end of file diff --git a/settings/schemas/config.schema.json b/settings/schemas/config.schema.json index 5a13beeb..fe74bdbc 100644 --- a/settings/schemas/config.schema.json +++ b/settings/schemas/config.schema.json @@ -16,6 +16,12 @@ "items": { "type": "string" } + }, + "ExcludedApiVersions": { + "type": "array", + "items": { + "$ref": "#/definitions/ApiVersionExclusion" + } } }, "required": [ @@ -23,5 +29,25 @@ "ExcludedProviders" ], "additionalProperties": false, - "definitions": {} + "definitions": { + "ApiVersionExclusion": { + "type": "object", + "properties": { + "ProviderNamespace": { + "type": "string" + }, + "ApiVersions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "ProviderNamespace", + "ApiVersions" + ], + "additionalProperties": false + } + } } \ No newline at end of file diff --git a/src/TemplateRefGenerator.Tests/MainGeneratorTests.cs b/src/TemplateRefGenerator.Tests/MainGeneratorTests.cs new file mode 100644 index 00000000..b207a3c7 --- /dev/null +++ b/src/TemplateRefGenerator.Tests/MainGeneratorTests.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Collections.Immutable; +using FluentAssertions; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TemplateRefGenerator; + +namespace TemplateRefGenerator.Tests; + +[TestClass] +public class MainGeneratorTests +{ + private static readonly MarkdownGenerator.GroupedTypes GroupedTypes = new( + "Microsoft.Test", + new Dictionary>(StringComparer.OrdinalIgnoreCase) + { + ["2024-01-01"] = ["Microsoft.Test/widgets"], + ["2025-01-01"] = ["Microsoft.Test/widgets"], + }.ToImmutableDictionary(StringComparer.OrdinalIgnoreCase)); + + private static readonly ImmutableDictionary EmptyTocMapping = []; + + [TestMethod] + public void All_api_versions_are_included_when_exclusions_are_not_configured() + { + var config = Utils.DeserializeJsonFile( + "config.json", + """ + { + "TocTitleMapping": {}, + "ExcludedProviders": [] + } + """); + + var result = MainGenerator.ApplyApiVersionExclusions(GroupedTypes, config); + + result.Should().BeSameAs(GroupedTypes); + } + + [TestMethod] + public void Configured_api_versions_are_excluded_for_the_matching_provider() + { + var exclusion = new ConfigLoader.ApiVersionExclusion("microsoft.test", ["2024-01-01"]); + var config = new ConfigLoader.ConfigFile(EmptyTocMapping, [], [exclusion]); + + var result = MainGenerator.ApplyApiVersionExclusions(GroupedTypes, config); + + result.Should().NotBeNull(); + result!.ResourceTypeByApiVersion.Keys.Should().BeEquivalentTo(["2025-01-01"]); + } + + [TestMethod] + public void Missing_excluded_api_versions_are_ignored() + { + var exclusion = new ConfigLoader.ApiVersionExclusion("Microsoft.Test", ["2099-01-01"]); + var config = new ConfigLoader.ConfigFile(EmptyTocMapping, [], [exclusion]); + + var result = MainGenerator.ApplyApiVersionExclusions(GroupedTypes, config); + + result.Should().NotBeNull(); + result!.ResourceTypeByApiVersion.Should().BeEquivalentTo(GroupedTypes.ResourceTypeByApiVersion); + } + + [TestMethod] + public void Provider_is_skipped_when_all_api_versions_are_excluded() + { + var exclusion = new ConfigLoader.ApiVersionExclusion( + "Microsoft.Test", + ["2024-01-01", "2025-01-01"]); + var config = new ConfigLoader.ConfigFile(EmptyTocMapping, [], [exclusion]); + + var result = MainGenerator.ApplyApiVersionExclusions(GroupedTypes, config); + + result.Should().BeNull(); + } +} diff --git a/src/TemplateRefGenerator/Config/ConfigLoader.cs b/src/TemplateRefGenerator/Config/ConfigLoader.cs index d0f6c560..66819062 100644 --- a/src/TemplateRefGenerator/Config/ConfigLoader.cs +++ b/src/TemplateRefGenerator/Config/ConfigLoader.cs @@ -16,7 +16,12 @@ public class ConfigLoader public record ConfigFile( ImmutableDictionary TocTitleMapping, - ImmutableArray ExcludedProviders); + ImmutableArray ExcludedProviders, + ImmutableArray? ExcludedApiVersions); + + public record ApiVersionExclusion( + string ProviderNamespace, + ImmutableArray ApiVersions); public record SamplesFile( ImmutableArray AvmLinks, diff --git a/src/TemplateRefGenerator/MainGenerator.cs b/src/TemplateRefGenerator/MainGenerator.cs index 929b5a96..43152297 100644 --- a/src/TemplateRefGenerator/MainGenerator.cs +++ b/src/TemplateRefGenerator/MainGenerator.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.IO.Abstractions; using System.Collections.Generic; +using System.Collections.Immutable; namespace TemplateRefGenerator; @@ -34,6 +35,27 @@ private void WriteFile(Options options, string path, string content) fileSystem.File.WriteAllText(filePath, content); } + public static MarkdownGenerator.GroupedTypes? ApplyApiVersionExclusions(MarkdownGenerator.GroupedTypes grouping, ConfigLoader.ConfigFile config) + { + var excludedVersions = (config.ExcludedApiVersions ?? []) + .Where(x => StringComparer.OrdinalIgnoreCase.Equals(x.ProviderNamespace, grouping.ProviderNamespace)) + .SelectMany(x => x.ApiVersions) + .ToHashSet(StringComparer.OrdinalIgnoreCase); + + if (excludedVersions.Count == 0) + { + return grouping; + } + + var filteredTypes = grouping.ResourceTypeByApiVersion + .Where(x => !excludedVersions.Contains(x.Key)) + .ToImmutableDictionary(StringComparer.OrdinalIgnoreCase); + + return filteredTypes.Count == 0 + ? null + : new(grouping.ProviderNamespace, filteredTypes); + } + private IEnumerable GetGroupedTypes(Options options, MarkdownGenerator mdGenerator, ConfigLoader.ConfigFile config) { foreach (var grouping in mdGenerator.GetGroupedTypes()) @@ -50,7 +72,14 @@ private void WriteFile(Options options, string path, string content) continue; } - yield return grouping; + var filteredGrouping = ApplyApiVersionExclusions(grouping, config); + if (filteredGrouping is null) + { + Trace.WriteLine($"Skipping {grouping.ProviderNamespace} - all API versions excluded in config"); + continue; + } + + yield return filteredGrouping; } } From 86dfefd7bd130c7d82cf5a652aa572f5820478f8 Mon Sep 17 00:00:00 2001 From: Nacho Alonso Portillo Date: Sat, 17 Oct 2026 13:30:51 +0200 Subject: [PATCH 7/7] Use resource metadata and sample version gates Remove manual read-only resource configuration and API version exclusions. Retain older reference pages and use sample API version requirements to control example visibility, with regression coverage and documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/dev_guide.md | 32 +++++--- settings/config/config.json | 9 --- .../remarks/microsoft.horizondb/remarks.json | 13 ---- settings/schemas/config.schema.json | 29 +------ settings/schemas/remarks.schema.json | 21 ----- .../MainGeneratorTests.cs | 77 ------------------- .../MarkdownGeneratorTests.cs | 46 ++++++++++- .../RemarksLoaderTests.cs | 36 ++++++--- .../Config/ConfigLoader.cs | 7 +- .../Config/RemarksLoader.cs | 12 +-- .../Generators/MarkdownGenerator.cs | 6 +- src/TemplateRefGenerator/MainGenerator.cs | 31 +------- 12 files changed, 95 insertions(+), 224 deletions(-) delete mode 100644 src/TemplateRefGenerator.Tests/MainGeneratorTests.cs diff --git a/docs/dev_guide.md b/docs/dev_guide.md index ea765064..90ff9c1a 100644 --- a/docs/dev_guide.md +++ b/docs/dev_guide.md @@ -48,20 +48,28 @@ src/TemplateRefGenerator/bin/Debug/net10.0/TemplateRefGenerator --source-folder To get detailed logging, use the `--verbose` flag. -## Excluding API versions +## Read-only resources -To omit specific API versions for a provider, add an optional `ExcludedApiVersions` entry to `settings/config/config.json`: +Read-only rendering is determined by the source resource type metadata. When +`ResourceType.WritableScopes` is `ScopeType.None`, the generated Bicep, ARM template, +and Terraform sections describe the resource as read-only, retain property reference +tables, and omit deployment syntax and usage examples. No provider-specific remarks +configuration is required. Incorrect writability metadata should be corrected +upstream in the API specifications or type generation. + +## Versioning code samples + +Reference pages are generated for every available API version of included providers. +To restrict a curated code sample to compatible API versions, set its optional +`ApiVersion` property in the provider's remarks configuration: ```json -"ExcludedApiVersions": [ - { - "ProviderNamespace": "Microsoft.Example", - "ApiVersions": [ - "2024-01-01", - "2024-06-01-preview" - ] - } -] +"ApiVersion": { + "Minimum": "2026-10-01-preview" +} ``` -Exclusions are matched case-insensitively. If `ExcludedApiVersions` is omitted or empty, the generator produces documentation for every available API version. Versions that aren't present in the source types are ignored. +`Minimum` and `Maximum` are inclusive, optional bounds. A minimum-only requirement +includes that version and later versions, not just the latest version. Omit +`ApiVersion` to show the sample on all versions. These filters apply to Bicep, +ARM template, and Terraform samples without removing older reference pages. diff --git a/settings/config/config.json b/settings/config/config.json index 2bf69aaa..a0ae5603 100644 --- a/settings/config/config.json +++ b/settings/config/config.json @@ -278,14 +278,5 @@ "microsoft.storage.admin", "microsoft.subscriptions.admin", "microsoft.update.admin" - ], - "ExcludedApiVersions": [ - { - "ProviderNamespace": "Microsoft.HorizonDb", - "ApiVersions": [ - "2026-01-20-preview", - "2026-05-01-preview" - ] - } ] } \ No newline at end of file diff --git a/settings/remarks/microsoft.horizondb/remarks.json b/settings/remarks/microsoft.horizondb/remarks.json index 555fd19e..7c83324a 100644 --- a/settings/remarks/microsoft.horizondb/remarks.json +++ b/settings/remarks/microsoft.horizondb/remarks.json @@ -1,18 +1,5 @@ { "$schema": "../../schemas/remarks.schema.json", - "ReadOnlyResources": [ - { - "ResourceTypes": [ - "Microsoft.HorizonDb/clusters/endpoints", - "Microsoft.HorizonDb/clusters/logFiles", - "Microsoft.HorizonDb/clusters/pools/maintenanceEvents", - "Microsoft.HorizonDb/clusters/pools/nodes", - "Microsoft.HorizonDb/clusters/privateLinkResources", - "Microsoft.HorizonDb/locations/capabilities", - "Microsoft.HorizonDb/locations/parameterGroups" - ] - } - ], "ResourceRemarks": [ { "ResourceTypes": [ diff --git a/settings/schemas/config.schema.json b/settings/schemas/config.schema.json index fe74bdbc..d7ea3578 100644 --- a/settings/schemas/config.schema.json +++ b/settings/schemas/config.schema.json @@ -16,38 +16,11 @@ "items": { "type": "string" } - }, - "ExcludedApiVersions": { - "type": "array", - "items": { - "$ref": "#/definitions/ApiVersionExclusion" - } } }, "required": [ "TocTitleMapping", "ExcludedProviders" ], - "additionalProperties": false, - "definitions": { - "ApiVersionExclusion": { - "type": "object", - "properties": { - "ProviderNamespace": { - "type": "string" - }, - "ApiVersions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "ProviderNamespace", - "ApiVersions" - ], - "additionalProperties": false - } - } + "additionalProperties": false } \ No newline at end of file diff --git a/settings/schemas/remarks.schema.json b/settings/schemas/remarks.schema.json index fdff8a5c..94279dc8 100644 --- a/settings/schemas/remarks.schema.json +++ b/settings/schemas/remarks.schema.json @@ -11,12 +11,6 @@ "$ref": "#/definitions/ResourceRemark" } }, - "ReadOnlyResources": { - "type": "array", - "items": { - "$ref": "#/definitions/ReadOnlyResource" - } - }, "PropertyRemarks": { "type": "array", "items": { @@ -84,21 +78,6 @@ ], "additionalProperties": false }, - "ReadOnlyResource": { - "type": "object", - "properties": { - "ResourceTypes": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "ResourceTypes" - ], - "additionalProperties": false - }, "PropertyRemark": { "type": "object", "properties": { diff --git a/src/TemplateRefGenerator.Tests/MainGeneratorTests.cs b/src/TemplateRefGenerator.Tests/MainGeneratorTests.cs deleted file mode 100644 index b207a3c7..00000000 --- a/src/TemplateRefGenerator.Tests/MainGeneratorTests.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -using System.Collections.Immutable; -using FluentAssertions; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using TemplateRefGenerator; - -namespace TemplateRefGenerator.Tests; - -[TestClass] -public class MainGeneratorTests -{ - private static readonly MarkdownGenerator.GroupedTypes GroupedTypes = new( - "Microsoft.Test", - new Dictionary>(StringComparer.OrdinalIgnoreCase) - { - ["2024-01-01"] = ["Microsoft.Test/widgets"], - ["2025-01-01"] = ["Microsoft.Test/widgets"], - }.ToImmutableDictionary(StringComparer.OrdinalIgnoreCase)); - - private static readonly ImmutableDictionary EmptyTocMapping = []; - - [TestMethod] - public void All_api_versions_are_included_when_exclusions_are_not_configured() - { - var config = Utils.DeserializeJsonFile( - "config.json", - """ - { - "TocTitleMapping": {}, - "ExcludedProviders": [] - } - """); - - var result = MainGenerator.ApplyApiVersionExclusions(GroupedTypes, config); - - result.Should().BeSameAs(GroupedTypes); - } - - [TestMethod] - public void Configured_api_versions_are_excluded_for_the_matching_provider() - { - var exclusion = new ConfigLoader.ApiVersionExclusion("microsoft.test", ["2024-01-01"]); - var config = new ConfigLoader.ConfigFile(EmptyTocMapping, [], [exclusion]); - - var result = MainGenerator.ApplyApiVersionExclusions(GroupedTypes, config); - - result.Should().NotBeNull(); - result!.ResourceTypeByApiVersion.Keys.Should().BeEquivalentTo(["2025-01-01"]); - } - - [TestMethod] - public void Missing_excluded_api_versions_are_ignored() - { - var exclusion = new ConfigLoader.ApiVersionExclusion("Microsoft.Test", ["2099-01-01"]); - var config = new ConfigLoader.ConfigFile(EmptyTocMapping, [], [exclusion]); - - var result = MainGenerator.ApplyApiVersionExclusions(GroupedTypes, config); - - result.Should().NotBeNull(); - result!.ResourceTypeByApiVersion.Should().BeEquivalentTo(GroupedTypes.ResourceTypeByApiVersion); - } - - [TestMethod] - public void Provider_is_skipped_when_all_api_versions_are_excluded() - { - var exclusion = new ConfigLoader.ApiVersionExclusion( - "Microsoft.Test", - ["2024-01-01", "2025-01-01"]); - var config = new ConfigLoader.ConfigFile(EmptyTocMapping, [], [exclusion]); - - var result = MainGenerator.ApplyApiVersionExclusions(GroupedTypes, config); - - result.Should().BeNull(); - } -} diff --git a/src/TemplateRefGenerator.Tests/MarkdownGeneratorTests.cs b/src/TemplateRefGenerator.Tests/MarkdownGeneratorTests.cs index d84e7f2d..4642add1 100644 --- a/src/TemplateRefGenerator.Tests/MarkdownGeneratorTests.cs +++ b/src/TemplateRefGenerator.Tests/MarkdownGeneratorTests.cs @@ -47,14 +47,52 @@ public void Markdown_generation_works(EmbeddedFile embeddedFile) } [TestMethod] - public void Read_only_resources_must_be_explicitly_configured() + [DataRow(true, false)] + [DataRow(true, true)] + [DataRow(false, false)] + [DataRow(false, true)] + public void Resource_rendering_uses_writable_scope_metadata(bool isReadOnly, bool isLatestVersionPage) { var typeProvider = new ResourceTypeProvider(new AzTypeLoader()); var resourceType = typeProvider.GetResourceTypes() .Select(x => typeProvider.Get(x.resourceType, x.apiVersion)) - .First(x => Utils.HasWritableScope(x, ScopeType.None)); + .First(x => (x.WritableScopes == ScopeType.None) == isReadOnly && + !x.Name.StartsWith("Microsoft.HorizonDb/", StringComparison.OrdinalIgnoreCase)); - MarkdownGenerator.IsReadOnlyResource(resourceType, isConfiguredReadOnly: true).Should().BeTrue(); - MarkdownGenerator.IsReadOnlyResource(resourceType, isConfiguredReadOnly: false).Should().BeFalse(); + MarkdownGenerator.IsReadOnlyResource(resourceType).Should().Be(isReadOnly); + + var providerNamespace = Utils.GetProviderNamespace(resourceType.Name); + var groupedTypes = new MarkdownGenerator(typeProvider).GetGroupedTypes() + .First(x => StringComparer.OrdinalIgnoreCase.Equals(x.ProviderNamespace, providerNamespace)); + var markdown = MarkdownGenerator.GenerateMarkdown(groupedTypes, resourceType, new(), new(), isLatestVersionPage); + + foreach (var pivot in new[] { "bicep", "arm-template", "terraform" }) + { + markdown.Should().Contain($"::: zone pivot=\"deployment-language-{pivot}\""); + } + + markdown.Should().Contain("## Property Values", Exactly.Times(3)); + + if (isReadOnly) + { + markdown.Should().Contain("reference for retrieving the resource."); + markdown.Should().Contain("is read-only and cannot be deployed.", Exactly.Times(3)); + markdown.Should().NotContain("can be deployed with operations that target:"); + markdown.Should().NotContain("## Resource format"); + markdown.Should().NotContain("## Usage Examples"); + markdown.Should().NotContain("```bicep"); + markdown.Should().NotContain("```json"); + markdown.Should().NotContain("```terraform"); + } + else + { + markdown.Should().Contain("syntax and properties to use in Azure Resource Manager templates for deploying the resource."); + markdown.Should().NotContain("is read-only and cannot be deployed."); + markdown.Should().Contain("can be deployed with operations that target:", Exactly.Times(3)); + markdown.Should().Contain("## Resource format", Exactly.Times(3)); + markdown.Should().Contain("```bicep"); + markdown.Should().Contain("```json"); + markdown.Should().Contain("```terraform"); + } } } \ No newline at end of file diff --git a/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs b/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs index 32e98354..c5410791 100644 --- a/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs +++ b/src/TemplateRefGenerator.Tests/RemarksLoaderTests.cs @@ -28,7 +28,7 @@ public void Code_samples_are_filtered_by_api_version_range( new RemarksLoader.ApiVersionRequirement(minimum, maximum), "samples/widget.bicep", "Deploy a widget."); - var remarks = new RemarksLoader.RemarksFile(null, null, null, [sample], null, null, null); + var remarks = new RemarksLoader.RemarksFile(null, null, null, [sample], null, null); var resource = new MarkdownGenerator.ResourceMetadata( "Microsoft.Test", "Microsoft.Test/widgets", @@ -51,22 +51,36 @@ public void Code_samples_are_filtered_by_api_version_range( } [TestMethod] - [DataRow("Microsoft.Test/widgets", "2026-01-20-preview", true)] - [DataRow("Microsoft.Test/widgets", "2026-10-01-preview", true)] - [DataRow("Microsoft.Test/gadgets", "2026-10-01-preview", false)] - public void Read_only_resources_apply_to_all_api_versions(string resourceType, string apiVersion, bool expected) + [DataRow("2026-01-20-preview", false)] + [DataRow("2026-05-01-preview", false)] + [DataRow("2026-10-01-preview", true)] + public void HorizonDB_samples_are_only_included_for_compatible_api_versions(string apiVersion, bool expected) { - var readOnlyResource = new RemarksLoader.ReadOnlyResource(["Microsoft.Test/widgets"]); - var remarks = new RemarksLoader.RemarksFile(null, null, null, null, null, null, [readOnlyResource]); + var remarks = new RemarksLoader().GetRemarks("Microsoft.HorizonDb"); var resource = new MarkdownGenerator.ResourceMetadata( - "Microsoft.Test", - resourceType, - "widgets", + "Microsoft.HorizonDb", + "Microsoft.HorizonDb/clusters", + "clusters", apiVersion, null!, false, false); - remarks.IsReadOnlyResource(resource).Should().Be(expected); + foreach (var samples in new[] + { + remarks.GetBicepSamples(resource), + remarks.GetArmTemplateSamples(resource), + remarks.GetTerraformSamples(resource), + }) + { + if (expected) + { + samples.Should().NotBeEmpty(); + } + else + { + samples.Should().BeEmpty(); + } + } } } diff --git a/src/TemplateRefGenerator/Config/ConfigLoader.cs b/src/TemplateRefGenerator/Config/ConfigLoader.cs index 66819062..d0f6c560 100644 --- a/src/TemplateRefGenerator/Config/ConfigLoader.cs +++ b/src/TemplateRefGenerator/Config/ConfigLoader.cs @@ -16,12 +16,7 @@ public class ConfigLoader public record ConfigFile( ImmutableDictionary TocTitleMapping, - ImmutableArray ExcludedProviders, - ImmutableArray? ExcludedApiVersions); - - public record ApiVersionExclusion( - string ProviderNamespace, - ImmutableArray ApiVersions); + ImmutableArray ExcludedProviders); public record SamplesFile( ImmutableArray AvmLinks, diff --git a/src/TemplateRefGenerator/Config/RemarksLoader.cs b/src/TemplateRefGenerator/Config/RemarksLoader.cs index 4cf11536..31e743c6 100644 --- a/src/TemplateRefGenerator/Config/RemarksLoader.cs +++ b/src/TemplateRefGenerator/Config/RemarksLoader.cs @@ -29,9 +29,6 @@ public record ResourceRemark( ApiVersionRequirement? ApiVersion, string Description); - public record ReadOnlyResource( - ImmutableArray ResourceTypes); - public record PropertyRemark( string ResourceType, ApiVersionRequirement? ApiVersion, @@ -57,15 +54,10 @@ public record RemarksFile( ImmutableArray? DeploymentRemarks, ImmutableArray? BicepSamples, ImmutableArray? ArmTemplateSamples, - ImmutableArray? TerraformSamples, - ImmutableArray? ReadOnlyResources) + ImmutableArray? TerraformSamples) { public static RemarksFile Empty - => new(null, null, null, null, null, null, null); - - public bool IsReadOnlyResource(MarkdownGenerator.ResourceMetadata resource) - => (ReadOnlyResources ?? []) - .Any(r => r.ResourceTypes.Contains(resource.ResourceType, StringComparer.OrdinalIgnoreCase)); + => new(null, null, null, null, null, null); public IEnumerable GetResourceRemarks(MarkdownGenerator.ResourceMetadata resource) => (ResourceRemarks ?? []) diff --git a/src/TemplateRefGenerator/Generators/MarkdownGenerator.cs b/src/TemplateRefGenerator/Generators/MarkdownGenerator.cs index e303c313..c59cb0d6 100644 --- a/src/TemplateRefGenerator/Generators/MarkdownGenerator.cs +++ b/src/TemplateRefGenerator/Generators/MarkdownGenerator.cs @@ -98,8 +98,8 @@ private static string GetHeading(ResourceMetadata resource, bool isLatestVersion """; } - public static bool IsReadOnlyResource(ResourceType resourceType, bool isConfiguredReadOnly) - => Utils.HasWritableScope(resourceType, ScopeType.None) && isConfiguredReadOnly; + public static bool IsReadOnlyResource(ResourceType resourceType) + => Utils.HasWritableScope(resourceType, ScopeType.None); private static string GetApiVersionLinks(GroupedTypes groupedTypes, ResourceMetadata resource, bool isLatestVersionPage) { @@ -1136,7 +1136,7 @@ public static string GenerateMarkdown(GroupedTypes groupedTypes, ResourceType re var namedTypes = GetNamedTypes(resource); var remarks = remarksLoader.GetRemarks(providerNamespace); - var isReadOnly = IsReadOnlyResource(resource.Type, remarks.IsReadOnlyResource(resource)); + var isReadOnly = IsReadOnlyResource(resource.Type); var pageTitle = isLatestVersionPage ? $"{resource.Provider} {resource.UnqualifiedResourceType}" : $"{resource.Provider} {resource.UnqualifiedResourceType} {resource.ApiVersion}"; return $""" diff --git a/src/TemplateRefGenerator/MainGenerator.cs b/src/TemplateRefGenerator/MainGenerator.cs index 43152297..929b5a96 100644 --- a/src/TemplateRefGenerator/MainGenerator.cs +++ b/src/TemplateRefGenerator/MainGenerator.cs @@ -7,7 +7,6 @@ using System.Diagnostics; using System.IO.Abstractions; using System.Collections.Generic; -using System.Collections.Immutable; namespace TemplateRefGenerator; @@ -35,27 +34,6 @@ private void WriteFile(Options options, string path, string content) fileSystem.File.WriteAllText(filePath, content); } - public static MarkdownGenerator.GroupedTypes? ApplyApiVersionExclusions(MarkdownGenerator.GroupedTypes grouping, ConfigLoader.ConfigFile config) - { - var excludedVersions = (config.ExcludedApiVersions ?? []) - .Where(x => StringComparer.OrdinalIgnoreCase.Equals(x.ProviderNamespace, grouping.ProviderNamespace)) - .SelectMany(x => x.ApiVersions) - .ToHashSet(StringComparer.OrdinalIgnoreCase); - - if (excludedVersions.Count == 0) - { - return grouping; - } - - var filteredTypes = grouping.ResourceTypeByApiVersion - .Where(x => !excludedVersions.Contains(x.Key)) - .ToImmutableDictionary(StringComparer.OrdinalIgnoreCase); - - return filteredTypes.Count == 0 - ? null - : new(grouping.ProviderNamespace, filteredTypes); - } - private IEnumerable GetGroupedTypes(Options options, MarkdownGenerator mdGenerator, ConfigLoader.ConfigFile config) { foreach (var grouping in mdGenerator.GetGroupedTypes()) @@ -72,14 +50,7 @@ private void WriteFile(Options options, string path, string content) continue; } - var filteredGrouping = ApplyApiVersionExclusions(grouping, config); - if (filteredGrouping is null) - { - Trace.WriteLine($"Skipping {grouping.ProviderNamespace} - all API versions excluded in config"); - continue; - } - - yield return filteredGrouping; + yield return grouping; } }