az grafana

Note

This reference is part of the amg extension for the Azure CLI (version 2.38.0 or higher). The extension will automatically install the first time you run an az grafana command. Learn more about extensions.

Commands to manage Azure Grafana instances.

For optimized experience, not all data plane Apis, documented at https://grafana.com/docs/grafana/latest/http_api/, are exposed. On coverage gap, please reach out to ad4g@microsoft.com.

Commands

Name Description Type Status
az grafana api-key

Commands to manage api keys.

Extension GA
az grafana api-key create

Create a new api key.

Extension GA
az grafana api-key delete

Delete an api key.

Extension GA
az grafana api-key list

List existing api keys.

Extension GA
az grafana backup

Backup an Azure Managed Grafana instance's content to an achive.

Extension Preview
az grafana create

Create a Azure Managed Grafana instance.

Extension GA
az grafana dashboard

Commands to manage dashboards of an instance.

Extension GA
az grafana dashboard create

Create a new dashboard.

Extension GA
az grafana dashboard delete

Delete a dashboard.

Extension GA
az grafana dashboard import

Import a dashboard.

Extension GA
az grafana dashboard list

List all dashboards of an instance.

Extension GA
az grafana dashboard show

Show the detail of a dashboard.

Extension GA
az grafana dashboard sync

Sync Azure Managed Grafana dashboards from one instance to another instance. Note, dashboards with "provisioned" state will be skipped due to being read-only.

Extension Preview
az grafana dashboard update

Update a dashboard.

Extension GA
az grafana data-source

Commands to manage data sources of an instance.

Extension GA
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 details of a data source.

Extension GA
az grafana data-source update

Update a data source.

Extension GA
az grafana delete

Delete a Azure Managed Grafana instance.

Extension GA
az grafana folder

Commands to manage folders of an instance.

Extension GA
az grafana folder create

Create a new folder.

Extension GA
az grafana folder delete

Delete a folder.

Extension GA
az grafana folder list

List all folders of an instance.

Extension GA
az grafana folder show

Show the details of a folder.

Extension GA
az grafana folder update

Update a folder.

Extension GA
az grafana list

List Azure Managed Grafana instances.

Extension GA
az grafana notification-channel

Commands to manage notification channels of an instance.

Extension GA
az grafana notification-channel create

Create a notification channel.

Extension GA
az grafana notification-channel delete

Delete a notification channel.

Extension GA
az grafana notification-channel list

List all notification channels of an instance.

Extension GA
az grafana notification-channel show

Get details of a notification channel.

Extension GA
az grafana notification-channel test

Tests a notification channels.

Extension GA
az grafana notification-channel update

Update a notification channel.

Extension GA
az grafana restore

Restore an Azure Managed Grafana instance from an achive.

Extension Preview
az grafana service-account

Commands to manage service accounts.

Extension GA
az grafana service-account create

Create a new service account.

Extension GA
az grafana service-account delete

Delete a service account.

Extension GA
az grafana service-account list

List existing service accounts.

Extension GA
az grafana service-account show

Show details of a service account.

Extension GA
az grafana service-account token

Commands to manage service account tokens.

Extension GA
az grafana service-account token create

Create a new service account token.

Extension GA
az grafana service-account token delete

Delete a service account token.

Extension GA
az grafana service-account token list

List existing service account tokens.

Extension GA
az grafana service-account update

Update a service account.

Extension GA
az grafana show

Show details of a Azure Managed Grafana instance.

Extension GA
az grafana update

Update a Azure Managed Grafana instance.

Extension GA
az grafana user

Commands to manage users of an instance.

Extension GA
az grafana user actual-user

Show details of current user.

Extension GA
az grafana user list

List users.

Extension GA
az grafana user show

Show detail of a user.

Extension GA

az grafana backup

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Backup an Azure Managed Grafana instance's content to an achive.

az grafana backup --name
                  [--components {annotations, dashboards, datasources, folders, snapshots}]
                  [--directory]
                  [--folders-to-exclude]
                  [--folders-to-include]
                  [--resource-group]

Examples

backup dashboards under 2 folders (data sources are included to enable name remapping when restore dashboards to another worksapce)

az grafana backup -g MyResourceGroup -n MyGrafana -d c:\temp --folders-to-include "Prod" "Compute Gateway" --components datasources dashboards folders

backup dashboards and skip a few folders

az grafana backup -g MyResourceGroup -n MyGrafana -d c:\temp  --folders-to-exclude General "Azure Monitor" --components datasources dashboards folders

Required Parameters

--name -n

Name of the Azure Managed Grafana.

Optional Parameters

--components -c

Grafana artifact types to backup.

accepted values: annotations, dashboards, datasources, folders, snapshots
--directory -d

Directory to backup Grafana artifacts.

--folders-to-exclude -e

Folders to exclude in backup or sync.

--folders-to-include -i

Folders to include in backup or sync.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az grafana create

Create a Azure Managed Grafana instance.

