たにーの楽しい闘争

日々の気になる事を書いていきます

AzureStorageEmulatorを使ってAppendBlob.CreateOrReplace()を実行するとエラーになる時の対処方法

状況

Azure Storage Emulatorのバージョン:5.7.0.0

やりたい事

AzureStorageEmulatorを使ってローカルのタスクテーブルから値を取得し、同じstorageAccountのBlobにAppendBlobを使って取得したレコードをcsvとして吐き出したい。

問題

下記が表示される

Message

{"リモート サーバーがエラーを返しました: (400) 要求が不適切です"}

ErrorCode

"FeatureNotSupportedByEmulator"

HttpStatusCode

"This feature is not currently supported by the Storage Emulator."

検証

今のバージョンではサポートされていない見たいなので、 下記からインストールしてバージョン 5.10に変更して解決

docs.microsoft.com

検証結果

まだ同じエラーが出る

結論

storageの向き先をAzureStorageEmulatorではなく、開発環境(既に発行されているStorageアカウント)にしたら正常に動いた。

AppendBlobはAzureStorageEmulatorではサポートされていないよう。

declined
How can we improve Azure Storage?
  • 187 votes
  • 9 comments

Provide support for append blobs in the Azure Storage Emulator

Currently Append Blobs aren't supported in the Azure Storage Emulator. Attempting an operation on an append blob returns a FeatureNotSupportedByEmulator error (HTTP status code 400 - Bad Request).

feedback.azure.com

教訓

  • 詰まったら文字に起こして頭の中を整理しよう
  • 最新のバージョンを使おう
  • ちゃんとエラーメッセージを細かく確認しよう
  • できれば公式ドキュメント読もう
  • 「サポートされていない」可能性も意識して調査しよう