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
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 of the Azure Managed Grafana.
Optional Parameters
Grafana artifact types to backup.
Directory to backup Grafana artifacts.
Folders to exclude in backup or sync.
Folders to include in backup or sync.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Skip backing up Grafana folder permissions. Default: false.
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 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
The workspace name of Azure Managed Grafana.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
The api key setting of the Grafana instance.
Whether a Grafana instance uses deterministic outbound IPs.
The major Grafana software version to target.
The geo-location where the grafana resource lives.
Do not wait for the long-running operation to finish.
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.
Indicate the state for enable or disable traffic over the public interface.
Do not enable system assigned identity. Use this option if you want to manage the identity yourself.
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.
The Sku of the grafana resource.
The tags for grafana resource. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
The zone redundancy setting of the Grafana instance.
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 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
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.
The workspace name of Azure Managed Grafana.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Do not prompt for confirmation.
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 list
List all resources of workspaces for Grafana under the specified subscription.
az grafana list [--max-items]
[--next-token]
[--resource-group]
Optional Parameters
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.
Token to specify where to start paginating. This is the token value from a previously truncated response.
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 list-available-plugin
List all the available plugins.
az grafana list-available-plugin [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
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.
The workspace name of Azure Managed Grafana.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 migrate
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 of the Azure Managed Grafana.
Grafana instance endpoint to migrate from.
Grafana instance service token (or api key) to get access to migrate from.
Optional Parameters
Preview changes without committing. Takes priority over --overwrite.
Folders to exclude in backup or sync.
Folders to include in backup or sync.
Overwrite previous dashboards, library panels, and folders with the same uid or title.
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 restore
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 to restore Grafana artifacts from.
Name of the Azure Managed Grafana.
Optional Parameters
Grafana artifact types to backup.
During restoration, update dashboards to reference data sources defined at the destination workspace through name matching.
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 show
Get the properties of a specific workspace for Grafana resource.
az grafana show [--ids]
[--name]
[--resource-group]
[--subscription]
Optional Parameters
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.
The workspace name of Azure Managed Grafana.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 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
The api key setting of the Grafana instance.
Whether a Grafana instance uses deterministic outbound IPs.
Address used when sending out emails https://pkg.go.dev/net/mail#Address.
Name to be used when sending out emails. Default is "Azure Managed Grafana Notification" https://pkg.go.dev/net/mail#Address.
The major Grafana software version to target.
SMTP server hostname with port, e.g. test.email.net:587.
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.
The workspace name of Azure Managed Grafana.
Password of SMTP auth. If the password contains # or ;, then you have to wrap it with triple quotes.
Indicate the state for enable or disable traffic over the public interface.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Verify SSL for SMTP server. Default is false https://pkg.go.dev/crypto/tls#Config.
The Sku of the grafana resource.
Enable this to allow Grafana to send email.
The StartTLSPolicy setting of the SMTP configuration https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The tags for grafana resource. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
User of SMTP auth.
The zone redundancy setting of the Grafana instance.
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 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
Wait until created with 'provisioningState' at 'Succeeded'.
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Wait until deleted.
Wait until the resource exists.
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.
Polling interval in seconds.
The workspace name of Azure Managed Grafana.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Maximum wait in seconds.
Wait until updated with provisioningState at 'Succeeded'.
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.