Azure java: SAS identifier cannot be found for specified signed identifier
<p>I'm using the SDK for java to crear a SAS to access a blob.
This is the code:</p>

<pre><code>SharedAccessBlobPolicy policy = new SharedAccessBlobPolicy();
policy.setPermissionsFromString("r");
Calendar date = Calendar.getInstance();
Date expire = new Date(date.getTimeInMillis() + (expirationMinutes * 60000));
Date start = new Date(date.getTimeInMillis());
policy.setSharedAccessExpiryTime(expire);
policy.setSharedAccessStartTime(start);
return blob.getUri().toString()+"?"+blob.generateSharedAccessSignature(policy, externalFileName);
</code></pre>

<p>But when I try to use the url to access the blob I get this error:</p>

<pre><code>&lt;Error&gt;
&lt;Code&gt;AuthenticationFailed&lt;/Code&gt;
&lt;Message&gt;
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:f1f169d2-0001-003f-115a-3be1d6000000 Time:2016-11-10T13:57:14.6192554Z
&lt;/Message&gt;
&lt;AuthenticationErrorDetail&gt;
SAS identifier cannot be found for specified signed identifier
&lt;/AuthenticationErrorDetail&gt;
&lt;/Error&gt;
</code></pre>

<p>I'm doing the same thing in NET for the same blob an the resulting url (which works) is different that the one I get here:</p>

<p>Doesn't work (java):</p>

<pre><code>/mycontainer/privadoPrueba/cat1.jpg?sig=FFLVk%2FPViHBZhH1JIW6wBbWiJ0%2Bgz0U8wjFzgRoytNo%3D&amp;st=2016-11-10T13%3A55%3A06Z&amp;se=2016-11-10T14%3A06%3A06Z&amp;sv=2015-07-08&amp;si=privadoPrueba%2Fcat1.jpg&amp;sp=r&amp;sr=b
</code></pre>

<p>Works (NET):</p>

<pre><code>/mycontainer/privadoPrueba/cat1.jpg?sv=2015-07-08&amp;sr=b&amp;sig=WyiJWltZFj1AkkzST6mo2NjBF1tRSXxrkMP5LEAGJNk%3D&amp;st=2016-11-10T14%3A05%3A41Z&amp;se=2016-11-10T14%3A16%3A41Z&amp;sp=r
</code></pre>

<p>How could I fix this?</p>