-
Notifications
You must be signed in to change notification settings - Fork 155
docs: add PowerShell tab for az resource patch command in change streams #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -38,10 +38,20 @@ az resource show --ids "/subscriptions/<sub id>/resourceGroups/<resource group n | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| 3. Send PATCH request to enable the feature. | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # [Bash](#tab/bash) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||
| az resource patch --ids "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.DocumentDB/mongoClusters/<cluster-name>" --api-version 2024-10-01-preview --properties "{\"previewFeatures\": [ \"ChangeStreams\"]}" | ||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| # [PowerShell](#tab/powershell) | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| ```powershell | ||||||||||||||||||||||||||||||||||||
| az resource patch --ids "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.DocumentDB/mongoClusters/<cluster-name>" --api-version 2024-10-01-preview --properties '{\"previewFeatures\": [\"ChangeStreams\"]}' | ||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+41
to
+53
|
||||||||||||||||||||||||||||||||||||
| # [Bash](#tab/bash) | |
| ```bash | |
| az resource patch --ids "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.DocumentDB/mongoClusters/<cluster-name>" --api-version 2024-10-01-preview --properties "{\"previewFeatures\": [ \"ChangeStreams\"]}" | |
| ``` | |
| # [PowerShell](#tab/powershell) | |
| ```powershell | |
| az resource patch --ids "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.DocumentDB/mongoClusters/<cluster-name>" --api-version 2024-10-01-preview --properties '{\"previewFeatures\": [\"ChangeStreams\"]}' | |
| ``` | |
| --- | |
| # [Bash](#tab/bash) | |
| ```bash | |
| az resource patch --ids "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.DocumentDB/mongoClusters/<cluster-name>" --api-version 2024-10-01-preview --properties "{\"previewFeatures\": [ \"ChangeStreams\"]}" |
PowerShell
az resource patch --ids "/subscriptions/<subscription_id>/resourceGroups/<resource_group_name>/providers/Microsoft.DocumentDB/mongoClusters/<cluster-name>" --api-version 2024-10-01-preview --properties '{\"previewFeatures\": [\"ChangeStreams\"]}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PowerShell example passes an invalid JSON string to
--properties. Because the argument is wrapped in single quotes, the\"sequences are preserved andazreceives{\"previewFeatures\": ...}, which isn't valid JSON (it starts with a backslash outside a JSON string). Use a PowerShell-safe quoting approach that results in{"previewFeatures": ["ChangeStreams"]}being passed to the CLI (for example, single quotes around a JSON string that contains unescaped double quotes).