简体   繁体   English

Terraform,存档因缺少目录而失败

[英]Terraform, Archive failed due to missing directory

I have been working on Terraform using AzureDevOps before that I developed tf files using VS code and everything worked fine when try to move files from VS code to Azure DevOps , getting issue on Archive source file path it unable to find the directory, searched every where but unable to resolve this,我一直在使用 AzureDevOps 开发 Terraform 之前,我使用 VS 代码开发了 tf 文件,当尝试将文件从 VS 代码移动到 Azure DevOps 时一切正常,在存档源文件路径上遇到问题,它无法找到目录,到处搜索但无法解决这个问题,

Path which was working fine on VS code was “…/Folder name” using same path in Azure DevOps as I have upload completed folder that I have build in VS code but it always get failed when try to archive files as it un-able to find the directory.在 VS 代码上运行良好的路径是“.../文件夹名称”,在 Azure DevOps 中使用相同的路径,因为我已经上传了我在 VS 代码中构建的完整文件夹,但是当尝试存档文件时它总是失败,因为它无法找到目录。

[Code Block DevOps] [代码块 DevOps]

terraform {
  required_providers {
    azurerm = {
      source = "hashicorp/azurerm"
      # Root module should specify the maximum provider version
      # The ~> operator is a convenient shorthand for allowing only patch releases within a specific minor release.
      version = "~>2.11"
    }
  }
}

provider "azurerm" {
  features {}
  #skip_provider_registration = true
}

locals {
  location = "uksouth"
}

data "archive_file" "file_function_app" {
  type        = "zip"
  source_dir  = "../BlobToBlobTransferPackage"
  output_path = "blobtoblobtransfer-app.zip"
}

module "windows_consumption" {
  source = "./modules/fa"

  archive_file = data.archive_file.file_function_app
}

output "windows_consumption_hostname" {
  value = module.windows_consumption.function_app_default_hostname
}

Image of VS Code where everything is working fine:一切正常的 VS Code 的图像: 在此处输入图像描述 Image of DevOps where getting Missing Directory Error:出现缺少目录错误的 DevOps 图像:
在此处输入图像描述

Folder Structure that is working fine with VS code适用于 VS 代码的文件夹结构

这是由于现在固定的路径,

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

相关问题 由于缺少 Azure 存储连接字符串和 SAS 连接 uri,从 Blob 存储的秘密初始化失败 - Secret initialization from Blob storage failed due to missing both an Azure Storage connection string and a SAS connection uri 由于错误,azcopy 无法执行复制命令:如果没有 --recursive 或尾随通配符 (/*),则无法将目录用作源 - azcopy failed to perform copy command due to error: cannot use directory as source without --recursive or a trailing wildcard (/*) Terraform 中的虚拟机扩展,由于版本错误 - Virtual Machine Extension in Terraform, error due to Version Azure 存档存储中的再水化目录 - Rehydrating Directory from Azure Archive storage terraform / azure 上的奇怪错误“缺少必需的参数” - odd errors on terraform / azure “Missing required argument” 错误:无法加载插件架构 | 天蓝色 | 地形 - Error: Failed to load plugin schemas | Azure | Terraform Terraform:无法查询可用的提供程序包(Azapi) - Terraform: Failed to query available provider packages (Azapi) Terraform MySQL 提供程序“错误:无法安装提供程序” - Terraform MySQL provider 'Error: Failed to install providers' Terraform 错误:无法查询可用的提供程序包 - Terraform Error: Failed to query available provider packages 由于缺少程序集引用,Azure部署失败 - Azure deployment failes due to missing assembly reference
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM