From 586c24bd1a7f4632ebee20f9ac10a192c4882d38 Mon Sep 17 00:00:00 2001 From: njucz Date: Tue, 8 Jun 2021 17:12:15 +0800 Subject: [PATCH 1/5] new resource --- ...ry_linked_service_azure_search_resource.go | 252 ++++++++++++++++++ ...nked_service_azure_search_resource_test.go | 184 +++++++++++++ .../services/datafactory/registration.go | 5 +- 3 files changed, 439 insertions(+), 2 deletions(-) create mode 100644 azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go create mode 100644 azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource_test.go diff --git a/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go b/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go new file mode 100644 index 000000000000..fbc80015861a --- /dev/null +++ b/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go @@ -0,0 +1,252 @@ +package datafactory + +import ( + "fmt" + "time" + + "github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory/validate" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func resourceDataFactoryLinkedServiceAzureSearch() *pluginsdk.Resource { + return &pluginsdk.Resource{ + Create: resourceDataFactoryLinkedServiceAzureSearchCreateUpdate, + Read: resourceDataFactoryLinkedServiceAzureSearchRead, + Update: resourceDataFactoryLinkedServiceAzureSearchCreateUpdate, + Delete: resourceDataFactoryLinkedServiceAzureSearchDelete, + + // TODO: replace this with an importer which validates the ID during import + Importer: pluginsdk.DefaultImporter(), + + Timeouts: &pluginsdk.ResourceTimeout{ + Create: pluginsdk.DefaultTimeout(30 * time.Minute), + Read: pluginsdk.DefaultTimeout(5 * time.Minute), + Update: pluginsdk.DefaultTimeout(30 * time.Minute), + Delete: pluginsdk.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*pluginsdk.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.LinkedServiceDatasetName, + }, + + "data_factory_id": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.DataFactoryID, + }, + + "url": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "search_service_key": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "description": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "integration_runtime_name": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "parameters": { + Type: pluginsdk.TypeMap, + Optional: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "annotations": { + Type: pluginsdk.TypeList, + Optional: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "additional_properties": { + Type: pluginsdk.TypeMap, + Optional: true, + Elem: &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + }, + }, + + "encrypted_credential": { + Type: pluginsdk.TypeString, + Computed: true, + }, + }, + } +} + +func resourceDataFactoryLinkedServiceAzureSearchCreateUpdate(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).DataFactory.LinkedServiceClient + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + + dataFactoryId, err := parse.DataFactoryID(d.Get("data_factory_id").(string)) + if err != nil { + return err + } + + id := parse.NewLinkedServiceID(subscriptionId, dataFactoryId.ResourceGroup, dataFactoryId.FactoryName, d.Get("name").(string)) + if d.IsNewResource() { + existing, err := client.Get(ctx, id.ResourceGroup, id.FactoryName, id.Name, "") + if err != nil { + if !utils.ResponseWasNotFound(existing.Response) { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + } + if !utils.ResponseWasNotFound(existing.Response) { + return tf.ImportAsExistsError("azurerm_data_factory_linked_service_search", id.ID()) + } + } + + searchLinkedService := &datafactory.AzureSearchLinkedService{ + AzureSearchLinkedServiceTypeProperties: &datafactory.AzureSearchLinkedServiceTypeProperties{ + URL: d.Get("url").(string), + Key: &datafactory.SecureString{ + Type: datafactory.TypeTypeSecureString, + Value: utils.String(d.Get("search_service_key").(string)), + }, + }, + Description: utils.String(d.Get("description").(string)), + Type: datafactory.TypeBasicLinkedServiceTypeAzureSearch, + } + + if v, ok := d.GetOk("parameters"); ok { + searchLinkedService.Parameters = expandDataFactoryParameters(v.(map[string]interface{})) + } + + if v, ok := d.GetOk("integration_runtime_name"); ok { + searchLinkedService.ConnectVia = expandDataFactoryLinkedServiceIntegrationRuntime(v.(string)) + } + + if v, ok := d.GetOk("additional_properties"); ok { + searchLinkedService.AdditionalProperties = v.(map[string]interface{}) + } + + if v, ok := d.GetOk("annotations"); ok { + annotations := v.([]interface{}) + searchLinkedService.Annotations = &annotations + } + + linkedService := datafactory.LinkedServiceResource{ + Properties: searchLinkedService, + } + + if _, err := client.CreateOrUpdate(ctx, id.ResourceGroup, id.FactoryName, id.Name, linkedService, ""); err != nil { + return fmt.Errorf("creating/updating %s: %+v", id, err) + } + + d.SetId(id.ID()) + + return resourceDataFactoryLinkedServiceAzureSearchRead(d, meta) +} + +func resourceDataFactoryLinkedServiceAzureSearchRead(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).DataFactory.LinkedServiceClient + subscriptionId := meta.(*clients.Client).Account.SubscriptionId + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.LinkedServiceID(d.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, id.ResourceGroup, id.FactoryName, id.Name, "") + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + d.SetId("") + return nil + } + + return fmt.Errorf("retrieving %s: %+v", id, err) + } + + d.Set("name", id.Name) + d.Set("data_factory_id", parse.NewDataFactoryID(subscriptionId, id.ResourceGroup, id.FactoryName).ID()) + + linkedService, ok := resp.Properties.AsAzureSearchLinkedService() + if !ok { + return fmt.Errorf("classifiying %s: Expected: %q", id, datafactory.TypeBasicLinkedServiceTypeAzureSearch) + } + + if prop := linkedService.AzureSearchLinkedServiceTypeProperties; prop != nil { + url := "" + if v, ok := prop.URL.(string); ok { + url = v + } + d.Set("url", url) + + encryptedCredential := "" + if v, ok := prop.EncryptedCredential.(string); ok { + encryptedCredential = v + } + d.Set("encrypted_credential", encryptedCredential) + } + + d.Set("additional_properties", linkedService.AdditionalProperties) + d.Set("description", linkedService.Description) + + if err := d.Set("annotations", flattenDataFactoryAnnotations(linkedService.Annotations)); err != nil { + return fmt.Errorf("setting `annotations`: %+v", err) + } + + if err := d.Set("parameters", flattenDataFactoryParameters(linkedService.Parameters)); err != nil { + return fmt.Errorf("setting `parameters`: %+v", err) + } + + integrationRuntimeName := "" + if linkedService.ConnectVia != nil && linkedService.ConnectVia.ReferenceName != nil { + integrationRuntimeName = *linkedService.ConnectVia.ReferenceName + } + d.Set("integration_runtime_name", integrationRuntimeName) + + return nil +} + +func resourceDataFactoryLinkedServiceAzureSearchDelete(d *pluginsdk.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).DataFactory.LinkedServiceClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.LinkedServiceID(d.Id()) + if err != nil { + return err + } + + if _, err := client.Delete(ctx, id.ResourceGroup, id.FactoryName, id.Name); err != nil { + //if !utils.ResponseWasNotFound(response) { + return fmt.Errorf("deleting %s: %+v", id, err) + //} + } + + return nil +} diff --git a/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource_test.go b/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource_test.go new file mode 100644 index 000000000000..0f9d1f45b200 --- /dev/null +++ b/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource_test.go @@ -0,0 +1,184 @@ +package datafactory_test + +import ( + "context" + "fmt" + "testing" + + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance/check" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/pluginsdk" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +type LinkedServiceSearchResource struct { +} + +func TestAccDataFactoryLinkedServiceAzureSearch_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_factory_linked_service_azure_search", "test") + r := LinkedServiceSearchResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("encrypted_credential").Exists(), + ), + }, + data.ImportStep("search_service_key"), + }) +} + +func TestAccDataFactoryLinkedServiceAzureSearch_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_factory_linked_service_azure_search", "test") + r := LinkedServiceSearchResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.RequiresImportErrorStep(r.requiresImport), + }) +} + +func TestAccDataFactoryLinkedServiceAzureSearch_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_factory_linked_service_azure_search", "test") + r := LinkedServiceSearchResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("search_service_key"), + }) +} + +func TestAccDataFactoryLinkedServiceAzureSearch_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_factory_linked_service_azure_search", "test") + r := LinkedServiceSearchResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("search_service_key"), + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("search_service_key"), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("search_service_key"), + }) +} + +func (t LinkedServiceSearchResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := parse.LinkedServiceID(state.ID) + if err != nil { + return nil, err + } + + resp, err := clients.DataFactory.LinkedServiceClient.Get(ctx, id.ResourceGroup, id.FactoryName, id.Name, "") + if err != nil { + return nil, fmt.Errorf("reading %s: %+v", id, err) + } + + return utils.Bool(resp.ID != nil), nil +} + +func (r LinkedServiceSearchResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_data_factory_linked_service_azure_search" "test" { + name = "acctestlssearch%d" + data_factory_id = azurerm_data_factory.test.id + url = join("", ["https://", azurerm_search_service.test.name, ".search.windows.net"]) + search_service_key = azurerm_search_service.test.primary_key +} +`, r.template(data), data.RandomInteger) +} + +func (r LinkedServiceSearchResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_data_factory_linked_service_azure_search" "import" { + name = azurerm_data_factory_linked_service_azure_search.test.name + data_factory_id = azurerm_data_factory_linked_service_azure_search.test.data_factory_id + url = azurerm_data_factory_linked_service_azure_search.test.url + search_service_key = azurerm_data_factory_linked_service_azure_search.test.search_service_key +} +`, r.basic(data)) +} + +func (r LinkedServiceSearchResource) complete(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_data_factory_linked_service_azure_search" "test" { + name = "acctestlssearch%d" + data_factory_id = azurerm_data_factory.test.id + url = join("", ["https://", azurerm_search_service.test.name, ".search.windows.net"]) + search_service_key = azurerm_search_service.test.primary_key + + annotations = ["test1", "test2", "test3"] + description = "test description" + + parameters = { + foo = "test1" + bar = "test2" + } + + additional_properties = { + foo = "test1" + bar = "test2" + } +} +`, r.template(data), data.RandomInteger) +} + +func (LinkedServiceSearchResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-df-%d" + location = "%s" +} + +resource "azurerm_data_factory" "test" { + name = "acctestdf%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name +} + +resource "azurerm_search_service" "test" { + name = "acctestsearchservice%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + sku = "standard" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} diff --git a/azurerm/internal/services/datafactory/registration.go b/azurerm/internal/services/datafactory/registration.go index a9581269d7d5..5a27a9bb0bff 100644 --- a/azurerm/internal/services/datafactory/registration.go +++ b/azurerm/internal/services/datafactory/registration.go @@ -45,10 +45,11 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { "azurerm_data_factory_integration_runtime_self_hosted": resourceDataFactoryIntegrationRuntimeSelfHosted(), "azurerm_data_factory_linked_service_azure_blob_storage": resourceDataFactoryLinkedServiceAzureBlobStorage(), "azurerm_data_factory_linked_service_azure_databricks": resourceDataFactoryLinkedServiceAzureDatabricks(), - "azurerm_data_factory_linked_service_azure_table_storage": resourceDataFactoryLinkedServiceAzureTableStorage(), "azurerm_data_factory_linked_service_azure_file_storage": resourceDataFactoryLinkedServiceAzureFileStorage(), - "azurerm_data_factory_linked_service_azure_sql_database": resourceDataFactoryLinkedServiceAzureSQLDatabase(), "azurerm_data_factory_linked_service_azure_function": resourceDataFactoryLinkedServiceAzureFunction(), + "azurerm_data_factory_linked_service_azure_sql_database": resourceDataFactoryLinkedServiceAzureSQLDatabase(), + "azurerm_data_factory_linked_service_azure_search": resourceDataFactoryLinkedServiceAzureSearch(), + "azurerm_data_factory_linked_service_azure_table_storage": resourceDataFactoryLinkedServiceAzureTableStorage(), "azurerm_data_factory_linked_service_cosmosdb": resourceDataFactoryLinkedServiceCosmosDb(), "azurerm_data_factory_linked_service_data_lake_storage_gen2": resourceDataFactoryLinkedServiceDataLakeStorageGen2(), "azurerm_data_factory_linked_service_key_vault": resourceDataFactoryLinkedServiceKeyVault(), From 7e9db3f4237b7d68c4d0179a8d1585d00aacf629 Mon Sep 17 00:00:00 2001 From: njucz Date: Wed, 9 Jun 2021 11:12:27 +0800 Subject: [PATCH 2/5] add doc --- ...ry_linked_service_azure_search_resource.go | 2 +- ..._linked_service_azure_search.html.markdown | 88 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 website/docs/r/data_factory_linked_service_azure_search.html.markdown diff --git a/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go b/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go index fbc80015861a..b26dc6b71a6b 100644 --- a/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go +++ b/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go @@ -123,7 +123,7 @@ func resourceDataFactoryLinkedServiceAzureSearchCreateUpdate(d *pluginsdk.Resour } } if !utils.ResponseWasNotFound(existing.Response) { - return tf.ImportAsExistsError("azurerm_data_factory_linked_service_search", id.ID()) + return tf.ImportAsExistsError("azurerm_data_factory_linked_service_azure_search", id.ID()) } } diff --git a/website/docs/r/data_factory_linked_service_azure_search.html.markdown b/website/docs/r/data_factory_linked_service_azure_search.html.markdown new file mode 100644 index 000000000000..e39b04b10688 --- /dev/null +++ b/website/docs/r/data_factory_linked_service_azure_search.html.markdown @@ -0,0 +1,88 @@ +--- +subcategory: "Data Factory" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_data_factory_linked_service_azure_search" +description: |- + Manages a Linked Service (connection) between Azure Search Service and Azure Data Factory. +--- + +# azurerm_data_factory_linked_service_azure_search + +Manages a Linked Service (connection) between Azure Search Service and Azure Data Factory. + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_data_factory" "example" { + name = "example" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name +} + +resource "azurerm_search_service" "example" { + name = "example-search-service" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + sku = "standard" +} + +resource "azurerm_data_factory_linked_service_azure_search" "test" { + name = "example" + data_factory_id = azurerm_data_factory.example.id + url = join("", ["https://", azurerm_search_service.example.name, ".search.windows.net"]) + search_service_key = azurerm_search_service.example.primary_key +} +``` + +## Argument Reference + +The following supported arguments are common across all Azure Data Factory Linked Services: + +* `name` - (Required) Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data + factory. See the [Microsoft documentation](https://docs.microsoft.com/en-us/azure/data-factory/naming-rules) for all restrictions. + +* `data_factory_id` - (Required) The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource. + +* `description` - (Optional) The description for the Data Factory Linked Service. + +* `integration_runtime_name` - (Optional) The integration runtime reference to associate with the Data Factory Linked Service. + +* `annotations` - (Optional) List of tags that can be used for describing the Data Factory Linked Service. + +* `parameters` - (Optional) A map of parameters to associate with the Data Factory Linked Service. + +* `additional_properties` - (Optional) A map of additional properties to associate with the Data Factory Linked Service. + +The following supported arguments are specific to Azure Search Linked Service: + +* `url` - (Required) The URL of the Search Service endpoint (e.g. https://{searchServiceName}.search.windows.net). + +* `search_service_key` - (Required) The key of the Azure Search Service. + +## Attributes Reference + +The following attributes are exported: + +* `id` - The ID of the Data Factory Linked Service. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Data Factory Linked Service. +* `update` - (Defaults to 30 minutes) Used when updating the Data Factory Linked Service. +* `read` - (Defaults to 5 minutes) Used when retrieving the Data Factory Linked Service. +* `delete` - (Defaults to 30 minutes) Used when deleting the Data Factory Linked Service. + +## Import + +Data Factory Linked Service's can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_data_factory_linked_service_azure_search.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/linkedservices/example +``` From 9cde07a5405d3b0e72e1f931f76a65a9555c57f7 Mon Sep 17 00:00:00 2001 From: njucz Date: Wed, 9 Jun 2021 11:15:31 +0800 Subject: [PATCH 3/5] update --- .../data_factory_linked_service_azure_search_resource.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go b/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go index b26dc6b71a6b..b1573178b551 100644 --- a/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go +++ b/azurerm/internal/services/datafactory/data_factory_linked_service_azure_search_resource.go @@ -243,9 +243,7 @@ func resourceDataFactoryLinkedServiceAzureSearchDelete(d *pluginsdk.ResourceData } if _, err := client.Delete(ctx, id.ResourceGroup, id.FactoryName, id.Name); err != nil { - //if !utils.ResponseWasNotFound(response) { return fmt.Errorf("deleting %s: %+v", id, err) - //} } return nil From 53323ca3fcff4e8d3363c5079f14d5e9270e8241 Mon Sep 17 00:00:00 2001 From: njucz Date: Wed, 9 Jun 2021 11:18:55 +0800 Subject: [PATCH 4/5] update --- azurerm/internal/services/datafactory/registration.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/internal/services/datafactory/registration.go b/azurerm/internal/services/datafactory/registration.go index 5a27a9bb0bff..abae0ce92d6a 100644 --- a/azurerm/internal/services/datafactory/registration.go +++ b/azurerm/internal/services/datafactory/registration.go @@ -47,8 +47,8 @@ func (r Registration) SupportedResources() map[string]*pluginsdk.Resource { "azurerm_data_factory_linked_service_azure_databricks": resourceDataFactoryLinkedServiceAzureDatabricks(), "azurerm_data_factory_linked_service_azure_file_storage": resourceDataFactoryLinkedServiceAzureFileStorage(), "azurerm_data_factory_linked_service_azure_function": resourceDataFactoryLinkedServiceAzureFunction(), - "azurerm_data_factory_linked_service_azure_sql_database": resourceDataFactoryLinkedServiceAzureSQLDatabase(), "azurerm_data_factory_linked_service_azure_search": resourceDataFactoryLinkedServiceAzureSearch(), + "azurerm_data_factory_linked_service_azure_sql_database": resourceDataFactoryLinkedServiceAzureSQLDatabase(), "azurerm_data_factory_linked_service_azure_table_storage": resourceDataFactoryLinkedServiceAzureTableStorage(), "azurerm_data_factory_linked_service_cosmosdb": resourceDataFactoryLinkedServiceCosmosDb(), "azurerm_data_factory_linked_service_data_lake_storage_gen2": resourceDataFactoryLinkedServiceDataLakeStorageGen2(), From bd43bdaf503a0046b51230bec985e1520e188f97 Mon Sep 17 00:00:00 2001 From: njucz <740360112@qq.com> Date: Thu, 10 Jun 2021 11:16:54 +0800 Subject: [PATCH 5/5] update doc --- .../r/data_factory_linked_service_azure_search.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/r/data_factory_linked_service_azure_search.html.markdown b/website/docs/r/data_factory_linked_service_azure_search.html.markdown index e39b04b10688..bd7ee30ffc7c 100644 --- a/website/docs/r/data_factory_linked_service_azure_search.html.markdown +++ b/website/docs/r/data_factory_linked_service_azure_search.html.markdown @@ -70,6 +70,8 @@ The following attributes are exported: * `id` - The ID of the Data Factory Linked Service. +* `encrypted_credential` - The encrypted credential to connnect to Azure Search Service. + ## Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: