-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.bicep
135 lines (124 loc) · 3.66 KB
/
main.bicep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
@description('Data Factory Name')
param dataFactoryName string = 'datafactory${uniqueString(resourceGroup().id)}'
@description('Location of the data factory.')
param location string = resourceGroup().location
@description('Name of the Azure storage account that contains the input/output data.')
param storageAccountName string = 'storage${uniqueString(resourceGroup().id)}'
@description('Name of the blob container in the Azure Storage account.')
param blobContainerName string = 'blob${uniqueString(resourceGroup().id)}'
var dataFactoryLinkedServiceName = 'ArmtemplateStorageLinkedService'
var dataFactoryDataSetInName = 'ArmtemplateTestDatasetIn'
var dataFactoryDataSetOutName = 'ArmtemplateTestDatasetOut'
var pipelineName = 'ArmtemplateSampleCopyPipeline'
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-04-01' = {
name: storageAccountName
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
}
resource blobContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2021-04-01' = {
name: '${storageAccount.name}/default/${blobContainerName}'
}
resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' = {
name: dataFactoryName
location: location
identity: {
type: 'SystemAssigned'
}
}
resource dataFactoryLinkedService 'Microsoft.DataFactory/factories/linkedservices@2018-06-01' = {
parent: dataFactory
name: dataFactoryLinkedServiceName
properties: {
type: 'AzureBlobStorage'
typeProperties: {
connectionString: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value}'
}
}
}
resource dataFactoryDataSetIn 'Microsoft.DataFactory/factories/datasets@2018-06-01' = {
parent: dataFactory
name: dataFactoryDataSetInName
properties: {
linkedServiceName: {
referenceName: dataFactoryLinkedService.name
type: 'LinkedServiceReference'
}
type: 'Binary'
typeProperties: {
location: {
type: 'AzureBlobStorageLocation'
container: blobContainer.name
folderPath: 'input'
fileName: 'emp.txt'
}
}
}
}
resource dataFactoryDataSetOut 'Microsoft.DataFactory/factories/datasets@2018-06-01' = {
parent: dataFactory
name: dataFactoryDataSetOutName
properties: {
linkedServiceName: {
referenceName: dataFactoryLinkedService.name
type: 'LinkedServiceReference'
}
type: 'Binary'
typeProperties: {
location: {
type: 'AzureBlobStorageLocation'
container: blobContainer.name
folderPath: 'output'
}
}
}
}
resource dataFactoryPipeline 'Microsoft.DataFactory/factories/pipelines@2018-06-01' = {
parent: dataFactory
name: pipelineName
properties: {
activities: [
any({
name: 'MyCopyActivity'
type: 'Copy'
policy: {
timeout: '7.00:00:00'
retry: 0
retryIntervalInSeconds: 30
secureOutput: false
secureInput: false
}
typeProperties: {
source: {
type: 'BinarySource'
storeSettings: {
type: 'AzureBlobStorageReadSettings'
recursive: true
}
}
sink: {
type: 'BinarySink'
storeSettings: {
type: 'AzureBlobStorageWriterSettings'
}
}
enableStaging: false
}
inputs: [
{
referenceName: dataFactoryDataSetIn.name
type: 'DatasetReference'
}
]
outputs: [
{
referenceName: dataFactoryDataSetOut.name
type: 'DatasetReference'
}
]
})
]
}
}