Getting the below error while making a call to Create Container.
Response Code : 403 Response Message : Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
String stringToSign = "PUT\n\n\n\n\n\n\n\n\n\n\n\nx-ms-date:" + date + "\nx-ms-version:" + "2018-03-28\nx-ms-lease-action:acquire\nx-ms-lease-duration:1\nx-ms-proposed-lease-id:1f812371-a41d-49e6-b123-f4b542e851c5\n" + "/" + storageAccount + "/"+ "container-lease-test"+"\ncomp:lease";
Java code snippet
HttpURLConnection connection = (HttpURLConnection)new URL(url).openConnection();
connection.setRequestMethod(vMethod);
connection.addRequestProperty("Authorization", authHeader);
connection.addRequestProperty("x-ms-date", date);
connection.addRequestProperty("x-ms-version", "2018-03-28");
connection.setDoOutput(true);
connection.setFixedLengthStreamingMode(0);
//Create Lease
connection.addRequestProperty("x-ms-lease-action", "acquire");
connection.addRequestProperty("x-ms-lease-duration","1");
connection.addRequestProperty("x-ms-proposed-lease-id","1f812371-a41d-49e6-b123-f4b542e851c5");