Grafana - Update
更新 Grafana 资源的工作区。
PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}?api-version=2025-08-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
workspace
|
path | True |
string pattern: ^[a-zA-Z][a-z0-9A-Z-]{0,28}[a-z0-9A-Z]$ |
Azure 托管 Grafana 的工作区名称。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| identity |
grafana 资源的托管标识。 |
|
| properties |
特定于托管 grafana 资源的属性。 |
|
| sku |
表示资源的 SKU。 |
|
| tags |
object |
grafana 资源的新标签。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
Azure作已成功完成。 |
|
| 202 Accepted |
已接受请求进行处理,但尚未完成处理。 标头
|
|
| Other Status Codes |
意外的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Grafana_Update
示例请求
PATCH https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Dashboard/grafana/myWorkspace?api-version=2025-08-01
{
"properties": {
"apiKey": "Enabled",
"deterministicOutboundIP": "Enabled",
"enterpriseConfigurations": {
"marketplaceAutoRenew": "Enabled",
"marketplacePlanId": "myPlanId"
},
"grafanaConfigurations": {
"security": {
"csrfAlwaysCheck": false
},
"smtp": {
"enabled": true,
"fromAddress": "test@sendemail.com",
"fromName": "emailsender",
"host": "smtp.sendemail.com:587",
"password": "<password>",
"skipVerify": true,
"startTLSPolicy": "OpportunisticStartTLS",
"user": "username"
},
"snapshots": {
"externalEnabled": true
},
"unifiedAlertingScreenshots": {
"captureEnabled": false
},
"users": {
"editorsCanAdmin": true,
"viewersCanEdit": true
}
},
"grafanaIntegrations": {
"azureMonitorWorkspaceIntegrations": [
{
"azureMonitorWorkspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
}
]
},
"grafanaMajorVersion": "9",
"grafanaPlugins": {
"sample-plugin-id": {}
}
},
"sku": {
"name": "Standard"
},
"tags": {
"Environment": "Dev 2"
}
}
示例响应
{
"name": "myWorkspace",
"type": "Microsoft.Dashboard/grafana",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/grafana/myWorkspace",
"location": "West US",
"properties": {
"apiKey": "Enabled",
"autoGeneratedDomainNameLabelScope": "TenantReuse",
"deterministicOutboundIP": "Enabled",
"endpoint": "https://myworkspace-abcdefghijklmnop.wus.grafana.azure.com",
"enterpriseConfigurations": {
"marketplaceAutoRenew": "Enabled",
"marketplacePlanId": "myPlanId"
},
"grafanaConfigurations": {
"security": {
"csrfAlwaysCheck": false
},
"smtp": {
"enabled": true,
"fromAddress": "test@sendemail.com",
"fromName": "emailsender",
"host": "smtp.sendemail.com:587",
"skipVerify": true,
"startTLSPolicy": "OpportunisticStartTLS",
"user": "username"
},
"snapshots": {
"externalEnabled": true
},
"users": {
"editorsCanAdmin": true,
"viewersCanEdit": true
}
},
"grafanaIntegrations": {
"azureMonitorWorkspaceIntegrations": [
{
"azureMonitorWorkspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
}
]
},
"grafanaMajorVersion": "9",
"grafanaPlugins": {
"sample-plugin-id": {
"pluginId": "sample-plugin-id"
}
},
"grafanaVersion": "9.4.5",
"outboundIPs": [
"192.168.0.1",
"192.168.0.2"
],
"provisioningState": "Succeeded",
"publicNetworkAccess": "Enabled",
"zoneRedundancy": "Enabled"
},
"sku": {
"name": "Standard"
},
"tags": {
"Environment": "Dev 2"
}
}
Azure-AsyncOperation: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Dashboard/locations/eastus2/operationStatuses/sample-op-status?api-version=2025-08-01
{
"name": "myWorkspace",
"type": "Microsoft.Dashboard/grafana",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/grafana/myWorkspace",
"location": "West US",
"properties": {
"apiKey": "Enabled",
"autoGeneratedDomainNameLabelScope": "TenantReuse",
"deterministicOutboundIP": "Enabled",
"endpoint": "https://myworkspace-abcdefghijklmnop.wus.grafana.azure.com",
"enterpriseConfigurations": {
"marketplaceAutoRenew": "Enabled",
"marketplacePlanId": "myPlanId"
},
"grafanaConfigurations": {
"security": {
"csrfAlwaysCheck": false
},
"smtp": {
"enabled": true,
"fromAddress": "test@sendemail.com",
"fromName": "emailsender",
"host": "smtp.sendemail.com:587",
"skipVerify": true,
"startTLSPolicy": "OpportunisticStartTLS",
"user": "username"
},
"snapshots": {
"externalEnabled": true
},
"users": {
"editorsCanAdmin": true,
"viewersCanEdit": true
}
},
"grafanaIntegrations": {
"azureMonitorWorkspaceIntegrations": [
{
"azureMonitorWorkspaceResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace"
}
]
},
"grafanaMajorVersion": "9",
"grafanaPlugins": {
"sample-plugin-id": {
"pluginId": "sample-plugin-id"
}
},
"grafanaVersion": "9.4.5",
"provisioningState": "Accepted",
"publicNetworkAccess": "Enabled",
"zoneRedundancy": "Enabled"
},
"sku": {
"name": "Standard"
},
"systemData": {
"createdAt": "2020-02-03T01:01:01.1075056Z",
"createdBy": "string",
"createdByType": "User",
"lastModifiedAt": "2020-02-04T02:03:01.1974346Z",
"lastModifiedBy": "string",
"lastModifiedByType": "User"
},
"tags": {
"Environment": "Dev 2"
}
}
定义
ApiKey
Grafana 实例的 API 密钥设置。
| 值 | 说明 |
|---|---|
| Disabled | |
| Enabled |
AutoGeneratedDomainNameLabelScope
DNS 确定性名称哈希计算的范围
| 值 | 说明 |
|---|---|
| TenantReuse |
AzureMonitorWorkspaceIntegration
Azure Monitor 工作区的集成。
| 名称 | 类型 | 说明 |
|---|---|---|
| azureMonitorWorkspaceResourceId |
string |
连接的 Azure Monitor 工作区的资源 ID。 |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
CreatorCanAdmin
创建者将拥有 Grafana 实例的管理员访问权限。
| 值 | 说明 |
|---|---|
| Disabled |
创作者管理员访问权限被禁用 |
| Enabled |
已启用创建者管理员访问权限 |
DeterministicOutboundIP
Grafana 实例是否使用确定性的出站 IP。
| 值 | 说明 |
|---|---|
| Disabled | |
| Enabled |
EnterpriseConfigurations
Grafana 实例的企业设置
| 名称 | 类型 | 说明 |
|---|---|---|
| marketplaceAutoRenew |
企业订阅的 AutoRenew 设置 |
|
| marketplacePlanId |
string |
企业插件的 Azure 市场订阅的计划 ID |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
GrafanaConfigurations
Grafana 实例的服务器配置
| 名称 | 类型 | 说明 |
|---|---|---|
| security |
Grafana 安全设置 |
|
| smtp |
电子邮件服务器设置。 https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp |
|
| snapshots |
Grafana 快照设置 |
|
| unifiedAlertingScreenshots |
Grafana Unified Alerting 屏幕截图设置 |
|
| users |
Grafana 用户设置 |
GrafanaIntegrations
GrafanaIntegrations 是捆绑的可观测性体验(例如预先配置的数据源、定制的 Grafana 仪表板、警报默认值),适用于常见监视方案。
| 名称 | 类型 | 说明 |
|---|---|---|
| azureMonitorWorkspaceIntegrations |
Azure Monitor 工作区的集成。 |
GrafanaPlugin
Grafana 的插件
| 名称 | 类型 | 说明 |
|---|---|---|
| pluginId |
string |
Grafana 插件 ID |
ManagedGrafana
grafana 资源类型。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| identity |
分配给此资源的托管服务标识。 |
|
| location |
string |
资源所在的地理位置 |
| name |
string |
资源的名称 |
| properties |
特定于 grafana 资源的属性。 |
|
| sku |
grafana 资源的 SKU。 |
|
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| tags |
object |
资源标记。 |
| type |
string |
资源类型。 例如,“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
ManagedGrafanaProperties
特定于 grafana 资源的属性。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| apiKey | Disabled |
Grafana 实例的 API 密钥设置。 |
|
| autoGeneratedDomainNameLabelScope |
dns 确定性名称哈希计算的范围。 |
||
| creatorCanAdmin |
创建者将拥有 Grafana 实例的管理员访问权限。 |
||
| deterministicOutboundIP | Disabled |
Grafana 实例是否使用确定性的出站 IP。 |
|
| endpoint |
string |
Grafana 实例的端点。 |
|
| enterpriseConfigurations |
Grafana 实例的企业设置 |
||
| grafanaConfigurations |
Grafana 实例的服务器配置 |
||
| grafanaIntegrations |
GrafanaIntegrations 是捆绑的可观测性体验(例如预先配置的数据源、定制的 Grafana 仪表板、警报默认值),适用于常见监视方案。 |
||
| grafanaMajorVersion |
string |
要面向的主要 Grafana 软件版本。 |
|
| grafanaPlugins |
<string,
Grafana |
Grafana 实例的已安装插件列表。 键为插件 ID,值为插件定义。 |
|
| grafanaVersion |
string |
Grafana 软件版本。 |
|
| outboundIPs |
string[] |
如果启用了 deterministicOutboundIP,则出站 IP 列表。 |
|
| privateEndpointConnections |
Grafana 实例的专用终结点连接。 |
||
| provisioningState |
资源的预配状态。 |
||
| publicNetworkAccess | Enabled |
指示通过公共接口启用或禁用流量的状态。 |
|
| zoneRedundancy | Disabled |
Grafana 实例的区域冗余设置。 |
ManagedGrafanaPropertiesUpdateParameters
对 grafana 资源的 PATCH 请求的属性参数。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| apiKey | Disabled |
Grafana 实例的 API 密钥设置。 |
|
| creatorCanAdmin |
创建者将拥有 Grafana 实例的管理员访问权限。 |
||
| deterministicOutboundIP | Disabled |
Grafana 实例是否使用确定性的出站 IP。 |
|
| enterpriseConfigurations |
Grafana 实例的企业设置 |
||
| grafanaConfigurations |
Grafana 实例的服务器配置 |
||
| grafanaIntegrations |
GrafanaIntegrations 是捆绑的可观测性体验(例如预先配置的数据源、定制的 Grafana 仪表板、警报默认值),适用于常见监视方案。 |
||
| grafanaMajorVersion |
string |
要面向的主要 Grafana 软件版本。 |
|
| grafanaPlugins |
<string,
Grafana |
Grafana 插件更新。 键为插件 ID,值为插件定义。 如果插件定义为 null,则将删除具有给定插件 ID 的插件。 否则,将安装给定的插件。 |
|
| publicNetworkAccess | Enabled |
指示通过公共接口启用或禁用流量的状态。 |
|
| zoneRedundancy | Disabled |
Grafana 实例的区域冗余设置。 |
ManagedGrafanaUpdateParameters
对 grafana 资源的 PATCH 请求的参数。
| 名称 | 类型 | 说明 |
|---|---|---|
| identity |
grafana 资源的托管标识。 |
|
| properties |
特定于托管 grafana 资源的属性。 |
|
| sku |
表示资源的 SKU。 |
|
| tags |
object |
grafana 资源的新标签。 |
ManagedServiceIdentity
托管服务标识(系统分配和/或用户分配的标识)
| 名称 | 类型 | 说明 |
|---|---|---|
| principalId |
string (uuid) |
系统分配标识的服务主体 ID。 此属性仅针对系统分配的标识提供。 |
| tenantId |
string (uuid) |
系统分配标识的租户 ID。 此属性仅针对系统分配的标识提供。 |
| type |
托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。 |
|
| userAssignedIdentities |
<string,
User |
User-Assigned 标识 |
ManagedServiceIdentityType
托管服务标识的类型(其中允许 SystemAssigned 和 UserAssigned 类型)。
| 值 | 说明 |
|---|---|
| None | |
| SystemAssigned | |
| UserAssigned | |
| SystemAssigned,UserAssigned |
MarketplaceAutoRenew
企业订阅的 AutoRenew 设置
| 值 | 说明 |
|---|---|
| Disabled | |
| Enabled |
PrivateEndpoint
专用终结点资源。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
专用终结点的 ARM 标识符 |
PrivateEndpointConnection
专用终结点连接资源。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的完全限定资源 ID。 示例 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
string |
资源的名称 |
| properties.groupIds |
string[] |
专用终结点连接组 ID。 |
| properties.privateEndpoint |
专用终结点的资源。 |
|
| properties.privateLinkServiceConnectionState |
有关服务使用者与提供程序之间的连接状态的信息集合。 |
|
| properties.provisioningState |
专用终结点连接资源的预配状态。 |
|
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| type |
string |
资源类型。 例如,“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
PrivateEndpointConnectionProvisioningState
当前预配状态。
| 值 | 说明 |
|---|---|
| Succeeded | |
| Creating | |
| Deleting | |
| Failed |
PrivateEndpointServiceConnectionStatus
专用终结点连接状态。
| 值 | 说明 |
|---|---|
| Pending | |
| Approved | |
| Rejected |
PrivateLinkServiceConnectionState
有关服务使用者与提供程序之间的连接状态的信息集合。
| 名称 | 类型 | 说明 |
|---|---|---|
| actionsRequired |
string |
一条消息,指示服务提供商上的更改是否需要对使用者进行任何更新。 |
| description |
string |
批准/拒绝连接的原因。 |
| status |
指示连接是否已被服务的所有者批准/拒绝/删除。 |
ProvisioningState
| 值 | 说明 |
|---|---|
| Accepted | |
| Creating | |
| Updating | |
| Deleting | |
| Succeeded | |
| Failed | |
| Canceled | |
| Deleted | |
| NotSpecified |
PublicNetworkAccess
指示通过公共接口启用或禁用流量的状态。
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
ResourceSku
表示资源的 SKU。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
SKU 的名称。 |
| size |
指定 Grafana 实例的容量层。 |
Security
Grafana 安全设置
| 名称 | 类型 | 说明 |
|---|---|---|
| csrfAlwaysCheck |
boolean |
设置为 true 以执行 CSRF 检查,即使登录 Cookie 不在请求中(默认值 false)。 |
Size
指定 Grafana 实例的容量层。
| 值 | 说明 |
|---|---|
| X1 |
X1 容量层 |
| X2 |
X2 容量层 |
Smtp
电子邮件服务器设置。 https://grafana.com/docs/grafana/v9.0/setup-grafana/configure-grafana/#smtp
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| enabled |
boolean |
False |
启用此选项以允许 Grafana 发送电子邮件。 默认值为 false |
| fromAddress |
string |
发送电子邮件时使用的地址 https://pkg.go.dev/net/mail#Address |
|
| fromName |
string |
发送电子邮件时要使用的名称。 默认值为“Azure 托管 Grafana 通知” https://pkg.go.dev/net/mail#Address |
|
| host |
string |
具有端口的 SMTP 服务器主机名,例如 test.email.net:587 |
|
| password |
string (password) |
SMTP 身份验证的密码。如果密码包含 # 或 ;,则必须用三引号包装它 |
|
| skipVerify |
boolean |
验证 SMTP 服务器的 SSL。 默认值为 false https://pkg.go.dev/crypto/tls#Config |
|
| startTLSPolicy |
SMTP 配置的 StartTLSPolicy 设置 https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy |
||
| user |
string |
SMTP 身份验证的用户 |
Snapshots
Grafana 快照设置
| 名称 | 类型 | 说明 |
|---|---|---|
| externalEnabled |
boolean |
设置为 false 以禁用外部快照发布终结点 |
StartTLSPolicy
SMTP 配置的 StartTLSPolicy 设置 https://pkg.go.dev/github.com/go-mail/mail#StartTLSPolicy
| 值 | 说明 |
|---|---|
| OpportunisticStartTLS | |
| MandatoryStartTLS | |
| NoStartTLS |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
UnifiedAlertingScreenshots
Grafana Unified Alerting 屏幕截图设置
| 名称 | 类型 | 说明 |
|---|---|---|
| captureEnabled |
boolean |
设置为 false 可由于性能问题而禁用 Unified Alert 中的捕获屏幕截图。 |
UserAssignedIdentity
用户分配的标识属性
| 名称 | 类型 | 说明 |
|---|---|---|
| clientId |
string (uuid) |
分配的标识的客户端 ID。 |
| principalId |
string (uuid) |
已分配标识的主体 ID。 |
Users
Grafana 用户设置
| 名称 | 类型 | 说明 |
|---|---|---|
| editorsCanAdmin |
boolean |
设置为 true,以便编辑者可以管理他们创建的仪表板、文件夹和团队。 |
| viewersCanEdit |
boolean |
设置为 true,以便查看者可以访问和使用浏览并在他们有权访问的仪表板中的面板上执行临时编辑。 他们无法保存更改。 |
ZoneRedundancy
Grafana 实例的区域冗余设置。
| 值 | 说明 |
|---|---|
| Disabled | |
| Enabled |