locked
Azure StorageV2 File Storage returns (400) Bad Request RRS feed

  • Question

  • CloudStorageAccount storageAccount = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=bxxxx;AccountKey=xxxx;EndpointSuffix=core.windows.net");
                    CloudFileClient fileClient = storageAccount.CreateCloudFileClient();
    
                    CloudFileShare share = fileClient.GetShareReference("logs");
    
                    if (share.Exists())
                    {
                    }

    Using version 9.3.1

    Exception is thrown here.

    if (share.Exists())
    

    After getting stuck on this error for a new project, talking to a new storage account (v2) - I've verified that the old storage type works fine with WindowsAzure.Storage - Using V2 throws a 400 bad request:

    The remote server returned an error: (400) Bad Request. Stack Trace: at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:line 604

    Does the File storage on StorageV2 not work with 9.3.1?



    • Edited by zxed-bl Wednesday, September 12, 2018 11:24 PM
    Wednesday, September 12, 2018 11:23 PM

All replies

  • @zxed-bl  Have you tried using Microsoft.WindowsAzure.Storage.File  ? The code example to check if a share exists: 

    [Microsoft.WindowsAzure.Storage.DoesServiceRequest]public virtual bool Exists (Microsoft.WindowsAzure.Storage.File.FileRequestOptions requestOptions = null, Microsoft.WindowsAzure.Storage.OperationContext operationContext = null);



    If the above still doesn't work with Storage V2, could you try the below : Would it be possible to enable client logging on your side using the following documentation :https://docs.microsoft.com/en-us/rest/api/storageservices/client-side-logging-with-the-.net-storage-client-library  Then share with us if you discover any additional issues. This would allow us to get additional verbose logs which could include what's causing the 400 error. 


    Friday, September 14, 2018 10:29 PM
  • Checking in to see if the above suggestions helped or you need further assistance on this issue. If that answers your query, do click “Mark as Answer” and Up-Vote for the same.
    Monday, September 17, 2018 11:02 AM
  • Can I ask a reverse question? - Has anyone tried using the SDK samples with a storage V2 file share?

    You've asked me if I tried using the .Exists - In my question, with the code sample, isnt that what I am referencing where I see the exception being thrown?

    • Edited by zxed-bl Tuesday, September 18, 2018 1:21 PM
    Tuesday, September 18, 2018 1:16 PM
  • Microsoft.WindowsAzure.Storage Information: 3 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: Starting operation with location Primary per location mode PrimaryOnly.
        DateTime=2018-09-18T13:25:22.0891554Z
    Microsoft.WindowsAzure.Storage Information: 3 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: Starting synchronous request to https://REDACTED.file.core.windows.net/logs.
        DateTime=2018-09-18T13:25:22.0991464Z
    Microsoft.WindowsAzure.Storage Verbose: 4 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: StringToSign = HEAD............x-ms-client-request-id:a301b4de-bbf7-452e-a4df-04d61b3a07c1.x-ms-date:Tue, 18 Sep 2018 13:25:22 GMT.x-ms-version:2018-03-28./REDACTED/logs.restype:share.
        DateTime=2018-09-18T13:25:22.1580915Z
    Microsoft.WindowsAzure.Storage Information: 3 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: Waiting for response.
        DateTime=2018-09-18T13:25:22.1610899Z
    Microsoft.WindowsAzure.Storage Warning: 2 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: Exception thrown while waiting for response: The remote server returned an error: (400) Bad Request..
        DateTime=2018-09-18T13:25:22.8294724Z
    Microsoft.WindowsAzure.Storage Information: 3 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: Response received. Status code = 400, Request ID = a8fcdbad-601a-002d-5953-4f1de4000000, Content-MD5 = , ETag = .
        DateTime=2018-09-18T13:25:22.8344697Z
    Microsoft.WindowsAzure.Storage Warning: 2 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: Exception thrown during the operation: The remote server returned an error: (400) Bad Request..
        DateTime=2018-09-18T13:25:22.8364667Z
    Microsoft.WindowsAzure.Storage Information: 3 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: Checking if the operation should be retried. Retry count = 0, HTTP status code = 400, Retryable exception = yes, Exception = The remote server returned an error: (400) Bad Request..
        DateTime=2018-09-18T13:25:22.8384651Z
    Microsoft.WindowsAzure.Storage Information: 3 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: The next location has been set to Primary, based on the location mode.
        DateTime=2018-09-18T13:25:22.8384651Z
    Microsoft.WindowsAzure.Storage Error: 1 : a301b4de-bbf7-452e-a4df-04d61b3a07c1: Retry policy did not allow for a retry. Failing with The remote server returned an error: (400) Bad Request..
        DateTime=2018-09-18T13:25:22.8414613Z
    


    • Edited by zxed-bl Tuesday, September 18, 2018 1:30 PM
    Tuesday, September 18, 2018 1:29 PM