Bicep script to create Azure Data Factory Dataset for Source and Destination or Sink

41 Views Asked by At

I am trying different approaches to create the dataset of Azure data factory for the type Cosmos DB Mongo DB for the data migration and not getting anthing when verified the Microsoft links.

Can someone help me to create the Dataset for Source and Destination of type cosmos DB mongo DB type in Azure data factory

1

There are 1 best solutions below

0
Aswin On

After creating linkedservice for azure cosmos mongo db api, you can use the below bicep script to create datasets.

Sample bicep code to create datasets:

resource symbolicname 'Microsoft.DataFactory/factories/datasets@2018-06-01' = {
  name: 'string'
  parent: resourceSymbolicName
  properties: {
    annotations: [
      any
    ]
    description: 'string'
    folder: {
      name: 'string'
    }
    linkedServiceName: {
      parameters: {
        {customized property}: any()
      }
      referenceName: 'string'
      type: 'LinkedServiceReference'
    }
    parameters: {
      {customized property}: {
        defaultValue: any()
        type: 'string'
      }
    }
    schema: any()
    structure: any()
   type: 'CosmosDbMongoDbApiCollection'
   typeProperties: {
    collection: any()
  }

  }
}
  • type: 'CosmosDbMongoDbApiCollection': This line specifies the type of the dataset resource, which is "CosmosDbMongoDbApiCollection" in this case.

  • typeProperties: {...}: This section contains the type-specific properties of the dataset resource. In this case, it includes the name of the collection that the dataset will use.

Reference: MS document - https://learn.microsoft.com/en-us/azure/templates/microsoft.datafactory/factories/datasets?pivots=deployment-language-bicep