Skip to content

Commit 0381666

Browse files
authored
Merge branch 'MicrosoftDocs:main' into previewexp
2 parents 3d390a4 + 7fc3718 commit 0381666

File tree

2 files changed

+33
-36
lines changed

2 files changed

+33
-36
lines changed

articles/cosmos-db/nosql/migrate-dotnet-v3.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.author: esarroyo
66
ms.service: cosmos-db
77
ms.subservice: nosql
88
ms.topic: how-to
9-
ms.date: 06/01/2022
9+
ms.date: 11/09/2022
1010
ms.devlang: csharp
1111
---
1212

@@ -84,11 +84,7 @@ The following classes have been replaced on the 3.0 SDK:
8484

8585
* `Microsoft.Azure.Documents.UriFactory`
8686

87-
* `Microsoft.Azure.Documents.Document`
88-
89-
* `Microsoft.Azure.Documents.Resource`
90-
91-
The Microsoft.Azure.Documents.UriFactory class has been replaced by the fluent design.
87+
The Microsoft.Azure.Documents.UriFactory class has been replaced by the fluent design.
9288

9389
# [.NET SDK v3](#tab/dotnet-v3)
9490

@@ -112,8 +108,18 @@ await client.CreateDocumentAsync(
112108

113109
---
114110

111+
* `Microsoft.Azure.Documents.Document`
112+
115113
Because the .NET v3 SDK allows users to configure a custom serialization engine, there's no direct replacement for the `Document` type. When using Newtonsoft.Json (default serialization engine), `JObject` can be used to achieve the same functionality. When using a different serialization engine, you can use its base json document type (for example, `JsonDocument` for System.Text.Json). The recommendation is to use a C# type that reflects the schema of your items instead of relying on generic types.
116114

115+
* `Microsoft.Azure.Documents.Resource`
116+
117+
There is no direct replacement for `Resource`, in cases where it was used for documents, follow the guidance for `Document`.
118+
119+
* `Microsoft.Azure.Documents.AccessCondition`
120+
121+
`IfNoneMatch` or `IfMatch` are now available on the `Microsoft.Azure.Cosmos.ItemRequestOptions` directly.
122+
117123
### Changes to item ID generation
118124

119125
Item ID is no longer auto populated in the .NET v3 SDK. Therefore, the Item ID must specifically include a generated ID. View the following example:
@@ -125,31 +131,22 @@ public Guid Id { get; set; }
125131

126132
### Changed default behavior for connection mode
127133

128-
The SDK v3 now defaults to Direct + TCP connection modes compared to the previous v2 SDK, which defaulted to Gateway + HTTPS connections modes. This change provides enhanced performance and scalability.
134+
The SDK v3 now defaults to [Direct + TCP connection modes](sdk-connection-modes.md) compared to the previous v2 SDK, which defaulted to Gateway + HTTPS connections modes. This change provides enhanced performance and scalability.
129135

130136
### Changes to FeedOptions (QueryRequestOptions in v3.0 SDK)
131137

132138
The `FeedOptions` class in SDK v2 has now been renamed to `QueryRequestOptions` in the SDK v3 and within the class, several properties have had changes in name and/or default value or been removed completely.
133139

134-
`FeedOptions.MaxDegreeOfParallelism` has been renamed to `QueryRequestOptions.MaxConcurrency` and default value and associated behavior remains the same, operations run client side during parallel query execution will be executed serially with no-parallelism.
135-
136-
`FeedOptions.EnableCrossPartitionQuery` has been removed and the default behavior in SDK 3.0 is that cross-partition queries will be executed without the need to enable the property specifically.
137-
138-
`FeedOptions.PopulateQueryMetrics` is enabled by default with the results being present in the `FeedResponse.Diagnostics` property of the response.
139-
140-
`FeedOptions.RequestContinuation` has now been promoted to the query methods themselves.
141-
142-
The following properties have been removed:
143-
144-
* `FeedOptions.DisableRUPerMinuteUsage`
145-
146-
* `FeedOptions.EnableCrossPartitionQuery`
147-
148-
* `FeedOptions.JsonSerializerSettings`
149-
150-
* `FeedOptions.PartitionKeyRangeId`
151-
152-
* `FeedOptions.PopulateQueryMetrics`
140+
| .NET v2 SDK | .NET v3 SDK |
141+
|-------------|-------------|
142+
|`FeedOptions.MaxDegreeOfParallelism`|`QueryRequestOptions.MaxConcurrency` - Default value and associated behavior remains the same, operations run client side during parallel query execution will be executed serially with no-parallelism.|
143+
|`FeedOptions.PartitionKey`|`QueryRequestOptions.PartitionKey` - Behavior maintained. |
144+
|`FeedOptions.EnableCrossPartitionQuery`|Removed. Default behavior in SDK 3.0 is that cross-partition queries will be executed without the need to enable the property specifically. |
145+
|`FeedOptions.PopulateQueryMetrics`|Removed. It is now enabled by default and part of the [diagnostics](troubleshoot-dotnet-sdk.md#capture-diagnostics).|
146+
|`FeedOptions.RequestContinuation`|Removed. It is now promoted to the query methods themselves. |
147+
|`FeedOptions.JsonSerializerSettings`|Removed. Serialization can be customized through a [custom serializer](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions.serializer) or [serializer options](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions.serializeroptions).|
148+
|`FeedOptions.PartitionKeyRangeId`|Removed. Same outcome can be obtained from using [FeedRange](change-feed-pull-model.md#using-feedrange-for-parallelization) as input to the query method.|
149+
|`FeedOptions.DisableRUPerMinuteUsage`|Removed.|
153150

154151
### Constructing a client
155152

@@ -213,7 +210,7 @@ catch (CosmosException cosmosException) {
213210

214211
### ConnectionPolicy
215212

216-
Some settings in `ConnectionPolicy` have been renamed or replaced:
213+
Some settings in `ConnectionPolicy` have been renamed or replaced by `CosmosClientOptions`:
217214

218215
| .NET v2 SDK | .NET v3 SDK |
219216
|-------------|-------------|

articles/purview/troubleshoot-policy-distribution.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ In this example, the delta pull communicates the event that the policy on the re
177177

178178

179179
## Policy constructs
180-
There are 3 top-level policy constructs used within the full pull (/policyElements) and delta pull (/policyEvents) requests: PolicySet, Policy and AttributeRule.
180+
There are 3 top-level policy constructs used within the responses to the full pull (/policyElements) and delta pull (/policyEvents) requests: Policy, PolicySet and AttributeRule.
181181

182-
### PolicySet
182+
### Policy
183183

184-
PolicySet associates Policy to a resource scope. Purview policy decision compute starts with a list of PolicySets. PolicySet evaluation triggers evaluation of Policy referenced in the PolicySet.
184+
Policy specifies the decision the data source must enforce (permit vs. deny) when an Azure AD principal attempts an access via a client, provided request context attributes satisfy attribute predicates specified in the policy (for example scope, requested action, etc.). Evaluation of the Policy triggers evaluation of AttributeRules referenced in the Policy.
185185

186186
|member|value|type|cardinality|description|
187187
|------|-----|----|-----------|-----------|
@@ -190,12 +190,12 @@ PolicySet associates Policy to a resource scope. Purview policy decision compute
190190
|kind| |string|1||
191191
|version|1|number|1||
192192
|updatedAt| |string|1|String representation of time in yyyy-MM-ddTHH:mm:ss.fffffffZ Ex: "2022-01-11T09:55:52.6472858Z"|
193-
|preconditionRules| |array[Object:Rule]|0..1||
194-
|policyRefs| |array[string]|1|List of policy IDs|
193+
|preconditionRules| |array[Object:Rule]|0..1|All the rules are 'anded'|
194+
|decisionRules| |array[Object:DecisionRule]|1||
195195

196-
### Policy
196+
### PolicySet
197197

198-
Policy specifies decision that should be emitted if the policy is applicable for the request provided request context attributes satisfy attribute predicates specified in the policy. Evaluation of policy triggers evaluation of AttributeRules referenced in the Policy.
198+
PolicySet associates an array of Policy IDs to a resource scope where they need to be enforced.
199199

200200
|member|value|type|cardinality|description|
201201
|------|-----|----|-----------|-----------|
@@ -204,8 +204,8 @@ Policy specifies decision that should be emitted if the policy is applicable for
204204
|kind| |string|1||
205205
|version|1|number|1||
206206
|updatedAt| |string|1|String representation of time in yyyy-MM-ddTHH:mm:ss.fffffffZ Ex: "2022-01-11T09:55:52.6472858Z"|
207-
|preconditionRules| |array[Object:Rule]|0..1|All the rules are 'anded'|
208-
|decisionRules| |array[Object:DecisionRule]|1||
207+
|preconditionRules| |array[Object:Rule]|0..1||
208+
|policyRefs| |array[string]|1|List of policy IDs|
209209

210210

211211
### AttributeRule

0 commit comments

Comments
 (0)