microsoft / terraform-provider-azuredevops

Terraform Azure DevOps provider
https://www.terraform.io/docs/providers/azuredevops/
MIT License
387 stars 281 forks source link

Ability to upload binary files with "azuredevops_git_repository_file" #773

Open MWOITC opened 1 year ago

MWOITC commented 1 year ago

Community Note

Description

I'm able to upload text files to an AzureDevops repo using the "azuredevops_git_repository_file" resource. However, this resource fails when trying to upload binary data (e.g. image files like PNG). Using any of the current contenttypes (e.g. filebase64sha256) allow binary data to be uploaded but it becomes unusable after that.

New or Affected Resource(s)

Potential Terraform Configuration

resource "azuredevops_git_repository_file" "image_file" {
  # ...
  # INVALID: The provider does not yet support this argument
  content_base64 = filebase64("${path.module}/wiki.png")
  # ...
}

References

xuzhang3 commented 1 year ago

Support upload binary files. Ref: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pushes/create?view=azure-devops-rest-7.0&tabs=HTTP#add-a-binary-file