az grafana data-source
Note
This reference is part of the amg extension for the Azure CLI (version 2.61.0 or higher). 该扩展会在首次运行 az grafana data-source 命令时自动安装。 Learn more about extensions.
用于管理实例数据源的命令。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az grafana data-source create |
创建数据源。 |
Extension | GA |
az grafana data-source delete |
删除数据源。 |
Extension | GA |
az grafana data-source list |
列出实例的所有数据源。 |
Extension | GA |
az grafana data-source query |
查询具有后端实现的数据源。 |
Extension | GA |
az grafana data-source show |
获取数据源的详细信息。 |
Extension | GA |
az grafana data-source update |
更新数据源。 |
Extension | GA |
az grafana data-source create
创建数据源。
az grafana data-source create --definition
--name
[--api-key --token]
[--resource-group]
示例
使用托管标识创建 Azure Monitor 数据源
az grafana data-source create -n MyGrafana --definition '{
"access": "proxy",
"jsonData": {
"azureAuthType": "msi",
"subscriptionId": "3a7edf7d-1488-4017-a908-111111111111"
},
"name": "Azure Monitor-3",
"type": "grafana-azure-monitor-datasource"
}'
使用应用注册创建 Azure Monitor 数据源
az grafana data-source create -n MyGrafana --definition '{
"name": "Azure Monitor-2",
"type": "grafana-azure-monitor-datasource",
"access": "proxy",
"jsonData": {
"subscriptionId": "3a7edf7d-1488-4017-a908-111111111111",
"azureAuthType": "clientsecret",
"cloudName": "azuremonitor",
"tenantId": "72f988bf-86f1-41af-91ab-111111111111",
"clientId": "fb31a2f5-9122-4be9-9705-111111111111"
},
"secureJsonData": { "clientSecret": "verySecret" }
}'
使用托管标识创建 Azure 数据资源管理器数据源
az grafana data-source create -n MyGrafana --definition '{
"name": "Azure Data Explorer Datasource-2",
"type": "grafana-azure-data-explorer-datasource",
"access": "proxy",
"jsonData": {
"dataConsistency": "strongconsistency",
"clusterUrl": "https://mykusto.westcentralus.kusto.windows.net"
}
}'
使用应用注册创建 Azure 数据资源管理器数据源
az grafana data-source create -n MyGrafana --definition '{
"name": "Azure Data Explorer Datasource-1",
"type": "grafana-azure-data-explorer-datasource",
"access": "proxy",
"jsonData": {
"clusterUrl": "https://mykusto.westcentralus.kusto.windows.net",
"azureCredentials": {
"authType": "clientsecret",
"azureCloud": "AzureCloud",
"tenantId": "72f988bf-86f1-41af-91ab-111111111111",
"clientId": "fb31a2f5-9122-4be9-9705-111111111111"
}
},
"secureJsonData": { "azureClientSecret": "verySecret" }
}'
使用应用注册创建 Azure 托管 Prometheus 数据源
az grafana data-source create -n MyGrafana --definition '{
"name": "Azure Managed Prometheus-1",
"type": "prometheus",
"access": "proxy",
"url": "https://myprom-abcd.westcentralus.prometheus.monitor.azure.com",
"jsonData": {
"httpMethod": "POST",
"azureCredentials": {
"authType": "clientsecret",
"azureCloud": "AzureCloud",
"tenantId": "72f988bf-86f1-41af-91ab-111111111111",
"clientId": "fb31a2f5-9122-4be9-9705-111111111111"
},
"timeInterval": "30s"
},
"secureJsonData": { "azureClientSecret": "verySecret" }
}'
使用托管标识创建 Azure 托管 Prometheus 数据源
az grafana data-source create -n MyGrafana --definition '{
"name": "Azure Managed Prometheus-1",
"type": "prometheus",
"access": "proxy",
"url": "https://myprom-jryu.westcentralus.prometheus.monitor.azure.com",
"jsonData": {
"httpMethod": "POST",
"azureCredentials": { "authType": "msi" }
}
}'
创建 Azure SQL 数据源
az grafana data-source create -n MyGrafana --definition '{
"access": "proxy",
"database": "testdb",
"jsonData": {
"authenticationType": "SQL Server Authentication",
"encrypt": "false"
},
"secureJsonData": {
"password": "verySecretPassword"
},
"name": "Microsoft SQL Server",
"type": "mssql",
"url": "testsql.database.windows.net",
"user": "admin1"
}'
必需参数
包含数据源定义的 Json 字符串,或包含此类内容的文件的路径。
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana data-source delete
删除数据源。
az grafana data-source delete --data-source
--name
[--api-key --token]
[--resource-group]
必需参数
可以标识数据源的名称、ID、uid。 CLI 将按名称、ID 和 uid 的顺序搜索,直到找到匹配项。
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana data-source list
列出实例的所有数据源。
az grafana data-source list --name
[--api-key --token]
[--resource-group]
必需参数
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana data-source query
查询具有后端实现的数据源。
az grafana data-source query --data-source
--name
[--api-key --token]
[--conditions]
[--from]
[--internal-ms]
[--max-data-points]
[--query-format]
[--resource-group]
[--to]
必需参数
可以标识数据源的名称、ID、uid。 CLI 将按名称、ID 和 uid 的顺序搜索,直到找到匹配项。
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
以 <name>=<value>
格式分隔空格的条件。
iso 8601 中的开始时间,例如“2022-01-02T16:15:00”。 默认值:提前 1 小时。
时序的时间间隔(以毫秒为单位)。 Default: 1000.
属性 | 值 |
---|---|
默认值: | 1000 |
仪表板面板可以呈现的最大数据点量。 Default: 1000.
属性 | 值 |
---|---|
默认值: | 100 |
resule 的格式,例如表,time_series。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
iso 8601 中的结束时间,例如“2022-01-02T17:15:00”。 默认值:当前时间。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana data-source show
获取数据源的详细信息。
az grafana data-source show --data-source
--name
[--api-key --token]
[--resource-group]
必需参数
可以标识数据源的名称、ID、uid。 CLI 将按名称、ID 和 uid 的顺序搜索,直到找到匹配项。
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana data-source update
更新数据源。
az grafana data-source update --data-source
--definition
--name
[--api-key --token]
[--resource-group]
必需参数
可以标识数据源的名称、ID、uid。 CLI 将按名称、ID 和 uid 的顺序搜索,直到找到匹配项。
包含数据源定义的 Json 字符串,或包含此类内容的文件的路径。
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |