Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Windows Azure Storage Client 3.0.1 #9

Merged
3 commits merged into from
Dec 10, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions BreakingChanges.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
Tracking changes for all breaks since 2.0

- Auth Handlers were delay populated in 2.0. They are now going to be populated in the client constructors. They are internally settable. So Test can change it.
Tracking Breaking Changes since 2.0

- maxResults while listing queues in nullable now.

- Table now allows query execution with a resolver against non generic query types(Dynamic Entity types).
- The BlobTypeMismatch and ExtendedErrorUnavailable error strings have changed in SR.cs.

- Container, Blob, Directory, Queue and Table names are now validated at the client side.
- OperationContext.RequestResults does not expose a setter anymore.

- Table now does SAS similar to queues and containers.
- Renamed CloudQueue.EndBeginClear(IAsyncResult) to CloudQueue.EndClear(IAsyncResult).

- All header, query and generic constants are public now so people can use it when they use protocol layer.
- StreamExtensions.WriteToSync<T>(Stream, Stream, long?, long? bool, bool, ExecutionState<T>, StreamDescriptor) now throws InvalidOperationException(SR.StreamLengthError) instead of ArgumentOutOfRangeException("stream").

- There is now a way users can update their sastoken. This is provided by the StorageCredentials class' updateSas method.
- StreamExtensions.WriteToAsync<T>(stream, Stream, long?, long?, bool, ExecutionState<T>, StreamDescriptor, CancellationToken token) now throws InvalidOperationException(SR.StreamLengthError) instead of ArgumentOutOfRangeException("stream").

- Users now have an API that takes only the key value when they want to update their key.
- The StorageException thrown when an operation is cancelled now includes an OperationCanceledException as its inner exception.

- Cloud*Blob now has BeginOpenRead and EndOpenRead methods to asynchronously open a stream to read from the blob.
Tracking Breaking Changes since 2.1 RTM

- The BlobTypeMismatch and ExtendedErrorUnavailable error strings have changed in SR.cs.
- When DataServiceContext is used to execute table operations, response received event on OperationContext is no longer fired.

- OperationContext.RequestResults does not have a setter anymore.
- ContinuationTokens are written with an additional <ContinuationToken> element enclosing them if WriteXml() method is used - ReadXml() parser is updated to handle this.

- Renamed CloudQueue.EndBeginClear(IAsyncResult) to CloudQueue.EndClear(IAsyncResult).
- Only the ServiceProperties that are provided are changed. In previous REST versions ommitting a properties section such as Metrics would result in those settings being removed by the service.

- StreamExtensions.WriteToSync<T>(Stream, Stream, long?, long? bool, bool, ExecutionState<T>, StreamDescriptor) now throws InvalidOperationException(SR.StreamLengthError) instead of ArgumentOutOfRangeException("stream").
- Please refer to the blog post about Breaking Changes on the server side in the new storage protocol version(2013-08-15) here:
http://blogs.msdn.com/b/windowsazurestorage/archive/2013/11/23/windows-azure-storage-breaking-changes-for-windows-azure-tables-november-2013.aspx.

- StreamExtensions.WriteToAsync<T>(stream, Stream, long?, long?, bool, ExecutionState<T>, StreamDescriptor, CancellationToken token) now throws InvalidOperationException(SR.StreamLengthError) instead of ArgumentOutOfRangeException("stream").
Additionally, the following error messages have changed in the Table Service:

- The StorageException thrown when an operation is cancelled now includes an OperationCanceledException as its inner exception.
Entity over 1MB �

Tracking changes for all breaks since 2.1 RTM
Error message previously - The entity is larger than allowed by the Table Service.
Error message now - The entity is larger than the maximum allowed size (1MB).

- When DataServiceContext is used to execute table operations, response received event on OperationContext is no longer fired.
Batch over 4MB -

Error message previously - The content length for the requested operation has exceeded the limit.
Error message now - The content length for the requested operation has exceeded the limit (4MB).

Property name over 255 chars �

- ContinuationTokens are written with an additional <ContinuationToken> element enclosing them if WriteXml() method is used - ReadXml() parser is updated to handle this, but anyone parsing their own could be affected
Error message previously � The property name exceeds the maximum allowed length.
Error message now - The property name exceeds the maximum allowed length (255).

