通过Terraform执行时Azcopy引发错误

问题描述

我正在使用Azcopy工具将一个存储帐户复制到另一个帐户。使用终端执行命令时,它会完美执行。但是,在使用Terraform的本地执行程序执行相同操作时,会引发错误。请在下面找到代码和错误。

代码:

resource "null_resource" "backup" {
      provisioner "local-exec" {
     command= <<EOF
        azcopy cp "https://${var.src_storage_acc_name}.blob.core.windows.net${var.src_sas}" "https://${var.dest_storage_acc_name}.blob.core.windows.net${var.dest_sas}"
        EOF
  }
}

错误:

 Error running command '        azcopy cp "https://strsrc.blob.core.windows.net?[SAS]" "https://strdest.blob.core.windows.net?[SAS]"
': exit status 1. Output: INFO: The parameters you supplied were Source: '"https://strsrc.blob.core.windows.net?[SAS]-REDACTED- of type Local,and Destination: '"https://strdest.blob.core.windows.net?[SAS]-REDACTED- of type Local
INFO: Based on the parameters supplied,a valid source-destination combination could not automatically be found. Please check the parameters you supplied.  If they are correct,please specify an exact source and destination type using the --from-to switch. Valid values are two-word phases of the form BlobLocal,LocalBlob etc.  Use the word 'Blob' for Blob Storage,'Local' for the local file system,'File' for Azure Files,and 'BlobFS' for ADLS Gen2. If you need a combination that is not supported yet,please log an issue on the AzCopy GitHub issues list.

failed to parse user input due to error: the inferred source/destination combination could not be identified,or is currently not supported

请提供您对此的想法。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)