-
Notifications
You must be signed in to change notification settings - Fork 135
gmurphy-finops-toolkit-xcloud-gcp-pipeline #1425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: features/xcloud
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,9 @@ param tagsByResource object = {} | |
@description('Optional. Enable public access.') | ||
param enablePublicAccess bool | ||
|
||
@description('The wildcard folder path for the GCP billing data.') | ||
param gcpBillingWildcardFolderPath string | ||
|
||
//------------------------------------------------------------------------------ | ||
// Variables | ||
//------------------------------------------------------------------------------ | ||
|
@@ -4743,6 +4746,121 @@ resource pipeline_ExecuteIngestionETL 'Microsoft.DataFactory/factories/pipelines | |
} | ||
} | ||
|
||
//------------------------------------------------------------------------------ | ||
// import_gcp_billing_data pipeline | ||
//------------------------------------------------------------------------------ | ||
resource importGCPBillingDataPipeline 'Microsoft.DataFactory/factories/pipelines@2018-06-01' = { | ||
name: 'import_gcp_billing_data' | ||
parent: dataFactory | ||
properties: { | ||
activities: [ | ||
{ | ||
name: 'convert gcp csv' | ||
type: 'Copy' | ||
dependsOn: [ | ||
{ | ||
activity: 'Delete Target' | ||
dependencyConditions: [ | ||
'Completed' | ||
] | ||
} | ||
] | ||
policy: { | ||
timeout: '0.12:00:00' | ||
retry: 0 | ||
retryIntervalInSeconds: 30 | ||
secureOutput: false | ||
secureInput: false | ||
} | ||
typeProperties: { | ||
source: { | ||
type: 'DelimitedTextSource' | ||
storeSettings: { | ||
type: 'GoogleCloudStorageReadSettings' | ||
recursive: true | ||
wildcardFolderPath: gcpBillingWildcardFolderPath // Parameterized value | ||
wildcardFileName: '*' | ||
enablePartitionDiscovery: false | ||
} | ||
formatSettings: { | ||
type: 'DelimitedTextReadSettings' | ||
} | ||
} | ||
sink: { | ||
type: 'ParquetSink' | ||
storeSettings: { | ||
type: 'AzureBlobFSWriteSettings' | ||
} | ||
formatSettings: { | ||
type: 'ParquetWriteSettings' | ||
} | ||
} | ||
enableStaging: false | ||
translator: { | ||
type: 'TabularTranslator' | ||
mappings: [ | ||
{ | ||
source: { | ||
name: 'BillingAccountId' | ||
type: 'String' | ||
physicalType: 'String' | ||
} | ||
sink: { | ||
name: 'BillingAccountId' | ||
type: 'String' | ||
physicalType: 'String' | ||
} | ||
} | ||
// Add all other mappings here as per your JSON | ||
] | ||
typeConversion: true | ||
typeConversionSettings: { | ||
allowDataTruncation: true | ||
treatBooleanAsNumber: false | ||
} | ||
} | ||
} | ||
inputs: [ | ||
{ | ||
referenceName: 'GCSbillingexportBucket' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing the definition for the dataset and linked service. We should store the secret in KeyVault. |
||
type: 'DatasetReference' | ||
} | ||
] | ||
outputs: [ | ||
{ | ||
referenceName: 'gcp_ingestion' | ||
type: 'DatasetReference' | ||
} | ||
] | ||
} | ||
{ | ||
name: 'Delete Target' | ||
type: 'Delete' | ||
dependsOn: [] | ||
policy: { | ||
timeout: '0.12:00:00' | ||
retry: 0 | ||
retryIntervalInSeconds: 30 | ||
secureOutput: false | ||
secureInput: false | ||
} | ||
typeProperties: { | ||
dataset: { | ||
referenceName: 'gcp_ingestion' | ||
type: 'DatasetReference' | ||
} | ||
enableLogging: false | ||
storeSettings: { | ||
type: 'AzureBlobFSReadSettings' | ||
recursive: true | ||
enablePartitionDiscovery: false | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
|
||
//------------------------------------------------------------------------------ | ||
// Start all triggers | ||
//------------------------------------------------------------------------------ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mappings should be stored in the config/schema folder. We also need to be able to detect and load the correct schema version to account for future updates.