Skip to content

Commit 7ec9cf4

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into tamram23-0118
2 parents 6c030bf + 1d6fd0e commit 7ec9cf4

File tree

10 files changed

+1609
-55
lines changed

10 files changed

+1609
-55
lines changed

articles/active-directory/authentication/howto-mfa-nps-extension-errors.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Sometimes, your users may get messages from Multi-Factor Authentication because
6969
| **OathCodeIncorrect** | Wrong code entered\OATH Code Incorrect | The user entered the wrong code. Have them try again by requesting a new code or signing in again. |
7070
| **SMSAuthFailedMaxAllowedCodeRetryReached** | Maximum allowed code retry reached | The user failed the verification challenge too many times. Depending on your settings, they may need to be unblocked by an admin now. |
7171
| **SMSAuthFailedWrongCodeEntered** | Wrong code entered/Text Message OTP Incorrect | The user entered the wrong code. Have them try again by requesting a new code or signing in again. |
72+
| **AuthenticationThrottled** | Too many attempts by user in a short period of time. Throttling. | Microsoft may limit repeated authentication attempts that are performed by the same user in a short period of time. This limitation does not apply to the Microsoft Authenticator or verification code. If you have hit these limits, you can use the Authenticator App, verification code or try to sign in again in a few minutes. |
73+
| **AuthenticationMethodLimitReached** | Authentication Method Limit Reached. Throttling. | Microsoft may limit repeated authentication attempts that are performed by the same user using the same authentication method type in a short period of time, specifically Voice call or SMS. This limitation does not apply to the Microsoft Authenticator or verification code. If you have hit these limits, you can use the Authenticator App, verification code or try to sign in again in a few minutes.|
7274

7375
## Errors that require support
7476

articles/active-directory/standards/memo-22-09-multi-factor-authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ The memo requires organizations to change password policies that are proven inef
144144

