简体   繁体   English

无法将 .bacpac 文件从 Azure VM 上传到 Azure blob 存储容器

[英]Not able to upload the .bacpac file from Azure VM to Azure blob storage container

I am working on a use case, where I will be deploying the DB schema from Development to UAT and Production, but before deploying to UAT and production, i am taking the backup of both UAT and production as a.bacpac file.我正在处理一个用例,我将在其中将数据库模式从开发部署到 UAT 和生产,但在部署到 UAT 和生产之前,我将 UAT 和生产的备份作为 a.bacpac 文件。 Below are the steps I have performed in Azure DevOps pipeline以下是我在 Azure DevOps 管道中执行的步骤

  1. Generated the.bacpac file using "Azure SQL Database deployment" inbuilt task.使用“Azure SQL 数据库部署”内置任务生成 .bacpac 文件。 The file generated at "D:\a\r1\a\GeneratedOutputFiles\filename.bacpac在“D:\a\r1\a\GeneratedOutputFiles\filename.bacpac 生成的文件

  2. check if the file exist on the above path -> Yes file is available.检查文件是否存在于上述路径 -> 是文件可用。

  3. Copy to blob storage using "Azure File Copy" inbuilt task.使用“Azure 文件复制”内置任务复制到 blob 存储。 The Source path which I took is $(System.ArtifactsDirectory)\GeneratedOutputFiles我采用的源路径是 $(System.ArtifactsDirectory)\GeneratedOutputFiles
    and destination is my blob container.目的地是我的 blob 容器。 PFA, the details about each step and the logs in the google drive document. PFA,关于每个步骤的详细信息和谷歌驱动器文档中的日志。 The issue is I am not able to upload the file to blob storage as the logs says that the source folder is empty, but the file is present in the source folder.问题是我无法将文件上传到 blob 存储,因为日志显示源文件夹为空,但文件存在于源文件夹中。 Can someone please take a look and guide me what I am missing here?有人可以看看并指导我在这里缺少什么吗? Google Drive path of the document 文档的 Google Drive 路径

You can use AzCopy to copy files from or to Azure Blob storage.可以使用AzCopy从 Azure Blob 存储中复制文件或向其中复制文件。

AzCopy is a command-line utility that you can use to copy blobs or files to or from a storage account. AzCopy 是一个命令行实用工具,可用于将 blob 或文件复制到存储帐户或从中复制。

You can visit this official document by Microsoft to download and know more about AzCopy.您可以访问微软官方文档下载并了解更多关于AzCopy的信息。

Also, to copy the files from Azure VM to Blob Storage follow this third-party tutorial .此外,要将文件从 Azure VM 复制到 Blob 存储,请遵循此第三方教程

In the AzCopy command, you will be required to use SAS Token of the container in which you want to copy the.bacpac file.在 AzCopy 命令中,您将需要使用要在其中复制 .bacpac 文件的容器的 SAS 令牌。

The new v4 of the File Copy Task in Azure Pipelines moved from using AzCopy 8 to AzCopy 10, and it requires more security for Azure DevOps Service Principal to authenticate with Azure. Azure 管道中文件复制任务的新v4从使用 AzCopy 8 转移到 AzCopy 10,它需要更高的安全性来让 Azure DevOps 服务主体通过 Azure 进行身份验证。

You can:你可以:

  1. change to "v3" version for the task.更改为任务的“v3”版本。 在此处输入图像描述
  2. Or you need to give the Service Principal role of: Storage Blob Data Contributor and Storage Blob Data Owner或者您需要赋予服务主体角色: Storage Blob Data ContributorStorage Blob Data Owner

You can find more details in link:https://github.com/microsoft/azure-pipelines-tasks/issues/13124您可以在链接中找到更多详细信息:https://github.com/microsoft/azure-pipelines-tasks/issues/13124

and https://brettmckenzie.net/2020/03/23/azure-pipelines-copy-files-task-authentication-failed/ .https://brettmckenzie.net/2020/03/23/azure-pipelines-copy-files-task-authentication-failed/

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 直接从浏览器上传文件到 Azure Blob 存储? - Upload file to Azure Blob Storage directly from browser? 从 azure blob 存储中获取文件名 - Get file names from azure blob storage git:在映射到 Azure VM 的 Azure Blob 存储中检测到可疑所有权 - git: detected dubious ownership in Azure Blob Storage mapped on a Azure VM 通过 REST 上传大文件到 Azure blob 存储 API Put Block Blob - Upload large file to Azure blob storage via REST API Put Block Blob 无法从 Azure Blob 存储检索图像 - Could not retrieve image from Azure Blob Storage Powershell Azure Function 将 Excel 文件写入 Azure Blob 存储 - Powershell Azure Function to write an Excel file to Azure Blob Storage 将 Bacpac 文件导入 Azure SQL DB - Import Bacpac file into Azure SQL DB 如何使用 Blazor 将大文件上传到 WebAPI (C#) 并将其存储到 Azure Blob 存储中 - How to upload large file using Blazor to WebAPI (C#) and store it into Azure Blob storage Azure Blob 存储 - container.GetBlobsByHierarchyAsync - 不返回结果 - Azure Blob Storage - container.GetBlobsByHierarchyAsync - not returning result 从 azure blob 存储(静态网站)访问 azure 密钥库 - Access azure key vault from azure blob storage (static website)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM