Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Missing header 'x-ms-blob-type' when calling createFile and createFileFromContents #295

Open
bimsonz opened this issue Jun 18, 2021 · 1 comment · May be fixed by #296
Open

Missing header 'x-ms-blob-type' when calling createFile and createFileFromContents #295

bimsonz opened this issue Jun 18, 2021 · 1 comment · May be fixed by #296
Labels

Comments

@bimsonz
Copy link

bimsonz commented Jun 18, 2021

Which service(blob, file, queue, table) does this issue concern?

File

Which version of the SDK was used?

1.2.4

What's the PHP/OS version?

PHP 7.4 Mac OSX BigSur

What problem was encountered?

Error, missing required header x-ms-blob-type

Steps to reproduce the issue?

Using a FileEndpoint and SASToken connection string;

  • Insatiate FileRestProxy()
  • Make call to createFile or createFileFromContents

Have you found a mitigation/solution?

Yes,

  • For createFile

Add

        $this->addOptionalHeader(
          $headers,
          Resources::X_MS_BLOB_TYPE,
          'BlockBlob'
        );

to createFileAsync

  • For createFileWithContents the header is needed but also a header should be removed

Is there a failing request ID related to this problem returned by server? What is it?

1216acd1-101e-0018-2f52-642e29000000

What is the storage account name and time frame of your last reproduce? (UTC YYYY/MM/DD hh:mm:ss)

2021-06-18T14:59:36.7330482

(If you think some of the information should not be shared publicly, you can e-mail the main Microsoft contributors of the repository instead.)

@katmsft
Copy link
Member

katmsft commented Sep 6, 2021

My guess is that you mistakenly used file service for ADLS gen 2 service, which is not officially supported by this SDK. You can try to use blob service instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants