az grafana data-source
Note
This reference is part of the amg extension for the Azure CLI (version 2.61.0 or higher). The extension will automatically install the first time you run an az grafana data-source command. Learn more about extensions.
Commands to manage data sources of an instance.
Commands
Name | Description | Type | Status |
---|---|---|---|
az grafana data-source create |
Create a data source. |
Extension | GA |
az grafana data-source delete |
Delete a data source. |
Extension | GA |
az grafana data-source list |
List all data sources of an instance. |
Extension | GA |
az grafana data-source query |
Query a data source having backend implementation. |
Extension | GA |
az grafana data-source show |
Get the details of a data source. |
Extension | GA |
az grafana data-source update |
Update a data source. |
Extension | GA |
az grafana data-source create
Create a data source.
az grafana data-source create --definition
--name
[--api-key]
[--resource-group]
Examples
create an Azure Monitor data source using Managed Identity
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"
}'
create an Azure Monitor data source using App Registration
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" }
}'
create an Azure Data Explorer data source using Managed Identity
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"
}
}'
create an Azure Data Explorer data source using App Registration
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" }
}'
create an Azure Managed Prometheus data source using App Registration
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" }
}'
create an Azure Managed Prometheus data source using managed identity
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" }
}
}'
create an Azure SQL data source
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"
}'
Required Parameters
Json string with data source definition, or a path to a file with such content.
Name of the Azure Managed Grafana.
Optional Parameters
Api key or service account token, a randomly generated string used to interact with Grafana endpoint; if missing, CLI will use current logged-in user's credentials.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az grafana data-source delete
Delete a data source.
az grafana data-source delete --data-source
--name
[--api-key]
[--resource-group]
Required Parameters
Name, id, uid which can identify a data source. CLI will search in the order of name, id, and uid, till finds a match.
Name of the Azure Managed Grafana.
Optional Parameters
Api key or service account token, a randomly generated string used to interact with Grafana endpoint; if missing, CLI will use current logged-in user's credentials.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az grafana data-source list
List all data sources of an instance.
az grafana data-source list --name
[--api-key]
[--resource-group]
Required Parameters
Name of the Azure Managed Grafana.
Optional Parameters
Api key or service account token, a randomly generated string used to interact with Grafana endpoint; if missing, CLI will use current logged-in user's credentials.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az grafana data-source query
Query a data source having backend implementation.
az grafana data-source query --data-source
--name
[--api-key]
[--conditions]
[--from]
[--internal-ms]
[--max-data-points]
[--query-format]
[--resource-group]
[--to]
Required Parameters
Name, id, uid which can identify a data source. CLI will search in the order of name, id, and uid, till finds a match.
Name of the Azure Managed Grafana.
Optional Parameters
Api key or service account token, a randomly generated string used to interact with Grafana endpoint; if missing, CLI will use current logged-in user's credentials.
Space-separated condition in a format of <name>=<value>
.
Start time in iso 8601, e.g. '2022-01-02T16:15:00'. Default: 1 hour early.
The time interval in milliseconds of time series. Default: 1000.
Maximum amount of data points that dashboard panel can render. Default: 1000.
Format of the resule, e.g. table, time_series.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
End time in iso 8601, e.g. '2022-01-02T17:15:00'. Default: current time.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az grafana data-source show
Get the details of a data source.
az grafana data-source show --data-source
--name
[--api-key]
[--resource-group]
Required Parameters
Name, id, uid which can identify a data source. CLI will search in the order of name, id, and uid, till finds a match.
Name of the Azure Managed Grafana.
Optional Parameters
Api key or service account token, a randomly generated string used to interact with Grafana endpoint; if missing, CLI will use current logged-in user's credentials.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az grafana data-source update
Update a data source.
az grafana data-source update --data-source
--definition
--name
[--api-key]
[--resource-group]
Required Parameters
Name, id, uid which can identify a data source. CLI will search in the order of name, id, and uid, till finds a match.
Json string with data source definition, or a path to a file with such content.
Name of the Azure Managed Grafana.
Optional Parameters
Api key or service account token, a randomly generated string used to interact with Grafana endpoint; if missing, CLI will use current logged-in user's credentials.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI