diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml
index 69d2e50d37487..e844fdb04cde1 100644
--- a/sdk/resourcemanager/ci.mgmt.yml
+++ b/sdk/resourcemanager/ci.mgmt.yml
@@ -194,6 +194,7 @@ trigger:
- sdk/subscription/Azure.ResourceManager.Subscription
- sdk/support/Azure.ResourceManager.Support
- sdk/synapse/Azure.ResourceManager.Synapse
+ - sdk/terraform/Azure.ResourceManager.Terraform
- sdk/trafficmanager/Azure.ResourceManager.TrafficManager
- sdk/trustedsigning/Azure.ResourceManager.TrustedSigning
- sdk/voiceservices/Azure.ResourceManager.VoiceServices
@@ -397,6 +398,7 @@ pr:
- sdk/subscription/Azure.ResourceManager.Subscription
- sdk/support/Azure.ResourceManager.Support
- sdk/synapse/Azure.ResourceManager.Synapse
+ - sdk/terraform/Azure.ResourceManager.Terraform
- sdk/trafficmanager/Azure.ResourceManager.TrafficManager
- sdk/trustedsigning/Azure.ResourceManager.TrustedSigning
- sdk/voiceservices/Azure.ResourceManager.VoiceServices
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/Azure.ResourceManager.Terraform.sln b/sdk/terraform/Azure.ResourceManager.Terraform/Azure.ResourceManager.Terraform.sln
new file mode 100644
index 0000000000000..0fdcc0b1d313f
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/Azure.ResourceManager.Terraform.sln
@@ -0,0 +1,65 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30309.148
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{57104F4E-33D2-4712-89D0-35A4165C1BA1}") = "Azure.ResourceManager.Terraform", "src\Azure.ResourceManager.Terraform.csproj", "{3457A0A4-B5E1-4184-8D42-0F1C542217C9}"
+EndProject
+Project("{57104F4E-33D2-4712-89D0-35A4165C1BA1}") = "Azure.ResourceManager.Terraform.Tests", "tests\Azure.ResourceManager.Terraform.Tests.csproj", "{DC07DC97-58C7-4345-B915-29DF7739ABD5}"
+EndProject
+Project("{57104F4E-33D2-4712-89D0-35A4165C1BA1}") = "Azure.ResourceManager.Terraform.Samples", "samples\Azure.ResourceManager.Terraform.Samples.csproj", "{0C87CC4B-8863-41FC-8704-20CC6F8A58E1}"
+EndProject
+Global
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {79ECAB3D-FE5F-4AF2-9214-2D6F13CB7F9C}
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Debug|x64.Build.0 = Debug|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Debug|x86.Build.0 = Debug|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Release|x64.ActiveCfg = Release|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Release|x64.Build.0 = Release|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Release|x86.ActiveCfg = Release|Any CPU
+ {3457A0A4-B5E1-4184-8D42-0F1C542217C9}.Release|x86.Build.0 = Release|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Debug|x64.Build.0 = Debug|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Debug|x86.Build.0 = Debug|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Release|x64.ActiveCfg = Release|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Release|x64.Build.0 = Release|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Release|x86.ActiveCfg = Release|Any CPU
+ {DC07DC97-58C7-4345-B915-29DF7739ABD5}.Release|x86.Build.0 = Release|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Debug|x64.Build.0 = Debug|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Debug|x86.Build.0 = Debug|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Release|x64.ActiveCfg = Release|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Release|x64.Build.0 = Release|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Release|x86.ActiveCfg = Release|Any CPU
+ {0C87CC4B-8863-41FC-8704-20CC6F8A58E1}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/CHANGELOG.md b/sdk/terraform/Azure.ResourceManager.Terraform/CHANGELOG.md
new file mode 100644
index 0000000000000..da00c15054249
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/CHANGELOG.md
@@ -0,0 +1,17 @@
+# Release History
+
+## 1.0.0-beta.1 (2024-10-31)
+
+### Features Added
+
+This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities:
+
+ - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET.
+ - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing.
+ - HTTP pipeline with custom policies.
+ - Better error-handling.
+ - Support uniform telemetry across all languages.
+
+This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues).
+
+> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet).
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/Directory.Build.props b/sdk/terraform/Azure.ResourceManager.Terraform/Directory.Build.props
new file mode 100644
index 0000000000000..1a9611bd49242
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/README.md b/sdk/terraform/Azure.ResourceManager.Terraform/README.md
new file mode 100644
index 0000000000000..7eae62f4da191
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/README.md
@@ -0,0 +1,82 @@
+# Microsoft Azure terraform management client library for .NET
+
+The Azure Terraform Export API aims to export existing Azure resources into its equivalent Terraform configurations,
+for either azurerm provider or azapi provider. It is equivalent to ARM Template Export API for Terraform.
+
+This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities:
+
+- Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET.
+- Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing.
+- HTTP pipeline with custom policies.
+- Better error-handling.
+- Support uniform telemetry across all languages.
+
+## Getting started
+
+### Install the package
+
+Install the Microsoft Azure terraform management library for .NET with [NuGet](https://www.nuget.org/):
+
+```dotnetcli
+dotnet add package Azure.ResourceManager.Terraform --prerelease
+```
+
+### Prerequisites
+
+- You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/).
+
+### Authenticate the Client
+
+To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md).
+
+## Key concepts
+
+Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html)
+
+## Documentation
+
+Documentation is available to help you learn how to use this package:
+
+- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md).
+- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet).
+- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md).
+
+## Examples
+
+Code samples for using the management library for .NET can be found in the following locations
+
+- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples)
+
+## Troubleshooting
+
+- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues).
+- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags.
+
+## Next steps
+
+For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/).
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing
+guide][cg].
+
+This project welcomes contributions and suggestions. Most contributions
+require you to agree to a Contributor License Agreement (CLA) declaring
+that you have the right to, and actually do, grant us the rights to use
+your contribution. For details, visit .
+
+When you submit a pull request, a CLA-bot will automatically determine
+whether you need to provide a CLA and decorate the PR appropriately
+(for example, label, comment). Follow the instructions provided by the
+bot. You'll only need to do this action once across all repositories
+using our CLA.
+
+This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For
+more information, see the [Code of Conduct FAQ][coc_faq] or contact
+ with any other questions or comments.
+
+
+[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md
+[coc]: https://opensource.microsoft.com/codeofconduct/
+[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.netstandard2.0.cs b/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.netstandard2.0.cs
new file mode 100644
index 0000000000000..6ba77b806a8b8
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/api/Azure.ResourceManager.Terraform.netstandard2.0.cs
@@ -0,0 +1,146 @@
+namespace Azure.ResourceManager.Terraform
+{
+ public static partial class TerraformExtensions
+ {
+ public static Azure.ResourceManager.ArmOperation ExportTerraform(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.Terraform.Models.CommonExportProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public static System.Threading.Tasks.Task> ExportTerraformAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.Terraform.Models.CommonExportProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ }
+}
+namespace Azure.ResourceManager.Terraform.Mocking
+{
+ public partial class MockableTerraformSubscriptionResource : Azure.ResourceManager.ArmResource
+ {
+ protected MockableTerraformSubscriptionResource() { }
+ public virtual Azure.ResourceManager.ArmOperation ExportTerraform(Azure.WaitUntil waitUntil, Azure.ResourceManager.Terraform.Models.CommonExportProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ public virtual System.Threading.Tasks.Task> ExportTerraformAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Terraform.Models.CommonExportProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
+ }
+}
+namespace Azure.ResourceManager.Terraform.Models
+{
+ public static partial class ArmTerraformModelFactory
+ {
+ public static Azure.ResourceManager.Terraform.Models.ExportQueryTerraform ExportQueryTerraform(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? targetProvider = default(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider?), bool? isOutputFullPropertiesEnabled = default(bool?), bool? isMaskSensitiveEnabled = default(bool?), string query = null, string namePattern = null, bool? isRecursive = default(bool?)) { throw null; }
+ public static Azure.ResourceManager.Terraform.Models.ExportResourceGroupTerraform ExportResourceGroupTerraform(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? targetProvider = default(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider?), bool? isOutputFullPropertiesEnabled = default(bool?), bool? isMaskSensitiveEnabled = default(bool?), string resourceGroupName = null, string namePattern = null) { throw null; }
+ public static Azure.ResourceManager.Terraform.Models.TerraformExportResult TerraformExportResult(string configuration = null, System.Collections.Generic.IEnumerable skippedResourceIds = null, System.Collections.Generic.IEnumerable errors = null) { throw null; }
+ public static Azure.ResourceManager.Terraform.Models.TerraformOperationStatus TerraformOperationStatus(Azure.ResourceManager.Terraform.Models.TerraformExportResult properties = null, Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState status = default(Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState), string name = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), double? percentComplete = default(double?), Azure.ResponseError error = null) { throw null; }
+ }
+ public abstract partial class CommonExportProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel
+ {
+ protected CommonExportProperties() { }
+ public bool? IsMaskSensitiveEnabled { get { throw null; } set { } }
+ public bool? IsOutputFullPropertiesEnabled { get { throw null; } set { } }
+ public Azure.ResourceManager.Terraform.Models.TargetTerraformProvider? TargetProvider { get { throw null; } set { } }
+ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.CommonExportProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.CommonExportProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ }
+ public partial class ExportQueryTerraform : Azure.ResourceManager.Terraform.Models.CommonExportProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel
+ {
+ public ExportQueryTerraform(string query) { }
+ public bool? IsRecursive { get { throw null; } set { } }
+ public string NamePattern { get { throw null; } set { } }
+ public string Query { get { throw null; } }
+ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.ExportQueryTerraform System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.ExportQueryTerraform System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ }
+ public partial class ExportResourceGroupTerraform : Azure.ResourceManager.Terraform.Models.CommonExportProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel
+ {
+ public ExportResourceGroupTerraform(string resourceGroupName) { }
+ public string NamePattern { get { throw null; } set { } }
+ public string ResourceGroupName { get { throw null; } }
+ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.ExportResourceGroupTerraform System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.ExportResourceGroupTerraform System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ }
+ public partial class ExportResourceTerraform : Azure.ResourceManager.Terraform.Models.CommonExportProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel
+ {
+ public ExportResourceTerraform(System.Collections.Generic.IEnumerable resourceIds) { }
+ public string NamePattern { get { throw null; } set { } }
+ public System.Collections.Generic.IList ResourceIds { get { throw null; } }
+ public string ResourceName { get { throw null; } set { } }
+ public string ResourceType { get { throw null; } set { } }
+ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.ExportResourceTerraform System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.ExportResourceTerraform System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ }
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public readonly partial struct TargetTerraformProvider : System.IEquatable
+ {
+ private readonly object _dummy;
+ private readonly int _dummyPrimitive;
+ public TargetTerraformProvider(string value) { throw null; }
+ public static Azure.ResourceManager.Terraform.Models.TargetTerraformProvider AzApi { get { throw null; } }
+ public static Azure.ResourceManager.Terraform.Models.TargetTerraformProvider AzureRM { get { throw null; } }
+ public bool Equals(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider other) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override bool Equals(object obj) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override int GetHashCode() { throw null; }
+ public static bool operator ==(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider left, Azure.ResourceManager.Terraform.Models.TargetTerraformProvider right) { throw null; }
+ public static implicit operator Azure.ResourceManager.Terraform.Models.TargetTerraformProvider (string value) { throw null; }
+ public static bool operator !=(Azure.ResourceManager.Terraform.Models.TargetTerraformProvider left, Azure.ResourceManager.Terraform.Models.TargetTerraformProvider right) { throw null; }
+ public override string ToString() { throw null; }
+ }
+ public partial class TerraformExportResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel
+ {
+ internal TerraformExportResult() { }
+ public string Configuration { get { throw null; } }
+ public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } }
+ public System.Collections.Generic.IReadOnlyList SkippedResourceIds { get { throw null; } }
+ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.TerraformExportResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.TerraformExportResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ }
+ public partial class TerraformOperationStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel
+ {
+ internal TerraformOperationStatus() { }
+ public System.DateTimeOffset? EndOn { get { throw null; } }
+ public Azure.ResponseError Error { get { throw null; } }
+ public string Name { get { throw null; } }
+ public double? PercentComplete { get { throw null; } }
+ public Azure.ResourceManager.Terraform.Models.TerraformExportResult Properties { get { throw null; } }
+ public System.DateTimeOffset? StartOn { get { throw null; } }
+ public Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState Status { get { throw null; } }
+ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.TerraformOperationStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { }
+ Azure.ResourceManager.Terraform.Models.TerraformOperationStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; }
+ }
+ [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
+ public readonly partial struct TerraformResourceProvisioningState : System.IEquatable
+ {
+ private readonly object _dummy;
+ private readonly int _dummyPrimitive;
+ public TerraformResourceProvisioningState(string value) { throw null; }
+ public static Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState Canceled { get { throw null; } }
+ public static Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState Failed { get { throw null; } }
+ public static Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState Succeeded { get { throw null; } }
+ public bool Equals(Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState other) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override bool Equals(object obj) { throw null; }
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
+ public override int GetHashCode() { throw null; }
+ public static bool operator ==(Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState left, Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState right) { throw null; }
+ public static implicit operator Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState (string value) { throw null; }
+ public static bool operator !=(Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState left, Azure.ResourceManager.Terraform.Models.TerraformResourceProvisioningState right) { throw null; }
+ public override string ToString() { throw null; }
+ }
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/assets.json b/sdk/terraform/Azure.ResourceManager.Terraform/assets.json
new file mode 100644
index 0000000000000..255b73238d74e
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/assets.json
@@ -0,0 +1,6 @@
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "net",
+ "TagPrefix": "net/terraform/Azure.ResourceManager.Terraform",
+ "Tag": "net/terraform/Azure.ResourceManager.Terraform_ac6492ee96"
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/samples/Azure.ResourceManager.Terraform.Samples.csproj b/sdk/terraform/Azure.ResourceManager.Terraform/samples/Azure.ResourceManager.Terraform.Samples.csproj
new file mode 100644
index 0000000000000..8d2d95777931e
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/samples/Azure.ResourceManager.Terraform.Samples.csproj
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/terraform/Azure.ResourceManager.Terraform/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs
new file mode 100644
index 0000000000000..ac302321fa08c
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Identity;
+using Azure.ResourceManager.Resources;
+using Azure.ResourceManager.Terraform.Models;
+
+namespace Azure.ResourceManager.Terraform.Samples
+{
+ public partial class Sample_SubscriptionResourceExtensions
+ {
+ // ExportTerraform
+ [NUnit.Framework.Test]
+ [NUnit.Framework.Ignore("Only verifying that the sample builds")]
+ public async Task ExportTerraform_ExportTerraform()
+ {
+ // Generated from example definition: 2023-07-01-preview/ExportTerraform.json
+ // this example is just showing the usage of "Terraform_ExportTerraform" operation, for the dependent resources, they will have to be created separately.
+
+ // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
+ TokenCredential cred = new DefaultAzureCredential();
+ // authenticate your client
+ ArmClient client = new ArmClient(cred);
+
+ // this example assumes you already have this SubscriptionResource created on azure
+ // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
+ SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
+
+ // invoke the operation
+ CommonExportProperties body = new ExportResourceGroupTerraform("rg1");
+ ArmOperation lro = await subscriptionResource.ExportTerraformAsync(WaitUntil.Completed, body);
+ TerraformOperationStatus result = lro.Value;
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+ }
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Azure.ResourceManager.Terraform.csproj b/sdk/terraform/Azure.ResourceManager.Terraform/src/Azure.ResourceManager.Terraform.csproj
new file mode 100644
index 0000000000000..f2dd197dd4a3f
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Azure.ResourceManager.Terraform.csproj
@@ -0,0 +1,8 @@
+
+
+ 1.0.0-beta.1
+ Azure.ResourceManager.Terraform
+ Azure Resource Manager client SDK for Azure resource provider terraform.
+ azure;management;arm;resource manager;terraform
+
+
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/ArmTerraformModelFactory.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/ArmTerraformModelFactory.cs
new file mode 100644
index 0000000000000..72b56c7b2a602
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/ArmTerraformModelFactory.cs
@@ -0,0 +1,93 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Azure.Core;
+
+namespace Azure.ResourceManager.Terraform.Models
+{
+ /// Model factory for models.
+ public static partial class ArmTerraformModelFactory
+ {
+ /// Initializes a new instance of .
+ /// The target Azure Terraform Provider.
+ /// Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications to make it valid.
+ /// Mask sensitive attributes in the Terraform configuration.
+ /// The ARG where predicate. Note that you can combine multiple conditions in one `where` predicate, e.g. `resourceGroup =~ "my-rg" and type =~ "microsoft.network/virtualnetworks"`.
+ /// The name pattern of the Terraform resources.
+ /// Whether to recursively list child resources of the query result.
+ /// A new instance for mocking.
+ public static ExportQueryTerraform ExportQueryTerraform(TargetTerraformProvider? targetProvider = null, bool? isOutputFullPropertiesEnabled = null, bool? isMaskSensitiveEnabled = null, string query = null, string namePattern = null, bool? isRecursive = null)
+ {
+ return new ExportQueryTerraform(
+ CommonExportType.ExportQuery,
+ targetProvider,
+ isOutputFullPropertiesEnabled,
+ isMaskSensitiveEnabled,
+ serializedAdditionalRawData: null,
+ query,
+ namePattern,
+ isRecursive);
+ }
+
+ /// Initializes a new instance of .
+ /// The target Azure Terraform Provider.
+ /// Whether to output all non-computed properties in the generated Terraform configuration? This probably needs manual modifications to make it valid.
+ /// Mask sensitive attributes in the Terraform configuration.
+ /// The name of the resource group to be exported.
+ /// The name pattern of the Terraform resources.
+ /// A new instance for mocking.
+ public static ExportResourceGroupTerraform ExportResourceGroupTerraform(TargetTerraformProvider? targetProvider = null, bool? isOutputFullPropertiesEnabled = null, bool? isMaskSensitiveEnabled = null, string resourceGroupName = null, string namePattern = null)
+ {
+ return new ExportResourceGroupTerraform(
+ CommonExportType.ExportResourceGroup,
+ targetProvider,
+ isOutputFullPropertiesEnabled,
+ isMaskSensitiveEnabled,
+ serializedAdditionalRawData: null,
+ resourceGroupName,
+ namePattern);
+ }
+
+ /// Initializes a new instance of .
+ /// RP-specific properties for the operationStatus resource, only appears when operation ended with Succeeded status.
+ /// The operation status.
+ /// The name of the operationStatus resource.
+ /// Operation start time.
+ /// Operation complete time.
+ /// The progress made toward completing the operation.
+ /// Errors that occurred if the operation ended with Canceled or Failed status.
+ /// A new instance for mocking.
+ public static TerraformOperationStatus TerraformOperationStatus(TerraformExportResult properties = null, TerraformResourceProvisioningState status = default, string name = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, double? percentComplete = null, ResponseError error = null)
+ {
+ return new TerraformOperationStatus(
+ properties,
+ status,
+ name,
+ startOn,
+ endOn,
+ percentComplete,
+ error,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The Terraform configuration content.
+ /// A list of Azure resources which are not exported to Terraform due to there is no corresponding resources in Terraform.
+ /// A list of errors derived during exporting each resource.
+ /// A new instance for mocking.
+ public static TerraformExportResult TerraformExportResult(string configuration = null, IEnumerable skippedResourceIds = null, IEnumerable errors = null)
+ {
+ skippedResourceIds ??= new List();
+ errors ??= new List();
+
+ return new TerraformExportResult(configuration, skippedResourceIds?.ToList(), errors?.ToList(), serializedAdditionalRawData: null);
+ }
+ }
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Extensions/MockableTerraformSubscriptionResource.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Extensions/MockableTerraformSubscriptionResource.cs
new file mode 100644
index 0000000000000..a49365c8727db
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Extensions/MockableTerraformSubscriptionResource.cs
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.ResourceManager.Terraform.Models;
+
+namespace Azure.ResourceManager.Terraform.Mocking
+{
+ /// A class to add extension methods to SubscriptionResource.
+ public partial class MockableTerraformSubscriptionResource : ArmResource
+ {
+ private ClientDiagnostics _terraformClientDiagnostics;
+ private TerraformRestOperations _terraformRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected MockableTerraformSubscriptionResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The identifier of the resource that is the target of operations.
+ internal MockableTerraformSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private ClientDiagnostics TerraformClientDiagnostics => _terraformClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Terraform", ProviderConstants.DefaultProviderNamespace, Diagnostics);
+ private TerraformRestOperations TerraformRestClient => _terraformRestClient ??= new TerraformRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ ///
+ /// Exports the Terraform configuration of the specified resource(s).
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureTerraform/exportTerraform
+ ///
+ /// -
+ /// Operation Id
+ /// Terraform_ExportTerraform
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-07-01-preview
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The request body.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> ExportTerraformAsync(WaitUntil waitUntil, CommonExportProperties body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(body, nameof(body));
+
+ using var scope = TerraformClientDiagnostics.CreateScope("MockableTerraformSubscriptionResource.ExportTerraform");
+ scope.Start();
+ try
+ {
+ var response = await TerraformRestClient.ExportTerraformAsync(Id.SubscriptionId, body, cancellationToken).ConfigureAwait(false);
+ var operation = new TerraformArmOperation(new TerraformOperationStatusOperationSource(), TerraformClientDiagnostics, Pipeline, TerraformRestClient.CreateExportTerraformRequest(Id.SubscriptionId, body).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Exports the Terraform configuration of the specified resource(s).
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureTerraform/exportTerraform
+ ///
+ /// -
+ /// Operation Id
+ /// Terraform_ExportTerraform
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-07-01-preview
+ ///
+ ///
+ ///
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The request body.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation ExportTerraform(WaitUntil waitUntil, CommonExportProperties body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(body, nameof(body));
+
+ using var scope = TerraformClientDiagnostics.CreateScope("MockableTerraformSubscriptionResource.ExportTerraform");
+ scope.Start();
+ try
+ {
+ var response = TerraformRestClient.ExportTerraform(Id.SubscriptionId, body, cancellationToken);
+ var operation = new TerraformArmOperation(new TerraformOperationStatusOperationSource(), TerraformClientDiagnostics, Pipeline, TerraformRestClient.CreateExportTerraformRequest(Id.SubscriptionId, body).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Extensions/TerraformExtensions.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Extensions/TerraformExtensions.cs
new file mode 100644
index 0000000000000..07abb8eda0f3b
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Extensions/TerraformExtensions.cs
@@ -0,0 +1,91 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.ResourceManager.Resources;
+using Azure.ResourceManager.Terraform.Mocking;
+using Azure.ResourceManager.Terraform.Models;
+
+namespace Azure.ResourceManager.Terraform
+{
+ /// A class to add extension methods to Azure.ResourceManager.Terraform.
+ public static partial class TerraformExtensions
+ {
+ private static MockableTerraformSubscriptionResource GetMockableTerraformSubscriptionResource(ArmResource resource)
+ {
+ return resource.GetCachedClient(client => new MockableTerraformSubscriptionResource(client, resource.Id));
+ }
+
+ ///
+ /// Exports the Terraform configuration of the specified resource(s).
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureTerraform/exportTerraform
+ ///
+ /// -
+ /// Operation Id
+ /// Terraform_ExportTerraform
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-07-01-preview
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The request body.
+ /// The cancellation token to use.
+ /// or is null.
+ public static async Task> ExportTerraformAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, CommonExportProperties body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+
+ return await GetMockableTerraformSubscriptionResource(subscriptionResource).ExportTerraformAsync(waitUntil, body, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Exports the Terraform configuration of the specified resource(s).
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureTerraform/exportTerraform
+ ///
+ /// -
+ /// Operation Id
+ /// Terraform_ExportTerraform
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-07-01-preview
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
+ /// The request body.
+ /// The cancellation token to use.
+ /// or is null.
+ public static ArmOperation ExportTerraform(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, CommonExportProperties body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+
+ return GetMockableTerraformSubscriptionResource(subscriptionResource).ExportTerraform(waitUntil, body, cancellationToken);
+ }
+ }
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/Argument.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/Argument.cs
new file mode 100644
index 0000000000000..2cbf70c62fe1e
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/Argument.cs
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Azure.ResourceManager.Terraform
+{
+ internal static class Argument
+ {
+ public static void AssertNotNull(T value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+
+ public static void AssertNotNull(T? value, string name)
+ where T : struct
+ {
+ if (!value.HasValue)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+
+ public static void AssertNotNullOrEmpty(IEnumerable value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (value is ICollection collectionOfT && collectionOfT.Count == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ if (value is ICollection collection && collection.Count == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ using IEnumerator e = value.GetEnumerator();
+ if (!e.MoveNext())
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ }
+
+ public static void AssertNotNullOrEmpty(string value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (value.Length == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty string.", name);
+ }
+ }
+
+ public static void AssertNotNullOrWhiteSpace(string value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (string.IsNullOrWhiteSpace(value))
+ {
+ throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name);
+ }
+ }
+
+ public static void AssertNotDefault(ref T value, string name)
+ where T : struct, IEquatable
+ {
+ if (value.Equals(default))
+ {
+ throw new ArgumentException("Value cannot be empty.", name);
+ }
+ }
+
+ public static void AssertInRange(T value, T minimum, T maximum, string name)
+ where T : notnull, IComparable
+ {
+ if (minimum.CompareTo(value) > 0)
+ {
+ throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed.");
+ }
+ if (maximum.CompareTo(value) < 0)
+ {
+ throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed.");
+ }
+ }
+
+ public static void AssertEnumDefined(Type enumType, object value, string name)
+ {
+ if (!Enum.IsDefined(enumType, value))
+ {
+ throw new ArgumentException($"Value not defined for {enumType.FullName}.", name);
+ }
+ }
+
+ public static T CheckNotNull(T value, string name)
+ where T : class
+ {
+ AssertNotNull(value, name);
+ return value;
+ }
+
+ public static string CheckNotNullOrEmpty(string value, string name)
+ {
+ AssertNotNullOrEmpty(value, name);
+ return value;
+ }
+
+ public static void AssertNull(T value, string name, string message = null)
+ {
+ if (value != null)
+ {
+ throw new ArgumentException(message ?? "Value must be null.", name);
+ }
+ }
+ }
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ChangeTrackingDictionary.cs
new file mode 100644
index 0000000000000..975398aa4c203
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ChangeTrackingDictionary.cs
@@ -0,0 +1,167 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Azure.ResourceManager.Terraform
+{
+ internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull
+ {
+ private IDictionary _innerDictionary;
+
+ public ChangeTrackingDictionary()
+ {
+ }
+
+ public ChangeTrackingDictionary(IDictionary dictionary)
+ {
+ if (dictionary == null)
+ {
+ return;
+ }
+ _innerDictionary = new Dictionary(dictionary);
+ }
+
+ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary)
+ {
+ if (dictionary == null)
+ {
+ return;
+ }
+ _innerDictionary = new Dictionary();
+ foreach (var pair in dictionary)
+ {
+ _innerDictionary.Add(pair);
+ }
+ }
+
+ public bool IsUndefined => _innerDictionary == null;
+
+ public int Count => IsUndefined ? 0 : EnsureDictionary().Count;
+
+ public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly;
+
+ public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys;
+
+ public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values;
+
+ public TValue this[TKey key]
+ {
+ get
+ {
+ if (IsUndefined)
+ {
+ throw new KeyNotFoundException(nameof(key));
+ }
+ return EnsureDictionary()[key];
+ }
+ set
+ {
+ EnsureDictionary()[key] = value;
+ }
+ }
+
+ IEnumerable IReadOnlyDictionary.Keys => Keys;
+
+ IEnumerable IReadOnlyDictionary.Values => Values;
+
+ public IEnumerator> GetEnumerator()
+ {
+ if (IsUndefined)
+ {
+ IEnumerator> enumerateEmpty()
+ {
+ yield break;
+ }
+ return enumerateEmpty();
+ }
+ return EnsureDictionary().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ public void Add(KeyValuePair item)
+ {
+ EnsureDictionary().Add(item);
+ }
+
+ public void Clear()
+ {
+ EnsureDictionary().Clear();
+ }
+
+ public bool Contains(KeyValuePair item)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureDictionary().Contains(item);
+ }
+
+ public void CopyTo(KeyValuePair[] array, int index)
+ {
+ if (IsUndefined)
+ {
+ return;
+ }
+ EnsureDictionary().CopyTo(array, index);
+ }
+
+ public bool Remove(KeyValuePair item)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureDictionary().Remove(item);
+ }
+
+ public void Add(TKey key, TValue value)
+ {
+ EnsureDictionary().Add(key, value);
+ }
+
+ public bool ContainsKey(TKey key)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureDictionary().ContainsKey(key);
+ }
+
+ public bool Remove(TKey key)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureDictionary().Remove(key);
+ }
+
+ public bool TryGetValue(TKey key, out TValue value)
+ {
+ if (IsUndefined)
+ {
+ value = default;
+ return false;
+ }
+ return EnsureDictionary().TryGetValue(key, out value);
+ }
+
+ public IDictionary EnsureDictionary()
+ {
+ return _innerDictionary ??= new Dictionary();
+ }
+ }
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ChangeTrackingList.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ChangeTrackingList.cs
new file mode 100644
index 0000000000000..3060ed9470d2c
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ChangeTrackingList.cs
@@ -0,0 +1,153 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Azure.ResourceManager.Terraform
+{
+ internal class ChangeTrackingList : IList, IReadOnlyList
+ {
+ private IList _innerList;
+
+ public ChangeTrackingList()
+ {
+ }
+
+ public ChangeTrackingList(IList innerList)
+ {
+ if (innerList != null)
+ {
+ _innerList = innerList;
+ }
+ }
+
+ public ChangeTrackingList(IReadOnlyList innerList)
+ {
+ if (innerList != null)
+ {
+ _innerList = innerList.ToList();
+ }
+ }
+
+ public bool IsUndefined => _innerList == null;
+
+ public int Count => IsUndefined ? 0 : EnsureList().Count;
+
+ public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly;
+
+ public T this[int index]
+ {
+ get
+ {
+ if (IsUndefined)
+ {
+ throw new ArgumentOutOfRangeException(nameof(index));
+ }
+ return EnsureList()[index];
+ }
+ set
+ {
+ if (IsUndefined)
+ {
+ throw new ArgumentOutOfRangeException(nameof(index));
+ }
+ EnsureList()[index] = value;
+ }
+ }
+
+ public void Reset()
+ {
+ _innerList = null;
+ }
+
+ public IEnumerator GetEnumerator()
+ {
+ if (IsUndefined)
+ {
+ IEnumerator enumerateEmpty()
+ {
+ yield break;
+ }
+ return enumerateEmpty();
+ }
+ return EnsureList().GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ public void Add(T item)
+ {
+ EnsureList().Add(item);
+ }
+
+ public void Clear()
+ {
+ EnsureList().Clear();
+ }
+
+ public bool Contains(T item)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureList().Contains(item);
+ }
+
+ public void CopyTo(T[] array, int arrayIndex)
+ {
+ if (IsUndefined)
+ {
+ return;
+ }
+ EnsureList().CopyTo(array, arrayIndex);
+ }
+
+ public bool Remove(T item)
+ {
+ if (IsUndefined)
+ {
+ return false;
+ }
+ return EnsureList().Remove(item);
+ }
+
+ public int IndexOf(T item)
+ {
+ if (IsUndefined)
+ {
+ return -1;
+ }
+ return EnsureList().IndexOf(item);
+ }
+
+ public void Insert(int index, T item)
+ {
+ EnsureList().Insert(index, item);
+ }
+
+ public void RemoveAt(int index)
+ {
+ if (IsUndefined)
+ {
+ throw new ArgumentOutOfRangeException(nameof(index));
+ }
+ EnsureList().RemoveAt(index);
+ }
+
+ public IList EnsureList()
+ {
+ return _innerList ??= new List();
+ }
+ }
+}
diff --git a/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ModelSerializationExtensions.cs
new file mode 100644
index 0000000000000..763bd6f7f9977
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/Internal/ModelSerializationExtensions.cs
@@ -0,0 +1,398 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using System.Text.Json;
+using System.Xml;
+using Azure.Core;
+
+namespace Azure.ResourceManager.Terraform
+{
+ internal static class ModelSerializationExtensions
+ {
+ internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W");
+
+ public static object GetObject(this JsonElement element)
+ {
+ switch (element.ValueKind)
+ {
+ case JsonValueKind.String:
+ return element.GetString();
+ case JsonValueKind.Number:
+ if (element.TryGetInt32(out int intValue))
+ {
+ return intValue;
+ }
+ if (element.TryGetInt64(out long longValue))
+ {
+ return longValue;
+ }
+ return element.GetDouble();
+ case JsonValueKind.True:
+ return true;
+ case JsonValueKind.False:
+ return false;
+ case JsonValueKind.Undefined:
+ case JsonValueKind.Null:
+ return null;
+ case JsonValueKind.Object:
+ var dictionary = new Dictionary();
+ foreach (var jsonProperty in element.EnumerateObject())
+ {
+ dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject());
+ }
+ return dictionary;
+ case JsonValueKind.Array:
+ var list = new List