none
Storage Emulator Batch operation fails: JsonFormatNotSupported

    Question

  • I am having trouble with the Azure storage EMULATOR when I send a a batch containing one changeset.

    Here are the publicly available credentials that I use:

    account name: devstoreaccount1

    key: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==

    In that changeset I use a json payload. Here is a capture from Fiddler of the HTTP request I send out:

    """

    POST http://127.0.0.1:10002/devstoreaccount1/$batch HTTP/1.1
    Accept: application/json;odata=minimalmetadata
    x-ms-version: 2013-08-15
    Content-Type: multipart/mixed; boundary=batch_a1e9d677-b28b-435e-a89e-87e6a768a431
    x-ms-date: Wed, 20 Aug 2014 15:51:44 GMT
    Authorization: SharedKeyLite devstoreaccount1:pYsBvjqA5gNes4L7PlYrmJuKk+FxWby4Fyplgbl9Nyw=
    Accept-Language: en-US,en-ZA;q=0.7,en;q=0.3
    UA-CPU: AMD64
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; MSAppHost/2.0; rv:11.0) like Gecko
    Connection: Keep-Alive
    Content-Length: 639
    Host: 127.0.0.1:10002
    Pragma: no-cache

    --batch_a1e9d677-b28b-435e-a89e-87e6a768a431
    Content-Type: multipart/mixed; boundary=changeset_8a28b620-b4bb-458c-a177-0959fb14c977

    --changeset_8a28b620-b4bb-458c-a177-0959fb14c977
    Content-Type: application/http
    Content-Transfer-Encoding: binary

    PUT http://127.0.0.1:10002/devstoreaccount1/boobooboo(PartitionKey='Channel_19',RowKey='1') HTTP/1.1
    Content-Type: application/json
    Accept: application/json;odata=minimalmetadata
    x-ms-version: 2013-08-15

    {"PartitionKey":"Channel_19","RowKey":"1","Rating":9,"Text":".NET..."}

    --changeset_8a28b620-b4bb-458c-a177-0959fb14c977--
    --batch_a1e9d677-b28b-435e-a89e-87e6a768a431--

    """

    And here is the response I get back from the emulator:

    """

    HTTP/1.1 202 Accepted
    Cache-Control: no-cache
    Content-Type: multipart/mixed; boundary=batchresponse_b459ba99-58f8-4a60-9b4e-bca74afc0e39
    Server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
    x-ms-request-id: dfc8e1c3-4a99-4299-9252-dbc177bf6db3
    x-ms-version: 2013-08-15
    X-Content-Type-Options: nosniff
    Date: Wed, 20 Aug 2014 15:51:44 GMT
    Content-Length: 779

    --batchresponse_b459ba99-58f8-4a60-9b4e-bca74afc0e39
    Content-Type: multipart/mixed; boundary=changesetresponse_66204595-1aa3-4e93-873f-8b66905e9550

    --changesetresponse_66204595-1aa3-4e93-873f-8b66905e9550
    Content-Type: application/http
    Content-Transfer-Encoding: binary

    HTTP/1.1 415 Unsupported Media Type
    X-Content-Type-Options: nosniff
    DataServiceVersion: 3.0;
    Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8

    {"odata.error":{"code":"JsonFormatNotSupported","message":{"lang":"en-US","value":"0:JSON format is not supported.\nRequestId:dfc8e1c3-4a99-4299-9252-dbc177bf6db3\nTime:2014-08-20T15:51:44.8561252Z"}}}
    --changesetresponse_66204595-1aa3-4e93-873f-8b66905e9550--
    --batchresponse_b459ba99-58f8-4a60-9b4e-bca74afc0e39--

    """

    The weird thing is, I am able to post a json payload PERFECTLY fine if I don't try batching.

    Can anyone see if there is something missing from my request? What can I do/use to help me debug the issue more?

    Wednesday, August 20, 2014 4:00 PM

