Skip to content

Commit 50613ad

Browse files
Merge pull request #289533 from kgremban/m3-schema
schema cli
2 parents 49d6bb8 + 087c991 commit 50613ad

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

articles/iot-operations/connect-to-cloud/concept-schema-registry.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how schema registry handles message schemas to work with Azur
44
author: kgremban
55
ms.author: kgremban
66
ms.topic: conceptual
7-
ms.date: 09/23/2024
7+
ms.date: 10/30/2024
88

99
#CustomerIntent: As an operator, I want to understand how I can use message schemas to filter and transform messages.
1010
---
@@ -111,9 +111,31 @@ To upload an output schema, see [Upload schema](#upload-schema).
111111

112112
## Upload schema
113113

114-
Input schema can be uploaded in the operations experience portal as [mentioned previously](#input-schema). You can also upload a schema using a Bicep template.
114+
Input schema can be uploaded in the operations experience portal as described in the [Input schema](#input-schema) section of this article. You can also upload a schema using the Azure CLI or a Bicep template.
115115

116-
### Example with Bicep template
116+
### Upload schema with the CLI
117+
118+
The [az iot ops schema](/cli/azure/iot/ops/schema) command group contains commands to create, view, and manage schemas in your schema registry.
119+
120+
You can upload a schema by referencing a JSON file or by including the schema as inline content.
121+
122+
The following example uses minimal inputs to create a schema called `myschema` from a file. When no version number is specified, the schema version is 1.
123+
124+
```azurecli
125+
az iot ops schema create -n myschema -g myresourcegroup --registry myregistry --format json --type message --version-content myschema.json
126+
```
127+
128+
The following example creates a schema called `myschema` from inline content and assigns a version number.
129+
130+
```azurecli
131+
az iot ops schema create -n myschema -g myresourcegroup --registry myregistry --format delta --type message --version-content '{\"hello\": \"world\"}' --ver 14
132+
```
133+
134+
Once the `create` command is completed, you should see a blob in your storage account container with the schema content. The name for the blob is in the format `schema-namespace/schema/version`.
135+
136+
You can see more options with the helper command `az iot ops schema -h`.
137+
138+
### Upload schema with a Bicep template
117139

118140
Create a Bicep `.bicep` file, and add the schema content to it at the top as a variable. This example is a Delta schema that corresponds to the OPC UA data from [quickstart](../get-started-end-to-end-sample/quickstart-add-assets.md).
119141

0 commit comments

Comments
 (0)