Azure: November SDK Relase
Dopo le modifiche che avevo segnalato per Service Bus e Access Control Service, ecco le aggiunte/modifiche all’SDK di Windows Azure.
What's new for the November release:
- Service Model UI: A redesigned and significantly more complete interface for manipulating Role configuration information. To access, double-click on a role node in the Solution Explorer.
- Additional role templates: Support for ASP.NET MVC 2 (2010 only), F# worker roles (2010 only), and WCF Service Application web roles.
- Support for dynamically creating tables: The Create Tables functionality is now performed automatically; there is no longer a need to right-click and select Create Tables… on the project after your table definitions have changed.
- Full support for and installation of the November Windows Azure SDK release:
- The sample storage client has been replaced by a new production quality library.
- New Diagnostics library enables logging using .NET APIs and enables the collection of diagnostic information from the service.
- Service Runtime library updated to support inter-role communication and notification of configuration changes .
- Support for input endpoints on Worker Roles.
- Higher fidelity simulation of Development Storage: supports all current cloud storage features, including dynamically creating tables.
- Ability to choose the size of the VM for a role instance.
- Ability to persist data in local storage even after the role is recycled.
- Ability to manage certificates to install to the role VMs.
Updated and additional code samples are available online at: http://code.msdn.microsoft.com/windowsazuresamples
La libreria Storage Client è stata rilasciata ufficialmente come wrapper sopra le chiamate REST verso lo storage: questa è la buona notizia.
La cattiva (si fa per dire) è che è statao eseguito un pesante refactoring e quindi il codice (anche quello presentato settimana scorsa al seminario che ho tenuto in Microsoft) è ormai vecchio.
Ad esempio per aggiungere un blob al blob storage occorre passare da questo codice:
CloudStorageAccount account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
CloudBlobClient blobClient = account.CreateCloudBlobClient();
CloudBlobContainer blobContainer = blobClient.GetContainerReference("gallery");
blobContainer.GetBlobReference(Guid.NewGuid().ToString()).UploadFromStream(FileUpload1.FileContent);
L’esempio riprende il codice del capitolo 3 del mio libro e consente di salvare un nuovo blob di cui l’utente ha eseguito l’upload tramite il classico FileUpload di ASP.NET.
Come si può notare, anche rispetto al codice del libro, è cambiata anche la modalità di lettura del file di configurazione per quanto riguarda endpoint e shared key e di conseguenza anche il file di configurazione deve essere scritto in modo diverso. Vi rimando ai sample per “rubare” la nuova sintassi del .cscfg.
In pratica: la teoria che abbiamo affrontato fino ad oggi resta validissima, ma a 4 giorni dal rilascio ufficiale di Azure avvenuto oggi, dopo oltre un anno in cui il codice della prima CTP è rimasto pressochè identico…è stato rifattorizzato il tutto.
Una nota: per chi lavora con Java SDK o Ruby SDK, i nomi delle classi, per adesso sono rimaste invariate.