az grafana

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 command. Learn more about extensions.

Commands to manage Azure Managed Grafana resources.

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 archive.

Extension Preview
az grafana create

Create a workspace for Grafana resource. This API is idempotent, so user can either create a new grafana or update an existing grafana.

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

Get the details of a dashboard.

Extension GA
az grafana dashboard sync

Sync Azure Managed Grafana dashboards from one instance to another instance. Library panels within the dashboards will be automatically included in the sync. 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 the details of a data source.

Extension GA
az grafana data-source update

Update a data source.

Extension GA
az grafana delete

Delete a workspace for Grafana resource.

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

Get the details of a folder.

Extension GA
az grafana folder update

Update a folder.

Extension GA
az grafana integrations

Commands to manage integrations of a Grafana instance.

Extension GA
az grafana integrations monitor

Commands to manage Azure Monitor workspace integrations of a Grafana instance.

Extension GA
az grafana integrations monitor add

Link an Azure Monitor workspace to a Grafana instance.

Extension Preview
az grafana integrations monitor delete

Unlink an Azure Monitor workspace from a Grafana instance.

Extension Preview
az grafana integrations monitor list

List all Azure Monitor workspaces linked to a Grafana instance.

Extension Preview
az grafana list

List all resources of workspaces for Grafana under the specified subscription.

Extension GA
az grafana list-available-plugin

List all the available plugins.

Extension GA
az grafana migrate

Migrate an existing Grafana instance to an Azure Managed Grafana instance.

Extension Preview
az grafana mpe

Commands to manage managed private endpoints.

Extension GA
az grafana mpe create

Create a managed private endpoint.

Extension GA
az grafana mpe delete

Delete a managed private endpoint.

Extension GA
az grafana mpe list

List all managed private endpoints.

Extension GA
az grafana mpe refresh

Refresh and sync managed private endpoints to latest state.

Extension GA
az grafana mpe show

Get a specific managed private endpoint.

Extension GA
az grafana mpe wait

Place the CLI in a waiting state until a condition is met.

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 the details of a notification channel.

Extension GA
az grafana notification-channel test

Test a notification channel.

Extension GA
az grafana notification-channel update

Update a notification channel.

Extension GA
az grafana private-endpoint-connection

Commands to manage private endpoint connections.

Extension GA
az grafana private-endpoint-connection delete

Delete a private endpoint connection.

Extension GA
az grafana private-endpoint-connection list

List all private endpoint connections.

Extension GA
az grafana private-endpoint-connection show

Get a specific private endpoint connection.

Extension GA
az grafana private-endpoint-connection update

Update a private endpoint connection.

Extension GA
az grafana private-endpoint-connection wait

Place the CLI in a waiting state until a condition is met.

Extension GA
az grafana restore

Restore an Azure Managed Grafana instance from an archive.

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

Get the 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

Get the properties of a specific workspace for Grafana resource.

Extension GA
az grafana update

Update a workspace for Grafana resource.

Extension GA
az grafana user

Commands to manage users of an instance.

Extension GA
az grafana user actual-user

Get the details of the current user.

Extension GA
az grafana user list

List users.

Extension GA
az grafana user show

Get the details of a user.

Extension GA
az grafana wait

Place the CLI in a waiting state until a condition is met.

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 archive.

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

Examples

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

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>.

--skip-folder-permissions -s

Skip backing up Grafana folder permissions. Default: false.

Accepted values: false, true
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 create

Create a workspace for Grafana resource. This API is idempotent, so user can either create a new grafana or update an existing grafana.

az grafana create --name
                  --resource-group
                  [--api-key {Disabled, Enabled}]
                  [--deterministic-outbound-ip {Disabled, Enabled}]
                  [--grafana-major-version]
                  [--location]
                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                  [--principal-ids]
                  [--public-network-access {Disabled, Enabled}]
                  [--skip-identity {0, 1, f, false, n, no, t, true, y, yes}]
                  [--skip-role-assignments {0, 1, f, false, n, no, t, true, y, yes}]
                  [--sku-tier]
                  [--tags]
                  [--zone-redundancy {Disabled, Enabled}]

Examples

create Azure Managed Grafana resource with Standard Sku and public network access enabled

az grafana create --resource-group myResourceGroup --workspace-name myWorkspace --sku-tier Standard --public-network-access Enabled

Required Parameters

--name --workspace-name -n

The workspace name of Azure Managed Grafana.

--resource-group -g

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

Optional Parameters

--api-key --service-account

The api key setting of the Grafana instance.

Accepted values: Disabled, Enabled
Default value: Disabled
--deterministic-outbound-ip -i

Whether a Grafana instance uses deterministic outbound IPs.

Accepted values: Disabled, Enabled
Default value: Disabled
--grafana-major-version -v

The major Grafana software version to target.

--location -l

The geo-location where the grafana resource lives.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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 logged-in user as Grafana Admin Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--public-network-access -p

Indicate the state for enable or disable traffic over the public interface.

Accepted values: Disabled, Enabled
Default value: Enabled
--skip-identity --skip-system-assigned-identity

Do not enable system assigned identity. Use this option if you want to manage the identity yourself.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Default value: False
--skip-role-assignments

