Azure VM自定义脚本未下载

时间:2018-07-12 18:11:27

标签: azure terraform

我正在使用下面的terraform .tf文件。它总是显示错误为

  

DownloadFileAsync:从中下载文件时出错   https://github.dxc.com/raw/gist/jmathews4/2095e2436571715f94e05e5ac5400a67/raw/f554d018ae4fee12979b2ee6f5ac4abb3ff509aa/Terraform.ps1?token=AAAMrnoBPpBc7C8kN2_haQueWaqDhth-ks5bUGqhwA%3D%3D,   重试计数25,异常:System.Net.WebException:请求为   已中止:无法创建SSL / TLS安全通道。在   System.Net.WebClient.DownloadFile(Uri地址,字符串fileName)

您知道GIT可能有什么问题吗?

provider "azurerm" {
   
}

variable "location" { default = "Southeast Asia" }
variable "resourceGroup" { default = "TerraformResearchResourceGroup" }
variable "virtualMachine" { default = "terraformrvm" }

resource "azurerm_virtual_machine_extension" "ext" {
  name                 = "eagpocvmexxt"
  location             = "Southeast Asia"
  resource_group_name  = "terraformrg"
  virtual_machine_name = "terraformvm"
  publisher            = "Microsoft.Compute"
  type                 = "CustomScriptExtension"
  type_handler_version = "1.8"

  settings = <<SETTINGS
    {
        "fileUris": ["https://github.dxc.com/raw/gist/jmathews4/2095e2436571715f94e05e5ac5400a67/raw/f554d018ae4fee12979b2ee6f5ac4abb3ff509aa/Terraform.ps1?token=AAAMrnoBPpBc7C8kN2_haQueWaqDhth-ks5bUGqhwA%3D%3D"],
        "commandToExecute": "powershell.exe -ExecutionPolicy unrestricted -NoProfile -NonInteractive -File Terraform.ps1"
    }
	SETTINGS

  tags {
    environment = "Production"
  }
}

1 个答案:

答案 0 :(得分:0)

是的,问题在于Git正在实施TLS 1.2,而扩展程序却不这样,您的解决方法是将文件放置在扩展程序无需下载即可下载的位置。 Azure存储。