- Only the ServiceProperties that are uploaded are changed. For example, if the user wants to just set CORS, the Logging and Metering related settings elements can be omitted and the omitted settings will be remain unchanged.
25 changes: 19 additions & 6 deletions Lib/ClassLibraryCommon/Blob/CloudBlobContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,7 @@ internal RESTCommand<string> AcquireLeaseImpl(TimeSpan? leaseTime, string propos
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.Created, resp, null /* retVal */, cmd, ex);
this.UpdateETagAndLastModified(resp);
return BlobHttpResponseParsers.GetLeaseId(resp);
};

Expand All @@ -2420,7 +2421,12 @@ internal RESTCommand<NullType> RenewLeaseImpl(AccessCondition accessCondition, B
options.ApplyToStorageCommand(putCmd);
putCmd.BuildRequestDelegate = (uri, builder, serverTimeout, ctx) => ContainerHttpWebRequestFactory.Lease(uri, serverTimeout, LeaseAction.Renew, null /* proposedLeaseId */, null /* leaseDuration */, null /* leaseBreakPeriod */, accessCondition, ctx);
putCmd.SignRequest = this.ServiceClient.AuthenticationHandler.SignRequest;
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
this.UpdateETagAndLastModified(resp);
return NullType.Value;
};

return putCmd;
}
Expand Down Expand Up @@ -2449,6 +2455,7 @@ internal RESTCommand<string> ChangeLeaseImpl(string proposedLeaseId, AccessCondi
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, null /* retVal */, cmd, ex);
this.UpdateETagAndLastModified(resp);
return BlobHttpResponseParsers.GetLeaseId(resp);
};

Expand All @@ -2475,7 +2482,12 @@ internal RESTCommand<NullType> ReleaseLeaseImpl(AccessCondition accessCondition,
options.ApplyToStorageCommand(putCmd);
putCmd.BuildRequestDelegate = (uri, builder, serverTimeout, ctx) => ContainerHttpWebRequestFactory.Lease(uri, serverTimeout, LeaseAction.Release, null /* proposedLeaseId */, null /* leaseDuration */, null /* leaseBreakPeriod */, accessCondition, ctx);
putCmd.SignRequest = this.ServiceClient.AuthenticationHandler.SignRequest;
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
this.UpdateETagAndLastModified(resp);
return NullType.Value;
};

return putCmd;
}
Expand Down Expand Up @@ -2505,6 +2517,7 @@ internal RESTCommand<TimeSpan> BreakLeaseImpl(TimeSpan? breakPeriod, AccessCondi
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.Accepted, resp, TimeSpan.Zero, cmd, ex);
this.UpdateETagAndLastModified(resp);

int? remainingLeaseTime = BlobHttpResponseParsers.GetRemainingLeaseTime(resp);
if (!remainingLeaseTime.HasValue)
Expand Down Expand Up @@ -2634,7 +2647,7 @@ private RESTCommand<NullType> SetMetadataImpl(AccessCondition accessCondition, B
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
this.ParseSizeAndLastModified(resp);
this.UpdateETagAndLastModified(resp);
return NullType.Value;
};

Expand Down Expand Up @@ -2664,7 +2677,7 @@ private RESTCommand<NullType> SetPermissionsImpl(BlobContainerPermissions acl, A
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
this.ParseSizeAndLastModified(resp);
this.UpdateETagAndLastModified(resp);
return NullType.Value;
};

