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