Skip to content

Commit d18fd18

Browse files
Mahsa Hanifihelayoty
authored andcommitted
added the first draft of the az-svc-data-integration-mlw
ran the terraform recursive and fixed it changed the cares name into sample Add adf and fix AF to use id
1 parent 5ba8c23 commit d18fd18

39 files changed

+1855
-116
lines changed

infra/modules/providers/azure/data-factory/README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ An instance of the `data-factory` module deploys the _**Data Factory**_ in order
1717
- Ability to provision a single Data Factory instance
1818
- Ability to provision a configurable Pipeline
1919
- Ability to configure Trigger
20-
- Ability to configure SQL server Dataset
21-
- Ability to configure SQL server Linked Service
20+
2221

2322
## Out Of Scope
2423

2524
The following are not support in the time being
2625

2726
- Creating Multiple pipelines
28-
- Only SQL server Dataset/Linked Service are implemented.
2927

3028
## Definition
3129

@@ -35,8 +33,6 @@ Terraform resources used to define the `data-factory` module include the followi
3533
- [azurerm_data_factory_integration_runtime_managed](https://www.terraform.io/docs/providers/azurerm/r/data_factory_integration_runtime_managed.html)
3634
- [azurerm_data_factory_pipeline](https://www.terraform.io/docs/providers/azurerm/r/data_factory_pipeline.html)
3735
- [azurerm_data_factory_trigger_schedule](https://www.terraform.io/docs/providers/azurerm/r/data_factory_trigger_schedule.html)
38-
- [azurerm_data_factory_dataset_sql_server](https://www.terraform.io/docs/providers/azurerm/r/data_factory_dataset_sql_server_table.html)
39-
- [azurerm_data_factory_linked_service_sql_server](https://www.terraform.io/docs/providers/azurerm/r/data_factory_linked_service_sql_server.html)
4036

4137
## Usage
4238

@@ -60,11 +56,6 @@ module "data_factory" {
6056
data_factory_trigger_name = "adftrigger"
6157
data_factory_trigger_interval = 1
6258
data_factory_trigger_frequency = "Minute"
63-
data_factory_dataset_sql_name = "adfsqldataset"
64-
data_factory_dataset_sql_table_name = "adfsqldatasettable"
65-
data_factory_dataset_sql_folder = ""
66-
data_factory_linked_sql_name = "adfsqllinked"
67-
data_factory_linked_sql_connection_string = "Server=tcp:adfsql..."
6859
}
6960
```
7061

infra/modules/providers/azure/data-factory/datasets.tf

Lines changed: 0 additions & 8 deletions
This file was deleted.

infra/modules/providers/azure/data-factory/linkedservices.tf

Lines changed: 0 additions & 8 deletions
This file was deleted.

infra/modules/providers/azure/data-factory/output.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ output "trigger_interval" {
2828
value = azurerm_data_factory_trigger_schedule.main.interval
2929
}
3030

31-
output "sql_dataset_id" {
32-
description = "The ID of the SQL server dataset created"
33-
value = azurerm_data_factory_dataset_sql_server_table.main.id
34-
}
35-
36-
output "sql_linked_service_id" {
37-
description = "The ID of the SQL server Linked service created"
38-
value = azurerm_data_factory_linked_service_sql_server.main.id
39-
}
40-
4131
output "adf_identity_principal_id" {
4232
description = "The ID of the principal(client) in Azure active directory"
4333
value = azurerm_data_factory.main.identity[0].principal_id

infra/modules/providers/azure/data-factory/terraform.tfvars.template

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ resource_group_name = ""
22
data_factory_name = ""
33
data_factory_runtime_name = ""
44
data_factory_pipeline_name = ""
5-
data_factory_dataset_sql_name = ""
6-
data_factory_dataset_sql_table_name = ""
7-
data_factory_linked_sql_name = ""
8-
data_factory_linked_sql_connection_string = ""
5+
data_factory_trigger_name = ""
96
vnet_integration = {
107
vnet_id = ""
118
subnet_name = ""

infra/modules/providers/azure/data-factory/tests/integration/data_factory_integration_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ func TestDataFactory(t *testing.T) {
2525
"data_factory_name",
2626
"pipeline_name",
2727
),
28-
VerifyCreatedDataset(subscription,
29-
"resource_group_name",
30-
"data_factory_name",
31-
"sql_dataset_id",
32-
),
33-
VerifyCreatedLinkedService(subscription,
34-
"resource_group_name",
35-
"data_factory_name",
36-
"sql_linked_service_id",
37-
),
3828
},
3929
}
4030
integration.RunIntegrationTests(&testFixture)
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
resource_group_name = "adftest"
2-
data_factory_name = "adftest"
3-
data_factory_runtime_name = "adfrttest"
4-
data_factory_pipeline_name = "testpipeline"
5-
data_factory_trigger_name = "testtrigger"
6-
data_factory_dataset_sql_name = "testsql"
7-
data_factory_dataset_sql_table_name = "adfsqltableheba"
8-
data_factory_linked_sql_name = "testlinkedsql"
9-
data_factory_linked_sql_connection_string = "connectionstring"
1+
resource_group_name = ""
2+
data_factory_name = ""
3+
data_factory_runtime_name = ""
4+
data_factory_pipeline_name = ""
5+
data_factory_trigger_name = ""
106
vnet_integration = {
11-
vnet_id = "/subscriptions/resourceGroups/providers/Microsoft.Network/virtualNetworks/testvnet"
12-
subnet_name = "default"
7+
vnet_id = ""
8+
subnet_name = ""
139
}

infra/modules/providers/azure/data-factory/tests/unit/data_factory_unit_test.go

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
package unit
22

33
import (
4-
"encoding/json"
5-
"strings"
64
"testing"
7-
8-
"github.com/gruntwork-io/terratest/modules/random"
95
tests "github.com/microsoft/cobalt/infra/modules/providers/azure/data-factory/tests"
106
"github.com/microsoft/terratest-abstraction/unit"
117
)
128

13-
// helper function to parse blocks of JSON into a generic Go map
14-
func asMap(t *testing.T, jsonString string) map[string]interface{} {
15-
var theMap map[string]interface{}
16-
if err := json.Unmarshal([]byte(jsonString), &theMap); err != nil {
17-
t.Fatal(err)
18-
}
19-
return theMap
20-
}
21-
229
func TestTemplate(t *testing.T) {
2310

2411
expectedDataFactory := map[string]interface{}{
@@ -53,27 +40,16 @@ func TestTemplate(t *testing.T) {
5340
"frequency": "Minute",
5441
}
5542

56-
expectedDatasetSQL := map[string]interface{}{
57-
"name": "testsql",
58-
}
59-
60-
expectedLinkedSQL := map[string]interface{}{
61-
"name": "testlinkedsql",
62-
"connection_string": "connectionstring",
63-
}
64-
6543
testFixture := unit.UnitTestFixture{
6644
GoTest: t,
6745
TfOptions: tests.DataFactoryTFOptions,
6846
PlanAssertions: nil,
69-
ExpectedResourceCount: 6,
47+
ExpectedResourceCount: 4,
7048
ExpectedResourceAttributeValues: unit.ResourceDescription{
7149
"azurerm_data_factory.main": expectedDataFactory,
7250
"azurerm_data_factory_integration_runtime_managed.main": expectedDFIntRunTime,
7351
"azurerm_data_factory_pipeline.main": expectedPipeline,
7452
"azurerm_data_factory_trigger_schedule.main": expectedTrigger,
75-
"azurerm_data_factory_dataset_sql_server_table.main": expectedDatasetSQL,
76-
"azurerm_data_factory_linked_service_sql_server.main": expectedLinkedSQL,
7753
},
7854
}
7955

infra/modules/providers/azure/data-factory/variables.tf

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -68,34 +68,4 @@ variable "data_factory_trigger_frequency" {
6868
description = "The trigger freqency. Valid values include Minute, Hour, Day, Week, Month. Defaults to Minute."
6969
type = string
7070
default = "Minute"
71-
}
72-
73-
variable "data_factory_dataset_sql_name" {
74-
description = "Specifies the name of the Data Factory Dataset SQL Server Table. Only letters, numbers and '_' are allowed."
75-
type = string
76-
default = ""
77-
}
78-
79-
variable "data_factory_dataset_sql_table_name" {
80-
description = "The table name of the Data Factory Dataset SQL Server Table."
81-
type = string
82-
default = ""
83-
}
84-
85-
variable "data_factory_dataset_sql_folder" {
86-
description = "The folder that this Dataset is in. If not specified, the Dataset will appear at the root level."
87-
type = string
88-
default = ""
89-
}
90-
91-
variable "data_factory_linked_sql_name" {
92-
description = "Specifies the name of the Data Factory Linked Service SQL Server. Changing this forces a new resource to be created."
93-
type = string
94-
default = ""
95-
}
96-
97-
variable "data_factory_linked_sql_connection_string" {
98-
description = "The connection string in which to authenticate with the SQL Server."
99-
type = string
100-
default = ""
10171
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export ARM_ACCESS_KEY=
2+
export ARM_CLIENT_ID=
3+
export ARM_CLIENT_SECRET=
4+
export ARM_SUBSCRIPTION_ID=
5+
export ARM_TENANT_ID=
6+
export BUILD_BUILDID=1
7+
export GO_VERSION=1.12.5
8+
export TF_VAR_remote_state_account=
9+
export TF_VAR_remote_state_container=
10+
export TF_VERSION=0.12.4
11+
export TF_WARN_OUTPUT_ERRORS=1
12+
export TF_VAR_resource_group_location=eastus

0 commit comments

Comments
 (0)