azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

mcr.microsoft.com/azure-cli strange bega

Open Bv-Lucas opened this issue 3 years ago • 3 comments

Describe the bug

I use az storage blob upload-batch to push content to a Microsoft CDN

The files uploaded this way have no content-type if I use the azure-cli image available from mcr.microsoft.com/azure-cli

The weird thing about this is that it works correctly when I run it from my mac computer, but not when using the image. My current azure-cli version is

azure-cli                         2.50.0 *

core                              2.50.0 *
telemetry                          1.0.8 *

Extensions:
aks-preview                      0.5.135
storage-preview                    0.8.4

Dependencies:
msal                              1.22.0
azure-mgmt-resource             23.1.0b2

I tried using the same azure-cli version since in the latest image it is 2.51.0 but I face the same issue, my command is : az storage blob upload-batch --account-name [redacted] --overwrite true -s assets -d "\$web/assets2" This is the output when ran from my mac:

Finished[#############################################################]  100.0000%
[
  {
    "Blob": "[redacted]",
    "Last Modified": "2023-08-22T13:50:42+00:00",
    "Type": "image/webp",
    "eTag": "\"0x8DBA316C6CA7C22\""
  },
  {
    "Blob": "[redacted]",
    "Last Modified": "2023-08-22T13:50:42+00:00",
    "Type": "image/webp",
    "eTag": "\"0x8DBA316C6CF0F58\""
  }
]

This is the ouput when ran from mcr.microsoft.com/azure-cli:2.50.0 (same result with latest image)

Finished[#############################################################]  100.0000%
[
  {
    "Blob": "[redacted]",
    "Last Modified": "2023-08-22T13:46:42+00:00",
    "Type": null,
    "eTag": "\"0x8DBA3163821FE95\""
  },
  {
    "Blob": "[redacted]",
    "Last Modified": "2023-08-22T13:46:43+00:00",
    "Type": null,
    "eTag": "\"0x8DBA3163835F8E4\""
  }
]

Related command

az storage blob upload-batch

Errors

no errors, see description

Issue script & Debug output

no debug output

Expected behavior

The content type should be identified as image/webp correctly from the microsoft provided image

Environment Summary

see description

Additional context

As a workaround I'm currently forcing content-type using the flag in az storage blob upload-batch

Bv-Lucas avatar Aug 22 '23 14:08 Bv-Lucas

Hi @Bv-Lucas,

2.50.0 is not the latest Azure CLI(2.51.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

Thank you for opening this issue, we will look into it.

yonzhan avatar Aug 22 '23 14:08 yonzhan

Have you tried the latest 2.52.0 version. And have you tried a different destination (storage container)? So far was not able to reproduce this issue.

calvinhzy avatar Sep 06 '23 07:09 calvinhzy