กิจกรรม
17 มี.ค. 21 - 21 มี.ค. 10
สร้างแอป AI และตัวแทน เข้าร่วมชุด meetup เพื่อสร้างโซลูชัน AI ที่ปรับขนาดได้ตามกรณีการใช้งานจริงกับนักพัฒนาและผู้เชี่ยวชาญร่วมกัน
ลงทะเบียนตอนนี้เบราว์เซอร์นี้ไม่ได้รับการสนับสนุนอีกต่อไป
อัปเกรดเป็น Microsoft Edge เพื่อใช้ประโยชน์จากคุณลักษณะล่าสุด เช่น การอัปเดตความปลอดภัยและการสนับสนุนด้านเทคนิค
APPLIES TO:
NoSQL
MongoDB
Gremlin
Azure Synapse Link for Azure Cosmos DB is a cloud-native hybrid transactional and analytical processing (HTAP) capability that enables you to run near real-time analytics over operational data in Azure Cosmos DB. Synapse Link creates a tight seamless integration between Azure Cosmos DB and Azure Synapse Analytics.
ข้อสำคัญ
Mirroring in Microsoft Fabric is now available in preview for NoSql API. This feature provides all the capabilities of Azure Synapse Link with better analytical performance, ability to unify your data estate with Fabric OneLake and open access to your data in OneLake with Delta Parquet format. If you are considering Azure Synapse Link, we recommend that you try mirroring to assess overall fit for your organization. To get started with mirroring, click here.
Azure Synapse Link is available for Azure Cosmos DB SQL API or for Azure Cosmos DB API for Mongo DB accounts. And it is in preview for Gremlin API, with activation via CLI commands. Use the following steps to run analytical queries with the Azure Synapse Link for Azure Cosmos DB:
You can also check the training module on how to configure Azure Synapse Link for Azure Cosmos DB.
The first step to use Synapse Link is to enable it for your Azure Cosmos DB database account.
หมายเหตุ
If you want to use customer-managed keys with Azure Synapse Link, you must configure your account's managed identity in your Azure Key Vault access policy before enabling Synapse Link on your account. To learn more, see how to Configure customer-managed keys using Azure Cosmos DB accounts' managed identities article.
หมายเหตุ
If you want to use Full Fidelity Schema for API for NoSQL accounts, you can't use the Azure portal to enable Synapse Link. This option can't be changed after Synapse Link is enabled in your account and to set it you must use Azure CLI or PowerShell. For more information, check analytical store schema representation documentation.
หมายเหตุ
You need Contributor role to enable Synapse Link at account level. And you need at least Operator to enable Synapse Link in your containers or collections.
Sign in to the Azure portal.
Create a new Azure account, or select an existing Azure Cosmos DB account.
Navigate to your Azure Cosmos DB account and open the Azure Synapse Link under Integrations in the left pane.
Select Enable. This process can take 1 to 5 minutes to complete.
Your account is now enabled to use Synapse Link. Next see how to create analytical store enabled containers to automatically start replicating your operational data from the transactional store to the analytical store.
หมายเหตุ
Turning on Synapse Link does not turn on the analytical store automatically. Once you enable Synapse Link on the Cosmos DB account, enable analytical store on containers to start using Synapse Link.
หมายเหตุ
You can also enable Synapse Link for your account using the Power BI and the Synapse Link pane, in the Integrations section of the left navigation menu.
Enable Synapse Link in your Azure Cosmos DB API for NoSQL or MongoDB account using Azure CLI or PowerShell.
Use --enable-analytical-storage true
for both create or update operations. You also need to choose the representation schema type. For API for NoSQL accounts you can use --analytical-storage-schema-type
with the values FullFidelity
or WellDefined
. For API for MongoDB accounts, always use --analytical-storage-schema-type FullFidelity
.
Synapse Link for Gremlin API is now in preview. You can enable Synapse Link in your new or existing graphs using Azure CLI. Use the CLI command below to enable Synapse Link for your Gremlin API account:
az cosmosdb create --capabilities EnableGremlin --name MyCosmosDBGremlinDatabaseAccount --resource-group MyResourceGroup --enable-analytical-storage true
For existing Gremlin API accounts, replace create
with update
.
Use EnableAnalyticalStorage true
for both create or update operations. You also need to choose the representation schema type. For API for NoSQL accounts you can use --analytical-storage-schema-type
with the values FullFidelity
or WellDefined
. For API for MongoDB accounts, always use -AnalyticalStorageSchemaType FullFidelity
.
This Azure Resource Manager template creates a Synapse Link enabled Azure Cosmos DB account for SQL API. This template creates a Core (SQL) API account in one region with a container configured with analytical TTL enabled, and an option to use manual or autoscale throughput. To deploy this template, click on Deploy to Azure on the readme page.
The second step is to enable Synapse Link for your containers or collections. This is accomplished by setting the analytical TTL
property to -1
for infinite retention, or to a positive integer, that is the number of seconds that you want to keep in analytical store. This setting can be changed later. For more information, see the analytical TTL supported values article.
Please note the following details when enabling Azure Synapse Link on your existing SQL API containers:
หมายเหตุ
Now you can enable Synapse Link on your existing MongoDB API collections, using Azure CLI or PowerShell.
Sign in to the Azure portal or the Azure Cosmos DB Explorer.
Navigate to your Azure Cosmos DB account and open the Data Explorer tab.
Select New Container and enter a name for your database, container, partition key and throughput details. Turn on the Analytical store option. After you enable the analytical store, it creates a container with analytical TTL
property set to the default value of -1 (infinite retention). This analytical store that retains all the historical versions of records and can be changed later.
If you have previously not enabled Synapse Link on this account, it will prompt you to do so because it's a pre-requisite to create an analytical store enabled container. If prompted, select Enable Synapse Link. This process can take 1 to 5 minutes to complete.
Select OK, to create an analytical store enabled Azure Cosmos DB container.
After the container is created, verify that analytical store has been enabled by clicking Settings, right below Documents in Data Explorer, and check if the Analytical Store Time to Live option is turned on.
Sign in to the Azure portal or the Azure Cosmos DB Explorer.
Navigate to your Azure Cosmos DB account and open the Azure Synapse Link tab.
Under the Enable Azure Synapse Link for your containers section select the container.
After the container enablement, verify that analytical store has been enabled by clicking Settings, right below Documents in Data Explorer, and check if the Analytical Store Time to Live option is turned on.
หมายเหตุ
You can also enable Synapse Link for your account using the Power BI and the Synapse Link pane, in the Integrations section of the left navigation menu.
The following options enable Synapse Link in a container by using Azure CLI by setting the --analytical-storage-ttl
property.
Synapse Link for Gremlin API is now in preview. You can enable Synapse Link in your new or existing Graphs using Azure CLI. Use the CLI command below to enable Synapse Link for your Gremlin API graphs:
az cosmosdb gremlin graph create --g MyResourceGroup --a MyCosmosDBGremlinDatabaseAccount --d MyGremlinDB --n MyGraph --analytical-storage-ttl –1
For existing graphs, replace create
with update
.
The following options enable Synapse Link in a container by using Azure CLI by setting the -AnalyticalStorageTtl
property.
The following .NET code creates a Synapse Link enabled container by setting the AnalyticalStoreTimeToLiveInSeconds
property. To update an existing container, use the Container.ReplaceContainerAsync
method.
CosmosClient cosmosClient = new CosmosClient(
accountEndpoint: "<nosql-account-endpoint>",
tokenCredential: new DefaultAzureCredential()
);
// Create a container with a partition key, and analytical TTL configured to -1 (infinite retention)
ContainerProperties properties = new ContainerProperties()
{
Id = "myContainerId",
PartitionKeyPath = "/id",
AnalyticalStoreTimeToLiveInSeconds = -1,
};
await cosmosClient.GetDatabase("myDatabase").CreateContainerAsync(properties);
The following Java code creates a Synapse Link enabled container by setting the setAnalyticalStoreTimeToLiveInSeconds
property. To update an existing container, use the container.replace
class.
// Create a container with a partition key and analytical TTL configured to -1 (infinite retention)
CosmosContainerProperties containerProperties = new CosmosContainerProperties("myContainer", "/myPartitionKey");
containerProperties.setAnalyticalStoreTimeToLiveInSeconds(-1);
container = database.createContainerIfNotExists(containerProperties, 400).block().getContainer();
The following Python code creates a Synapse Link enabled container by setting the analytical_storage_ttl
property. To update an existing container, use the replace_container
method.
# Client
client = cosmos_client.CosmosClient(HOST, KEY )
# Database client
try:
db = client.create_database(DATABASE)
except exceptions.CosmosResourceExistsError:
db = client.get_database_client(DATABASE)
# Creating the container with analytical store enabled
try:
container = db.create_container(
id=CONTAINER,
partition_key=PartitionKey(path='/id', kind='Hash'),analytical_storage_ttl=-1
)
properties = container.read()
print('Container with id \'{0}\' created'.format(container.id))
print('Partition Key - \'{0}\''.format(properties['partitionKey']))
except exceptions.CosmosResourceExistsError:
print('A container with already exists')
Use the instructions in Connect to Azure Synapse Link on how to access an Azure Cosmos DB database from Azure Synapse Analytics Studio with Azure Synapse Link.
Use the instructions in the Query Azure Cosmos DB analytical store using Spark 3 article on how to query with Synapse Spark 3. That article gives some examples on how you can interact with the analytical store from Synapse gestures. Those gestures are visible when you right-click on a container. With gestures, you can quickly generate code and tweak it to your needs. They are also perfect for discovering data with a single click.
For Spark 2 integration use the instruction in the Query Azure Cosmos DB analytical store using Spark 2 article.
Serverless SQL pool allows you to query and analyze data in your Azure Cosmos DB containers that are enabled with Azure Synapse Link. You can analyze data in near real-time without impacting the performance of your transactional workloads. It offers a familiar T-SQL syntax to query data from the analytical store and integrated connectivity to a wide range of BI and ad-hoc querying tools via the T-SQL interface. To learn more, see the Query analytical store using serverless SQL pool article.
You can use the integrated BI experience in the Azure Cosmos DB portal, to build BI dashboards using Synapse Link with just a few clicks. To learn more, see how to build BI dashboards using Synapse Link. This integrated experience will create simple T-SQL views in Synapse serverless SQL pools, for your Azure Cosmos DB containers. You can build BI dashboards over these views, which will query your Azure Cosmos DB containers in real-time, using Direct Query, reflecting latest changes to your data. There is no performance or cost impact to your transactional workloads, and no complexity of managing ETL pipelines.
If you want to use advanced T-SQL views with joins across your containers or build Power BI dashboards in Import mode, see Use serverless SQL pool to analyze Azure Cosmos DB data with Synapse Link.
Custom partitioning enables you to partition analytical store data on fields that are commonly used as filters in analytical queries, resulting in improved query performance. To learn more, see the introduction to custom partitioning and how to configure custom partitioning articles.
Use this mandatory best practices for your SQL serverless queries.
You can find samples to get started with Azure Synapse Link on GitHub. These showcase end-to-end solutions with IoT and retail scenarios. You can also find the samples corresponding to Azure Cosmos DB for MongoDB in the same repo under the MongoDB folder.
To learn more, see the following docs:
กิจกรรม
17 มี.ค. 21 - 21 มี.ค. 10
สร้างแอป AI และตัวแทน เข้าร่วมชุด meetup เพื่อสร้างโซลูชัน AI ที่ปรับขนาดได้ตามกรณีการใช้งานจริงกับนักพัฒนาและผู้เชี่ยวชาญร่วมกัน
ลงทะเบียนตอนนี้การฝึกอบรม
โมดูล
Implement Azure Synapse Link with Azure Cosmos DB - Training
Implement Azure Synapse Link with Azure Cosmos DB
ใบรับรอง
ได้รับการรับรองจาก Microsoft: Azure Cosmos DB Developer Specialty - Certifications
เขียนคิวรีที่มีประสิทธิภาพ สร้างนโยบายการจัดทําดัชนี จัดการ และเตรียมใช้งานทรัพยากรใน SQL API และ SDK ด้วย Microsoft Azure Cosmos DB