Expand Down Expand Up @@ -2700,7 +2713,7 @@ private RESTCommand<BlobContainerPermissions> GetPermissionsImpl(AccessCondition
getCmd.PostProcessResponse = (cmd, resp, ctx) =>
{
ContainerHttpResponseParsers.ReadSharedAccessIdentifiers(cmd.ResponseStream, containerAcl);
this.ParseSizeAndLastModified(resp);
this.UpdateETagAndLastModified(resp);
return containerAcl;
};

Expand Down Expand Up @@ -2802,7 +2815,7 @@ private RESTCommand<ResultSegment<IListBlobItem>> ListBlobsImpl(string prefix, i
/// Retrieve ETag and LastModified date time from response.
/// </summary>
/// <param name="response">The response to parse.</param>
private void ParseSizeAndLastModified(HttpWebResponse response)
private void UpdateETagAndLastModified(HttpWebResponse response)
{
BlobContainerProperties parsedProperties = ContainerHttpResponseParsers.GetProperties(response);
this.Properties.ETag = parsedProperties.ETag;
Expand Down
17 changes: 15 additions & 2 deletions Lib/ClassLibraryCommon/Blob/CloudBlobSharedImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ internal static RESTCommand<string> AcquireLeaseImpl(ICloudBlob blob, BlobAttrib
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.Created, resp, null, cmd, ex);
CloudBlobSharedImpl.UpdateETagLMTAndSequenceNumber(attributes, resp);
return BlobHttpResponseParsers.GetLeaseId(resp);
};

Expand Down Expand Up @@ -359,7 +360,12 @@ internal static RESTCommand<NullType> RenewLeaseImpl(ICloudBlob blob, BlobAttrib
options.ApplyToStorageCommand(putCmd);
putCmd.BuildRequestDelegate = (uri, builder, serverTimeout, ctx) => BlobHttpWebRequestFactory.Lease(uri, serverTimeout, LeaseAction.Renew, null /* proposedLeaseId */, null /* leaseDuration */, null /* leaseBreakPeriod */, accessCondition, ctx);
putCmd.SignRequest = blob.ServiceClient.AuthenticationHandler.SignRequest;
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
CloudBlobSharedImpl.UpdateETagLMTAndSequenceNumber(attributes, resp);
return NullType.Value;
};

return putCmd;
}
Expand Down Expand Up @@ -393,6 +399,7 @@ internal static RESTCommand<string> ChangeLeaseImpl(ICloudBlob blob, BlobAttribu
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, null /* retVal */, cmd, ex);
CloudBlobSharedImpl.UpdateETagLMTAndSequenceNumber(attributes, resp);
return BlobHttpResponseParsers.GetLeaseId(resp);
};

Expand Down Expand Up @@ -423,7 +430,12 @@ internal static RESTCommand<NullType> ReleaseLeaseImpl(ICloudBlob blob, BlobAttr
options.ApplyToStorageCommand(putCmd);
putCmd.BuildRequestDelegate = (uri, builder, serverTimeout, ctx) => BlobHttpWebRequestFactory.Lease(uri, serverTimeout, LeaseAction.Release, null /* proposedLeaseId */, null /* leaseDuration */, null /* leaseBreakPeriod */, accessCondition, ctx);
putCmd.SignRequest = blob.ServiceClient.AuthenticationHandler.SignRequest;
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, NullType.Value, cmd, ex);
CloudBlobSharedImpl.UpdateETagLMTAndSequenceNumber(attributes, resp);
return NullType.Value;
};