Answers

  • It turns out that I was missing a header:

    MaxDataServiceVersion: 3.0;NetFx

    So my request header should look something like:

    """

    POST http://127.0.0.1:10002/devstoreaccount1/$batch HTTP/1.1
    Accept: */*
    x-ms-version: 2014-02-14
    DataServiceVersion: 3.0;
    Content-Type: multipart/mixed; boundary=batch_263c1534-47a0-4721-a76b-80b58cdf31ff
    x-ms-date: Wed, 20 Aug 2014 20:20:01 GMT
    Authorization: SharedKeyLite devstoreaccount1:Q2XtDBKtwlIgNoGU8r3ltXtf6R4LmVfvNs12vhI/cLg=
    MaxDataServiceVersion: 3.0;NetFx
    Accept-Language: en-US,en-ZA;q=0.7,en;q=0.3
    UA-CPU: AMD64
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; MSAppHost/2.0; rv:11.0) like Gecko
    Connection: Keep-Alive
    Content-Length: 572
    Host: 127.0.0.1:10002
    Pragma: no-cache

    --batch_263c1534-47a0-4721-a76b-80b58cdf31ff
    Content-Type: multipart/mixed; boundary=changeset_52746636-83b9-4d69-85ac-9b921b0df99b

    --changeset_52746636-83b9-4d69-85ac-9b921b0df99b
    Content-Type: application/http
    Content-Transfer-Encoding: binary

    PUT http://ipv4.fiddler:10002/devstoreaccount1/boobooboo(PartitionKey='Channel_19',RowKey='1') HTTP/1.1
    Accept: application/json;odata=minimalmetadata
    Content-Type: application/json
    DataServiceVersion: 3.0;

    {}
    --changeset_52746636-83b9-4d69-85ac-9b921b0df99b--
    --batch_263c1534-47a0-4721-a76b-80b58cdf31ff--


    """

    • Marked as answer by a maple Wednesday, August 20, 2014 8:25 PM
    Wednesday, August 20, 2014 8:24 PM

All replies

  • It turns out that I was missing a header:

    MaxDataServiceVersion: 3.0;NetFx

    So my request header should look something like:

    """

    POST http://127.0.0.1:10002/devstoreaccount1/$batch HTTP/1.1
    Accept: */*
    x-ms-version: 2014-02-14
    DataServiceVersion: 3.0;
    Content-Type: multipart/mixed; boundary=batch_263c1534-47a0-4721-a76b-80b58cdf31ff
    x-ms-date: Wed, 20 Aug 2014 20:20:01 GMT
    Authorization: SharedKeyLite devstoreaccount1:Q2XtDBKtwlIgNoGU8r3ltXtf6R4LmVfvNs12vhI/cLg=
    MaxDataServiceVersion: 3.0;NetFx
    Accept-Language: en-US,en-ZA;q=0.7,en;q=0.3
    UA-CPU: AMD64
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; MSAppHost/2.0; rv:11.0) like Gecko
    Connection: Keep-Alive
    Content-Length: 572
    Host: 127.0.0.1:10002
    Pragma: no-cache

    --batch_263c1534-47a0-4721-a76b-80b58cdf31ff
    Content-Type: multipart/mixed; boundary=changeset_52746636-83b9-4d69-85ac-9b921b0df99b

    --changeset_52746636-83b9-4d69-85ac-9b921b0df99b
    Content-Type: application/http
    Content-Transfer-Encoding: binary

    PUT http://ipv4.fiddler:10002/devstoreaccount1/boobooboo(PartitionKey='Channel_19',RowKey='1') HTTP/1.1
    Accept: application/json;odata=minimalmetadata
    Content-Type: application/json
    DataServiceVersion: 3.0;

    {}
    --changeset_52746636-83b9-4d69-85ac-9b921b0df99b--
    --batch_263c1534-47a0-4721-a76b-80b58cdf31ff--


    """

    • Marked as answer by a maple Wednesday, August 20, 2014 8:25 PM
    Wednesday, August 20, 2014 8:24 PM
  • Hello,

    In this case we would need more specific details from you (Sensitive Account related information) for us to Analyse and help you on the same.

    We recommend to open a new Service Request for us to assist you on the same. The link below should be helpful for you to open a new Service

    Request.

    http://azure.microsoft.com/en-us/support/options/


    Regards,

    Neelesh.

    Wednesday, August 20, 2014 8:34 PM
    Moderator