Open celluj34 opened 1 year ago
In fact, it looks like it's just straight overwritten: https://github.com/microsoft/azure-pipelines-tasks/blob/42521e11655e3919e11976934375e021f4bc4896/Tasks/AzureFileCopyV5/Utility.ps1#L176
Hello, has anyone had time to look at this?
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
Bump
Any solution for this issue? I set a pipeline variable for AZCOPY_CONTENT_TYPE_MAP to the file path to my mime type json file in my DevOps repo. This approach did not work either. My PowerShell script reads the environment variable with the path and then displays the file contents but AzureFileCopy does not use the mime type file for copying the files.
steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
ls
pwd
${env:AZCOPY_CONTENT_TYPE_MAP}
cat ${env:AZCOPY_CONTENT_TYPE_MAP
}
==============================================================================
Task : PowerShell
Description : Run a PowerShell script on Linux, macOS, or Windows
Version : 2.236.2
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
==============================================================================
Generating script.
========================== Starting Command Output ===========================
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\a\_temp\9f84596b-c557-4e8f-867c-4a7cd70e1f30.ps1'"
Directory: D:\a\1\s
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 3/25/2024 1:34 PM static
-a---- 3/25/2024 1:34 PM 711 azure-pipeline.yaml
-a---- 3/25/2024 1:34 PM 68 mime_types.json
Drive : D
Provider : Microsoft.PowerShell.Core\FileSystem
ProviderPath : D:\a\1\s
Path : D:\a\1\s
mime_types.json
{
"MIMETypeMapping": {
".webp": "image/webp"
}
}
Finishing: PowerShell
I worked around this by using the az cli directly. Unfortunately I never got this working with this specific task.
Task name
AzureFileCopy
Task version
5.218.0
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
Windows 10
Task log
Relevant log output
I can see it's using the built-in mime mapping, but I want to use my own mapping.
Aditional info
In my release I create a custom json file which contains my custom mime mapping, but it doesn't seem to be getting picked up by the task. I can see the version of azcopy.exe should be 10.12, which is supposed to read the file located at AZCOPY_CONTENT_TYPE_MAP, but it doesn't seem to be doing anything with it.