return putCmd;
}
Expand Down Expand Up @@ -457,6 +469,7 @@ internal static RESTCommand<TimeSpan> BreakLeaseImpl(ICloudBlob blob, BlobAttrib
putCmd.PreProcessResponse = (cmd, resp, ex, ctx) =>
{
HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.Accepted, resp, TimeSpan.Zero, cmd, ex);
CloudBlobSharedImpl.UpdateETagLMTAndSequenceNumber(attributes, resp);

int? remainingLeaseTime = BlobHttpResponseParsers.GetRemainingLeaseTime(resp);
if (!remainingLeaseTime.HasValue)
Expand Down
10 changes: 10 additions & 0 deletions Lib/ClassLibraryCommon/Shared/Protocol/HttpWebRequestFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ internal static HttpWebRequest GetAcl(Uri uri, UriQueryBuilder builder, int? tim
builder.Add(Constants.QueryConstants.Component, "acl");

HttpWebRequest request = CreateWebRequest(WebRequestMethods.Http.Get, uri, timeout, builder, operationContext);

// Windows phone adds */* as the Accept type when we don't set one explicitly.
#if WINDOWS_PHONE
request.Accept = Constants.XMLAcceptHeaderValue;
#endif
return request;
}

Expand All @@ -140,6 +145,11 @@ internal static HttpWebRequest SetAcl(Uri uri, UriQueryBuilder builder, int? tim
builder.Add(Constants.QueryConstants.Component, "acl");

HttpWebRequest request = CreateWebRequest(WebRequestMethods.Http.Put, uri, timeout, builder, operationContext);

// Windows phone adds */* as the Accept type when we don't set one explicitly.
#if WINDOWS_PHONE
request.Accept = Constants.XMLAcceptHeaderValue;
#endif
return request;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private static void ReadQueryResponseUsingJsonParser<TElement>(ResultSegment<TEl
{
reader.DateParseHandling = DateParseHandling.None;
JObject dataSet = JObject.Load(reader);
JArray dataTable = (JArray)dataSet["value"];
JToken dataTable = dataSet["value"];

foreach (JToken token in dataTable)
{
Expand Down
7 changes: 6 additions & 1 deletion Lib/Common/Shared/Protocol/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,11 @@ static class Constants
/// </summary>
internal const string DefaultTableName = "TableName";

/// <summary>
/// Header value to set Accept to XML.
/// </summary>
internal const string XMLAcceptHeaderValue = "application/xml";

/// <summary>
/// Header value to set Accept to AtomPub.
/// </summary>
Expand Down Expand Up @@ -704,7 +709,7 @@ static HeaderConstants()
/// <summary>
/// Specifies the value to use for UserAgent header.
/// </summary>
public const string UserAgentProductVersion = "3.0.0";
public const string UserAgentProductVersion = "3.0.1";

/// <summary>
/// Master Windows Azure Storage header prefix.
Expand Down
4 changes: 2 additions & 2 deletions Lib/WindowsAzure.Storage-Preview.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package >
<metadata>
<id>WindowsAzure.Storage-Preview</id>
<version>3.0.0.0-preview</version>
<version>3.0.1.0-preview</version>
<title>Windows Azure Storage</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
Expand All @@ -11,7 +11,7 @@
<iconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This client library enables working with the Windows Azure storage services which include the blob service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client.
For this release see notes - https://github.com/WindowsAzure/azure-sdk-for-net/blob/preview/microsoft-azure-api/Services/Storage/changelog.txt
For this release see notes - https://github.com/WindowsAzure/azure-storage-net/blob/master/README.md and https://github.com/WindowsAzure/azure-storage-net/blob/master/changelog.txt
Windows Azure Storage team's blog - http://blogs.msdn.com/b/windowsazurestorage/</description>
<summary>A client library for Windows Phone and Windows Runtime for working with Windows Azure storage services including blobs, tables, and queues.</summary>
<tags>Microsoft, Azure, Storage, Table, Blob, Queue, Scalable, winrt, windowsphone, windowsazureofficial</tags>
Expand Down
4 changes: 2 additions & 2 deletions Lib/WindowsDesktop/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyVersion("3.0.1.0")]
[assembly: AssemblyFileVersion("3.0.1.0")]

#if SIGN
[assembly: InternalsVisibleTo(
Expand Down
5 changes: 3 additions & 2 deletions Lib/WindowsDesktop/WindowsAzure.Storage.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>WindowsAzure.Storage</id>
<version>3.0.0.0</version>
<version>3.0.1.0</version>
<title>Windows Azure Storage</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
Expand All @@ -11,13 +11,14 @@
<iconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>This client library enables working with the Windows Azure storage services which include the blob service for storing binary and text data, the table service for storing structured non-relational data, and the queue service for storing messages that may be accessed by a client.
For this release see notes - http://msdn.microsoft.com/en-us/library/windowsazure/jj721952.aspx
For this release see notes - https://github.com/WindowsAzure/azure-storage-net/blob/master/README.md and https://github.com/WindowsAzure/azure-storage-net/blob/master/changelog.txt
Windows Azure Storage team's blog - http://blogs.msdn.com/b/windowsazurestorage/</description>
<summary>A client library for working with Windows Azure storage services including blobs, tables, and queues.</summary>
<tags>Microsoft, Azure, Storage, Table, Blob, Queue, Scalable, windowsazureofficial</tags>
<dependencies>
<dependency id="Microsoft.Data.OData" version="5.6.0" />
<dependency id="Newtonsoft.Json" version="5.0.6" />
<dependency id="Microsoft.Data.Services.Client" version="5.6.0" />
<dependency id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" />
</dependencies>
<frameworkAssemblies>
Expand Down
4 changes: 2 additions & 2 deletions Lib/WindowsPhone/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyVersion("3.0.1.0")]
[assembly: AssemblyFileVersion("3.0.1.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]

#if SIGN
Expand Down
Loading