az grafana create --name
                  --resource-group
                  [--deterministic-outbound-ip {Disabled, Enabled}]
                  [--location]
                  [--principal-ids]
                  [--principal-types {Group, ServicePrincipal, User}]
                  [--skip-role-assignments {false, true}]
                  [--skip-system-assigned-identity {false, true}]
                  [--tags]
                  [--zone-redundancy {Disabled, Enabled}]

Required Parameters

--name -n

Name of the Azure Managed Grafana.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--deterministic-outbound-ip -i

If enabled, the Grafana workspace will have fixed egress IPs you can use them in the firewall of datasources. Default: Disabled.

accepted values: Disabled, Enabled
--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--principal-ids

Space-separated Azure AD object ids for users, groups, etc to be made as Grafana Admins. Once provided, CLI won't make the current logon user as Grafana Admin.

--principal-types

Space-separated Azure AD principal types to pair with --principal-ids.

accepted values: Group, ServicePrincipal, User
--skip-role-assignments

Do not create role assignments for managed identity and the current login user.

accepted values: false, true
default value: False
--skip-system-assigned-identity -s

Do not enable system assigned identity.

accepted values: false, true
default value: False
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--zone-redundancy

Indicates whether or not zone redundancy should be enabled. Default: Disabled.

accepted values: Disabled, Enabled
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az grafana delete

Delete a Azure Managed Grafana instance.

az grafana delete --name
                  [--resource-group]
                  [--yes]

Required Parameters

--name -n

Name of the Azure Managed Grafana.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--yes -y

Do not prompt for confirmation.

default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az grafana list

List Azure Managed Grafana instances.

az grafana list [--resource-group]

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az grafana restore

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Restore an Azure Managed Grafana instance from an achive.

az grafana restore --archive-file
                   --name
                   [--components {annotations, dashboards, datasources, folders, snapshots}]
                   [--remap-data-sources {false, true}]
                   [--resource-group]

Examples

Restore dashboards. If they are under folders, include "folders" in the components list; use "--remap-data-sources" so CLI will update dashboards to point to same data sourceses at target workspace

az grafana restore -g MyResourceGroup -n MyGrafana --archive-file backup\dashboards\ServiceHealth-202307051036.tar.gz --components dashboards folders --remap-data-sources

Required Parameters

--archive-file -a

Archive to restore Grafana artifacts from.

--name -n

Name of the Azure Managed Grafana.

Optional Parameters

--components -c

Grafana artifact types to backup.

accepted values: annotations, dashboards, datasources, folders, snapshots
--remap-data-sources -r

During restoration, update dashboards to reference data sources defined at the destination workspace through name matching.

accepted values: false, true
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az grafana show

Show details of a Azure Managed Grafana instance.

az grafana show --name
                [--resource-group]

Required Parameters

--name -n

Name of the Azure Managed Grafana.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az grafana update

Update a Azure Managed Grafana instance.

az grafana update --name
                  [--api-key {Disabled, Enabled}]
                  [--deterministic-outbound-ip {Disabled, Enabled}]
                  [--from-address]
                  [--from-name]
                  [--host]
                  [--password]
                  [--public-network-access {Disabled, Enabled}]
                  [--resource-group]
                  [--skip-verify {false, true}]
                  [--smtp {Disabled, Enabled}]
                  [--start-tls-policy {MandatoryStartTLS, NoStartTLS, OpportunisticStartTLS}]
                  [--tags]
                  [--user]

Examples

disable the public network access

az grafana update -g MyResourceGroup -n MyGrafana --public-network-access disabled

enable mail notification through SMTP relay sevice of mailgun

az grafana update -g MyResourceGroup -n MyGrafana --smtp enabled --from-address johndoe@outlook.com --from-name john --host "smtp.mailgun.org:587" --user "postmaster@sandbox12345.mailgun.org" --password "password" --start-tls-policy OpportunisticStartTLS --skip-verify true

Required Parameters

--name -n

Name of the Azure Managed Grafana.

Optional Parameters

--api-key --service-account

If enabled, you will be able to configur Grafana api keys and service accounts.

accepted values: Disabled, Enabled
--deterministic-outbound-ip -i

If enabled, the Grafana workspace will have fixed egress IPs you can use them in the firewall of datasources.

accepted values: Disabled, Enabled
--from-address

Address used when sending out emails.

--from-name

Name to be used when sending out emails.

--host

Smtp server url(port included).

--password

Smtp server user password.

--public-network-access -p

Allow public network access.

accepted values: Disabled, Enabled
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--skip-verify

Skip verifying SSL for SMTP server.

accepted values: false, true
--smtp

Allow Grafana to send email.

accepted values: Disabled, Enabled
--start-tls-policy

TLS policy.

accepted values: MandatoryStartTLS, NoStartTLS, OpportunisticStartTLS
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--user

Smtp server user name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

accepted values: json, jsonc, none, table, tsv, yaml, yamlc
default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.