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 000000000000..ddba641f3bc5
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/Azure.ResourceManager.Terraform.sln
@@ -0,0 +1,56 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Terraform", "src\Azure.ResourceManager.Terraform.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Terraform.Tests", "tests\Azure.ResourceManager.Terraform.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ 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 000000000000..13dd08af78ab
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Release History
+
+## 1.0.0-beta.1 (Unreleased)
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
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 000000000000..63bd836ad44b
--- /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 000000000000..717a0c308b17
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/README.md
@@ -0,0 +1,86 @@
+# Azure.ResourceManager.Terraform client library for .NET
+
+Azure.ResourceManager.Terraform is a managed service that helps developers get secret simply and securely.
+
+Use the client library for to:
+
+* [Get secret](https://docs.microsoft.com/azure)
+
+[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples]
+
+ [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/terraform/Azure.ResourceManager.Terraform/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure)
+
+## Getting started
+
+This section should include everything a developer needs to do to install and create their first client connection *very quickly*.
+
+### Install the package
+
+First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository.
+
+Install the client library for .NET with [NuGet](https://www.nuget.org/ ):
+
+```dotnetcli
+dotnet add package Azure.ResourceManager.Terraform --prerelease
+```
+
+### Prerequisites
+
+Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB:
+
+> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`.
+
+### Authenticate the client
+
+If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating.
+
+For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object.
+
+## Key concepts
+
+The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity.
+
+Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of:
+
+### Thread safety
+
+We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads.
+
+### Additional concepts
+
+[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
+[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
+[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
+[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
+[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) |
+[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) |
+[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
+
+
+## Examples
+
+You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/terraform/Azure.ResourceManager.Terraform/samples).
+
+## Troubleshooting
+
+Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery.
+
+Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API.
+
+If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code.
+
+## Next steps
+
+* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory.
+* If appropriate, point users to other packages that might be useful.
+* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for.
+
+## Contributing
+
+This is a template, but your SDK readme should include details on how to contribute code to the repo/package.
+
+
+[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization
+[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
+
+
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 000000000000..6fb15ec111fe
--- /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
+ BaseExportModel body = new ExportResourceGroup("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 000000000000..6c5f384f826b
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Azure.ResourceManager.Terraform.csproj
@@ -0,0 +1,10 @@
+
+
+ This is the Azure.ResourceManager.Terraform client library for developing .NET applications with rich experience.
+ Azure SDK Code Generation Azure.ResourceManager.Terraform for Azure Data Plane
+ 1.0.0-beta.1
+ Azure.ResourceManager.Terraform
+ $(RequiredTargetFrameworks)
+ true
+
+
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 000000000000..7714311dc438
--- /dev/null
+++ b/sdk/terraform/Azure.ResourceManager.Terraform/src/Generated/ArmTerraformModelFactory.cs
@@ -0,0 +1,92 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+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 ExportQuery ExportQuery(TargetProvider? targetProvider = null, bool? fullProperties = null, bool? maskSensitive = null, string query = null, string namePattern = null, bool? recursive = null)
+ {
+ return new ExportQuery(
+ Type.ExportQuery,
+ targetProvider,
+ fullProperties,
+ maskSensitive,
+ serializedAdditionalRawData: null,
+ query,
+ namePattern,
+ recursive);
+ }
+
+ /// 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 ExportResourceGroup ExportResourceGroup(TargetProvider? targetProvider = null, bool? fullProperties = null, bool? maskSensitive = null, string resourceGroupName = null, string namePattern = null)
+ {
+ return new ExportResourceGroup(
+ Type.ExportResourceGroup,
+ targetProvider,
+ fullProperties,
+ maskSensitive,
+ 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(ExportResult properties = null, ResourceProvisioningState 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 ExportResult ExportResult(string configuration = null, IEnumerable skippedResources = null, IEnumerable errors = null)
+ {
+ skippedResources ??= new List();
+ errors ??= new List();
+
+ return new ExportResult(configuration, skippedResources?.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 000000000000..4eb7c57a0d9b
--- /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, BaseExportModel 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, BaseExportModel 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 000000000000..c1dc7136fef3
--- /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, BaseExportModel 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, BaseExportModel 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 000000000000..2cbf70c62fe1
--- /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 000000000000..975398aa4c20
--- /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 000000000000..3060ed9470d2
--- /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 000000000000..763bd6f7f997
--- /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