In this section we'll extract the Payments from CosmosDB and store them in a Synapse Table.
The extracted Payments will be saved in a SQL Table within the Synapse SQL Pool. We will begin with creating this table using an SQL Script.
- In the Azure Portal, select your Synapse Workspace.
- Select
Open Synapse Studio
- Select 'Develop'
- Create SQL Script
Note: Make sure to change the "Connect to" value from 'builtin' to your own SQL pool as shown in the screenshot below. As by default it will be connected to the 'builtin' SQL pool of Synapse.
<img src="images/synapsews/connectToPool.jpg"
CREATE TABLE Payments(
PaymentNr nvarchar(10),
SalesOrderNr nvarchar(10),
CustomerNr nvarchar(10),
CustomerName nvarchar(80),
PaymentDate date,
PaymentValue decimal(15,2),
Currency nvarchar(5)
)- Create a Linked Service of type CosmosDB (SQL API)
- Enter the connection parameters, as name we use
CosmosSAPS4D
Azure Cosmos DB account URI : <handed out at micro hack>
Azure Cosmos DB access key : <handed out at micro hack>
Database name : SAPS4D
- Test the connection and create the linked service.
This dataset will act as the source for our pipeline.
- Create a
sourceDataSet for the Payment Data based on the CosmosDBSQL APIAdapter
- As name we use
CosmosPaymentData. Use collection :paymentData.
This dataset will act as the sink for our pipeline
- Create a
Integration DataSetbased onAzure Synapse Analytics
- As name we use
SynPayments. Select thePaymentstable
- Go to the
Integrateview - Add a new
Pipeline - Use the
Copyaction and name itExtractPayments - As source select the Cosmos DB payment Dataset, we named this
CosmosPaymentData. - As sink, select the Synapse Payment DataSet. We named this
SynPayments. As Copy method choosePolyBase. - Under the
Settingstab enable and configure theStaging Areaas done in the earlier pipelines - Go to the tab
Mappingand chooseImport schemas. Make sure to remove the mappings which are not shown in the screenshot starting with_, you can remove them my unchecking the checkbox behind them. Do not forget to change theColumn nameforValuetoPaymentValue.
- Create, publish and trigger the integration pipeline
- Check the result in Synapse using SQL
select count(*) from Payments
select * from PaymentsYou can now proceed with the PowerBI Visualisation step.









