作为订阅所有者,每当我尝试将 Azure 数据库作为 BACPAC 导出到 datablob 中的容器时,我都会收到 BlobAlreadyExist 错误代码

问题描述 投票:0回答:1

我的任务是备份和删除几个数据库;但是,每当我这样做时(请注意,这个容器是全新的并且完全是空的),我会从活动日志中收到以下错误:

Resource
/subscriptions/XXXXXXX/resourceGroups/XXX/providers/Microsoft.Sql/servers/XXXXX/databases/ACC_Dev

Operation name
Export an existing database.

Time stamp
Mon Apr 08 2024 15:39:52 GMT-0700 (Mountain Standard Time)

Event initiated by
XXXXX

Error code
BlobAlreadyExist

Message
The ImportExport operation failed because the storage blob already exists.

有人知道如何解决此问题,或者对后续故障排除步骤有建议吗?

编辑:这是包含的 JSON 脚本,以防有帮助,已删除 PII。

{
  "authorization": {
    "action": "Microsoft.Sql/servers/databases/export/action",
    "scope": "/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Sql/servers/<server_name>/databases/<database_name>"
  },
  "caller": "<email_removed>",
  "channels": "Operation",
  "claims": {
    "aud": "https://management.core.windows.net/",
    "iss": "https://sts.windows.net/<tenant_id>/",
    "iat": "<token_issued_at_time>",
    "nbf": "<token_not_before_time>",
    "exp": "<token_expiration_time>",
    "http://schemas.microsoft.com/claims/authnclassreference": "1",
    "aio": "<aio_removed>",
    "http://schemas.microsoft.com/claims/authnmethodsreferences": "<auth_methods_references_removed>",
    "appid": "<application_id>",
    "appidacr": "2",
    "http://schemas.microsoft.com/2012/01/devicecontext/claims/identifier": "<device_identifier>",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname": "<surname_removed>",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname": "<given_name_removed>",
    "groups": "<groups_removed>",
    "idtyp": "user",
    "ipaddr": "<ip_address_removed>",
    "name": "<name_removed>",
    "http://schemas.microsoft.com/identity/claims/objectidentifier": "<object_id>",
    "onprem_sid": "<on_premise_sid_removed>",
    "puid": "<puid_removed>",
    "rh": "<rh_removed>",
    "http://schemas.microsoft.com/identity/claims/scope": "user_impersonation",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier": "<name_identifier_removed>",
    "http://schemas.microsoft.com/identity/claims/tenantid": "<tenant_id>",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name": "<email_removed>",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn": "<upn_removed>",
    "uti": "<uti_removed>",
    "ver": "1.0",
    "xms_tcdt": "<xms_tcdt_removed>"
  },
  "correlationId": "<correlation_id>",
  "description": "",
  "eventDataId": "<event_data_id>",
  "eventName": {
    "value": "EndRequest",
    "localizedValue": "End request"
  },
  "category": {
    "value": "Administrative",
    "localizedValue": "Administrative"
  },
  "eventTimestamp": "<event_timestamp>",
  "id": "/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Sql/servers/<server_name>/databases/<database_name>/events/<event_id>/ticks/<ticks>",
  "level": "Error",
  "operationId": "<operation_id>",
  "operationName": {
    "value": "Microsoft.Sql/servers/databases/export/action",
    "localizedValue": "Export an existing database."
  },
  "resourceGroupName": "<resource_group>",
  "resourceProviderName": {
    "value": "Microsoft.Sql",
    "localizedValue": "Microsoft SQL"
  },
  "resourceType": {
    "value": "Microsoft.Sql/servers/databases",
    "localizedValue": "Microsoft.Sql/servers/databases"
  },
  "resourceId": "/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Sql/servers/<server_name>/databases/<database_name>",
  "status": {
    "value": "Failed",
    "localizedValue": "Failed"
  },
  "subStatus": {
    "value": "BadRequest",
    "localizedValue": "Bad Request (HTTP Status Code: 400)"
  },
  "submissionTimestamp": "<submission_timestamp>",
  "subscriptionId": "<subscription_id>",
  "tenantId": "<tenant_id>",
  "properties": {
    "statusCode": "BadRequest",
    "serviceRequestId": null,
    "statusMessage": "{\"error\":{\"code\":\"BlobAlreadyExist\",\"message\":\"The ImportExport operation failed because the storage blob already exists.\"}}",
    "eventCategory": "Administrative",
    "entity": "/subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Sql/servers/<server_name>/databases/<database_name>",
    "message": "Microsoft.Sql/servers/databases/export/action",
    "hierarchy": "<tenant_id>/<subscription_id>"
  },
  "relatedEvents": []
}
sql database azure export bacpac
1个回答
0
投票

作为订阅所有者,每当我尝试将 Azure 数据库作为 BACPAC 导出到 datablob 中的容器时,我都会收到 BlobAlreadyExist 错误代码

导致上述错误的原因是,当容器中已存在数据库并尝试将同一数据库导出到同一容器中时,则会引发错误。我以同样的方式尝试,它抛出了相同的错误,如下所示: enter image description here

一旦 Azure 门户中显示成功弹出消息,请等待一段时间,然后刷新容器。

按照以下步骤将数据库导出到 Azure 容器中:

  1. 转到已在 Azure 门户中创建的 Azure SQL Server,然后单击

    SQL Databases
    下的
    settings
    查看数据库: enter image description here

  2. 选择要导出到容器中的数据库,然后单击

    export
    enter image description here

  3. 用各自的字段填写数据库和存储详细信息,如下所示,并确保该特定容器中的数据库是否已存在: enter image description here

  4. 成功导出到容器后,会在门户中显示

    success
    弹出窗口: enter image description here

输出: 以下是成功导出到容器中的数据库: enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.