Skip creating default role assignments for the managed identity of the Grafana instance and the current CLI account. Use this option if you want to manage role assignments yourself.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Default value: False
--sku-tier

The Sku of the grafana resource.

Default value: Standard
--tags

The tags for grafana resource. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--zone-redundancy

The zone redundancy setting of the Grafana instance.

Accepted values: Disabled, Enabled
Default value: Disabled
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 workspace for Grafana resource.

az grafana delete [--ids]
                  [--name]
                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                  [--resource-group]
                  [--subscription]
                  [--yes]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --workspace-name -n

The workspace name of Azure Managed Grafana.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

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

--subscription

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

--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 all resources of workspaces for Grafana under the specified subscription.

az grafana list [--max-items]
                [--next-token]
                [--resource-group]

Optional Parameters

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

--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 list-available-plugin

List all the available plugins.

az grafana list-available-plugin [--ids]
                                 [--name]
                                 [--resource-group]
                                 [--subscription]

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --workspace-name -n

The workspace name of Azure Managed Grafana.

--resource-group -g

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

--subscription

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

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 migrate

Preview

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

Migrate an existing Grafana instance to an Azure Managed Grafana instance.

az grafana migrate --name
                   --src-endpoint
                   --src-token-or-key
                   [--dry-run {false, true}]
                   [--folders-to-exclude]
                   [--folders-to-include]
                   [--overwrite {false, true}]
                   [--resource-group]

Examples

Migrate dashboards and folders from a local Grafana instance to an Azure Managed Grafana instance.

az grafana migrate -g MyResourceGroup -n MyGrafana -s http://localhost:3000 -t YourServiceTokenOrAPIKey

Required Parameters

--name -n

Name of the Azure Managed Grafana.

--src-endpoint -s

Grafana instance endpoint to migrate from.

--src-token-or-key -t

Grafana instance service token (or api key) to get access to migrate from.

Optional Parameters

--dry-run -d

Preview changes without committing. Takes priority over --overwrite.

Accepted values: false, true
Default value: False
--folders-to-exclude -e

Folders to exclude in backup or sync.

--folders-to-include -i

Folders to include in backup or sync.

--overwrite

Overwrite previous dashboards, library panels, and folders with the same uid or title.

Accepted values: false, true
Default value: False
--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 archive.

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 sources 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

Get the properties of a specific workspace for Grafana resource.

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

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --workspace-name -n

The workspace name of Azure Managed Grafana.

--resource-group -g

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

--subscription

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

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 workspace for Grafana resource.

az grafana update [--api-key {Disabled, Enabled}]
                  [--deterministic-outbound-ip {Disabled, Enabled}]
                  [--from-address]
                  [--from-name]
                  [--grafana-major-version]
                  [--host]
                  [--ids]
                  [--name]
                  [--password]
                  [--public-network-access {Disabled, Enabled}]
                  [--resource-group]
                  [--skip-verify {0, 1, f, false, n, no, t, true, y, yes}]
                  [--sku-tier]
                  [--smtp {0, 1, f, false, n, no, t, true, y, yes}]
                  [--start-tls-policy {MandatoryStartTLS, NoStartTLS, OpportunisticStartTLS}]
                  [--subscription]
                  [--tags]
                  [--user]
                  [--zone-redundancy {Disabled, Enabled}]

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

Optional Parameters

--api-key --service-account

The api key setting of the Grafana instance.

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

Whether a Grafana instance uses deterministic outbound IPs.

Accepted values: Disabled, Enabled
--from-address

Address used when sending out emails https://pkg.go.dev/net/mail#Address.

--from-name

Name to be used when sending out emails. Default is "Azure Managed Grafana Notification" https://pkg.go.dev/net/mail#Address.

--grafana-major-version --major-version -v

The major Grafana software version to target.

--host

SMTP server hostname with port, e.g. test.email.net:587.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name --workspace-name -n

The workspace name of Azure Managed Grafana.

--password

Password of SMTP auth. If the password contains # or ;, then you have to wrap it with triple quotes.

--public-network-access -p

Indicate the state for enable or disable traffic over the public interface.

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

Verify SSL for SMTP server. Default is false https://pkg.go.dev/crypto/tls#Config.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--sku-tier

The Sku of the grafana resource.

--smtp --smtp-enabled

Enable this to allow Grafana to send email.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--start-tls-policy

The StartTLSPolicy setting of the SMTP configuration https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy.

Accepted values: MandatoryStartTLS, NoStartTLS, OpportunisticStartTLS
--subscription

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

--tags

The tags for grafana resource. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--user

User of SMTP auth.

--zone-redundancy

The zone redundancy setting of the Grafana instance.

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 wait

Place the CLI in a waiting state until a condition is met.

az grafana wait [--created]
                [--custom]
                [--deleted]
                [--exists]
                [--ids]
                [--interval]
                [--name]
                [--resource-group]
                [--subscription]
                [--timeout]
                [--updated]

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--interval

Polling interval in seconds.

Default value: 30
--name --workspace-name -n

The workspace name of Azure Managed Grafana.

--resource-group -g

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

--subscription

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

--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

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.