145145
* Use [password protection](..//authentication/concept-password-ban-bad.md) to enforce a common list of weak passwords that Microsoft maintains. You can also add custom banned passwords.
146146

147-
* Use [self-service password protection](..//authentication/tutorial-enable-sspr.md) to enable users to reset passwords as needed, such as after an account recovery.
147+
* Use [self-service password reset](..//authentication/tutorial-enable-sspr.md) to enable users to reset passwords as needed, such as after an account recovery.
148148

149149
* Use [Azure AD Identity Protection](..//identity-protection/concept-identity-protection-risks.md) to be alerted about compromised credentials so you can take immediate action.
150150

articles/azure-monitor/essentials/prometheus-metrics-enable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Use any of the following methods to install the Azure Monitor agent on your AKS
4040

4141
- Register the `AKS-PrometheusAddonPreview` feature flag in the Azure Kubernetes clusters subscription with the following command in Azure CLI: `az feature register --namespace Microsoft.ContainerService --name AKS-PrometheusAddonPreview`.
4242
- The aks-preview extension needs to be installed using the command `az extension add --name aks-preview`. For more information on how to install a CLI extension, see [Use and manage extensions with the Azure CLI](/cli/azure/azure-cli-extensions-overview).
43-
- Azure CLI version 2.41.0 or higher is required for this feature.
43+
- Aks-preview version 0.5.122 or higher is required for this feature. You can check the aks-preview version using the `az version` command.
4444

4545
#### Install metrics addon
4646

articles/cognitive-services/language-service/concepts/data-limits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The following limit specifies the maximum number of characters that can be in a
4646
| Feature | Value |
4747
|------------------------|---------------|
4848
| Conversation issue and resolution summarization| 40,000 characters as measured by [StringInfo.LengthInTextElements](/dotnet/api/system.globalization.stringinfo.lengthintextelements).|
49-
| Text Analytics for health | 30,720 characters as measured by [StringInfo.LengthInTextElements](/dotnet/api/system.globalization.stringinfo.lengthintextelements). |
49+
| Text Analytics for health | 125,000 characters as measured by [StringInfo.LengthInTextElements](/dotnet/api/system.globalization.stringinfo.lengthintextelements). |
5050
| All other pre-configured features (synchronous) | 5,120 as measured by [StringInfo.LengthInTextElements](/dotnet/api/system.globalization.stringinfo.lengthintextelements). If you need to submit larger documents, consider using the feature asynchronously (described below). |
5151
| All other pre-configured features ([asynchronous](use-asynchronously.md)) | 125,000 characters across all submitted documents, as measured by [StringInfo.LengthInTextElements](/dotnet/api/system.globalization.stringinfo.lengthintextelements) (maximum of 25 documents). |
5252

@@ -84,7 +84,7 @@ Exceeding the following document limits will generate an HTTP 400 error code.
8484
| Personally Identifying Information (PII) detection | 5 |
8585
| Document summarization | 25 |
8686
| Entity Linking | 5 |
87-
| Text Analytics for health | 10 for the web-based API, 1000 for the container. |
87+
| Text Analytics for health |25 for the web-based API, 1000 for the container. (125,000 characters in total) |
8888

8989
## Rate limits
9090

articles/cosmos-db/nosql/quickstart-python.md

Lines changed: 104 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: cosmos-db
77
ms.subservice: nosql
88
ms.devlang: python
99
ms.topic: quickstart
10-
ms.date: 11/03/2022
10+
ms.date: 1/17/2023
1111
ms.custom: seodec18, seo-javascript-september2019, seo-python-october2019, devx-track-python, mode-api, ignite-2022, devguide-python, cosmos-db-dev-journey
1212
---
1313

@@ -91,69 +91,156 @@ For this sample code, the container will use the category as a logical partition
9191

9292
From the project directory, open the *app.py* file. In your editor, import the `os` and `json` modules. Then, import the `CosmosClient` and `PartitionKey` classes from the `azure.cosmos` module.
9393

94+
#### [Sync](#tab/sync)
95+
9496
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="imports":::
9597

96-
Create variables for the `COSMOS_ENDPOINT` and `COSMOS_KEY` environment variables using `os.environ`.
98+
#### [Async](#tab/async)
99+
100+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" id="imports":::
101+
102+
---
103+
104+
Create constants for the `COSMOS_ENDPOINT` and `COSMOS_KEY` environment variables using `os.environ`.
105+
106+
#### [Sync / Async](#tab/sync+async)
97107

98108
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="environment_variables":::
99109

110+
---
111+
112+
Create constants for the database and container names.
113+
114+
#### [Sync / Async](#tab/sync+async)
115+
116+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="constants":::
117+
118+
---
119+
100120
Create a new client instance using the [`CosmosClient`](/python/api/azure-cosmos/azure.cosmos.cosmos_client.cosmosclient) class constructor and the two variables you created as parameters.
101121

122+
#### [Sync](#tab/sync)
123+
102124
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_client":::
103125

126+
#### [Async](#tab/async)
127+
128+
> [!IMPORTANT]
129+
> Please the client instance in a coroutine function named `manage_cosmos`. Within the coroutine function, define the new client with the `async with` keywords. Outside of the coroutine function, use the `asyncio.run` function to execute the coroutine asynchronously.
130+
131+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="24-26":::
132+
133+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="70":::
134+
135+
---
136+
104137
### Create a database
105138

106139
Use the [`CosmosClient.create_database_if_not_exists`](/python/api/azure-cosmos/azure.cosmos.cosmos_client.cosmosclient#azure-cosmos-cosmos-client-cosmosclient-create-database-if-not-exists) method to create a new database if it doesn't already exist. This method will return a [`DatabaseProxy`](/python/api/azure-cosmos/azure.cosmos.databaseproxy) reference to the existing or newly created database.
107140

141+
#### [Sync](#tab/sync)
142+
108143
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_database":::
109144

145+
#### [Async](#tab/async)
146+
147+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="28-29":::
148+
149+
---
150+
110151
### Create a container
111152

112153
The [`PartitionKey`](/python/api/azure-cosmos/azure.cosmos.partitionkey) class defines a partition key path that you can use when creating a container.
113154

114-
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_partition_key":::
155+
#### [Sync](#tab/sync)
115156

116-
The [`Databaseproxy.create_container_if_not_exists`](/python/api/azure-cosmos/azure.cosmos.databaseproxy#azure-cosmos-databaseproxy-create-container-if-not-exists) method will create a new container if it doesn't already exist. This method will also return a [`ContainerProxy`](/python/api/azure-cosmos/azure.cosmos.containerproxy) reference to the container.
157+
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_partition_key":::
117158

118159
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_container":::
119160

161+
#### [Async](#tab/async)
162+
163+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="31":::
164+
165+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="33-36":::
166+
167+
---
168+
169+
The [`Databaseproxy.create_container_if_not_exists`](/python/api/azure-cosmos/azure.cosmos.databaseproxy#azure-cosmos-databaseproxy-create-container-if-not-exists) method will create a new container if it doesn't already exist. This method will also return a [`ContainerProxy`](/python/api/azure-cosmos/azure.cosmos.containerproxy) reference to the container.
170+
120171
### Create an item
121172

122-
Create a new item in the container by first creating a new variable (`newItem`) with a sample item defined. In this example, the unique identifier of this item is `70b63682-b93a-4c77-aad2-65501347265f`. The partition key value is derived from the `/categoryId` path, so it would be `61dba35b-4f02-45c5-b648-c6badc0cbd79`.
173+
Create a new item in the container by first creating a new variable (`new_item`) with a sample item defined. In this example, the unique identifier of this item is `70b63682-b93a-4c77-aad2-65501347265f`. The partition key value is derived from the `/categoryId` path, so it would be `61dba35b-4f02-45c5-b648-c6badc0cbd79`.
174+
175+
#### [Sync / Async](#tab/sync+async)
123176

124177
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="new_item":::
125178

179+
---
180+
126181
> [!TIP]
127182
> The remaining fields are flexible and you can define as many or as few as you want. You can even combine different item schemas in the same container.
128183
129184
Create an item in the container by using the [`ContainerProxy.create_item`](/python/api/azure-cosmos/azure.cosmos.containerproxy#azure-cosmos-containerproxy-create-item) method passing in the variable you already created.
130185

186+
#### [Sync](#tab/sync)
187+
131188
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="create_item":::
132189

190+
#### [Async](#tab/async)
191+
192+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="47":::
193+
194+
---
195+
133196
### Get an item
134197

135198
In Azure Cosmos DB, you can perform a point read operation by using both the unique identifier (``id``) and partition key fields. In the SDK, call [`ContainerProxy.read_item`](/python/api/azure-cosmos/azure.cosmos.containerproxy#azure-cosmos-containerproxy-read-item) passing in both values to return an item as a dictionary of strings and values (`dict[str, Any]`).
136199

200+
#### [Sync](#tab/sync)
201+
137202
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="read_item":::
138203

139-
In this example, the dictionary result is saved to a variable named `existingItem`.
204+
#### [Async](#tab/async)
205+
206+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="49-53":::
207+
208+
---
209+
210+
In this example, the dictionary result is saved to a variable named `existing_item`.
140211

141212
### Query items
142213

143214
After you insert an item, you can run a query to get all items that match a specific filter. This example runs the SQL query: ``SELECT * FROM products p WHERE p.categoryId = "61dba35b-4f02-45c5-b648-c6badc0cbd79"``. This example uses query parameterization to construct the query. The query uses a string of the SQL query, and a dictionary of query parameters.
144215

216+
#### [Sync / Async](#tab/sync+async)
217+
145218
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="build_query":::
146219

220+
---
221+
147222
This example dictionary included the `@categoryId` query parameter and the corresponding value `61dba35b-4f02-45c5-b648-c6badc0cbd79`.
148223

149224
Once the query is defined, call [`ContainerProxy.query_items`](/python/api/azure-cosmos/azure.cosmos.containerproxy#azure-cosmos-containerproxy-query-items) to run the query and return the results as a paged set of items (`ItemPage[Dict[str, Any]]`).
150225

226+
#### [Sync / Async](#tab/sync+async)
227+
151228
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="query_items":::
152229

230+
---
231+
153232
Finally, use a for loop to iterate over the results in each page and perform various actions.
154233

234+
#### [Sync](#tab/sync)
235+
155236
:::code language="python" source="~/cosmos-db-nosql-python-samples/001-quickstart/app.py" id="iterate_query_results":::
156237

238+
#### [Async](#tab/async)
239+
240+
:::code language="python" source="~/cosmos-db-nosql-python-samples/002-quickstart-async/app.py" range="62-64":::
241+
242+
---
243+
157244
In this example, `json.dumps` is used to print the item to the console in a human-readable way.
158245

159246
## Run the code
@@ -169,19 +256,24 @@ python app.py
169256
The output of the app should be similar to this example:
170257

171258
```output
172-
{
259+
Database cosmicworks
260+
Container products
261+
Point read Yamba Surfboard
262+
Result list [
263+
{
173264
"id": "70b63682-b93a-4c77-aad2-65501347265f",
174265
"categoryId": "61dba35b-4f02-45c5-b648-c6badc0cbd79",
175266
"categoryName": "gear-surf-surfboards",
176267
"name": "Yamba Surfboard",
177268
"quantity": 12,
178269
"sale": false,
179-
"_rid": "yzN6AIfJxe0BAAAAAAAAAA==",
180-
"_self": "dbs/yzN6AA==/colls/yzN6AIfJxe0=/docs/yzN6AIfJxe0BAAAAAAAAAA==/",
181-
"_etag": "\"2a00ccd4-0000-0200-0000-63650e420000\"",
270+
"_rid": "KSsMAPI2fH0BAAAAAAAAAA==",
271+
"_self": "dbs/KSsMAA==/colls/KSsMAPI2fH0=/docs/KSsMAPI2fH0BAAAAAAAAAA==/",
272+
"_etag": "\"48002b76-0000-0200-0000-63c85f9d0000\"",
182273
"_attachments": "attachments/",
183-
"_ts": 16457527130
184-
}
274+
"_ts": 1674076061
275+
}
276+
]
185277
```
186278

187279
> [!NOTE]

0 commit comments

Comments
 (0)