Banner.jpg .
-
Upload
godwin-hector-ellis -
Category
Documents
-
view
220 -
download
0
Transcript of Banner.jpg .
![Page 1: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/1.jpg)
Using Windows Azure Blob Storage with SharePoint 2010Speaker Name
![Page 2: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/2.jpg)
Outline
Windows Azure Data StorageBlob Data ModelBlob REST interfaceBlob TypesAccess ControlIntegrating Azure Blobs and SharePoint 2010
![Page 3: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/3.jpg)
Windows Azure Data Storage
Windows Azure BlobThe focus of this presentation
Windows Azure TableWindows Azure Queue
![Page 4: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/4.jpg)
Blob Data Model
Account Container Blob
My Account
Images
Videos
Img1.jpg
Img2.jpg
Mov1.avi
![Page 5: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/5.jpg)
Blob REST Interface
Blob storage can be accessed through a RESTful interfaceHTTPS PUT, GET, and DELETE operationsOperations abstracted into an API
http://fabrikamlegal.blob.core.windows.net/imagefiles?resttype=container&comp=list
<?xml version="1.0" encoding="utf-8" ?> <EnumerationResults ContainerName="http://fabrikamlegal.blob.core.windows.net/imagefiles"> <Blobs> <Blob> <Name>Banner.jpg</Name> <Url>http://fabrikamlegal.blob.core.windows.net/imagefiles/Banner.jpg</Url> </Blob> <Blob> <Name>Boy_And_Gift.png</Name> …
![Page 6: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/6.jpg)
Blob REST API – Creating Containers
API is a wrapper around RESTful serviceMakes it easy to call operations
CloudStorageAccount acct = CloudStorageAccount.FromConfigurationSetting( "DataConnectionString");
CloudBlobClient client = acct.CreateCloudBlobClient();CloudBlobContainer con = client.GetContainerReference("videofiles");con.CreateIfNotExist();
![Page 7: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/7.jpg)
Blob REST API – Writing a Blob
FileStream fs = new FileStream("mov1.avi",…,…,…);
var blob = con.GetBlobReference("mov1.avi");blob.UploadFromStream(fs);blob.Metadata["VideoName"] = "Wildlife.avi";blob.Metadata["Category"] = "Travel";blob.Metadata["DateSubmitted"] = DateTime.Now;blob.SetMetadata();blob.Properties.ContentType = "video/x-msvideo";blob.SetProperties();
![Page 8: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/8.jpg)
Blob REST API – Reading Blobsvar azureBlobs = con.ListBlobs();var listOfBlobs = new List<VideoBlobStorage>();foreach (var blobItem in azureBlobs){ var azureBlobRecord = con.GetBlobReference(blobItem.Uri.ToString()); azureBlobRecord.FetchAttributes(); listOfBlobs (new VideoBlobStorage() { FileUri = blobItem.Uri, VideoName = azureBlobRecord.Metadata["VideoName"], Category = azureBlobRecord.Metadata["Category"], DateSubmitted = azureBlobRecord.Metadata["DateSubmitted"] });}
![Page 9: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/9.jpg)
Managing Blob StorageManaging Blob Storage
Demo
![Page 10: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/10.jpg)
Blob Types
Block BlobsBlobs made up of individual “blocks”Optimized for steamingEach block can be 4MB in sizeTotal Blob can be 200 GB in size
Page BlobsBlobs made up of a collection of “pages”Optimized for random read/write operationsPage is a range of data similar to a bufferTotal Blob can be 1 TB in size
![Page 11: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/11.jpg)
Blob Access Control
Public Access ControlAllows unrestricted accessNote that cross-domain calls may still fail
Shared Access SignaturesUses an authentication token valid for a period of timeSignature is appended to URL as query string
Container-Level Access PoliciesAllows the definition of a named access policyPolicy uses Shared Access Signatures
![Page 12: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/12.jpg)
Public Access Control
azureBlobPermissions = new BlobContainerPermissions();azureBlobPermissions.PublicAccess = BlobContainerPublicAccessType.Container;cont.SetPermissions(azureBlobPermissions);
![Page 13: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/13.jpg)
Shared Access Signatures
SharedAccessPolicy policy = new SharedAccessPolicy();policy.Permissions = SharedAccessPermissions.Read;policy.SharedAccessStartTime = DateTime.UtcNow.AddMinutes(-10);policy.SharedAccessExpiryTime = DateTime.UtcNow.AddMinutes(60);String signature = blob.GetSharedAccessSignature(policy);
![Page 14: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/14.jpg)
Container-Level Access Policies
SharedAccessPolicy policy = new SharedAccessPolicy();policy.Permissions = SharedAccessPermissions.Read;policy.SharedAccessStartTime = DateTime.UtcNow.AddMinutes(-10);policy.SharedAccessExpiryTime = DateTime.UtcNow.AddMinutes(60);String signature = blob.GetSharedAccessSignature(policy);
azureBlobPermissions = new BlobContainerPermissions();azureBlobPermissions.SharedAccessPolicies.Add("policy1“, policy);cont.SetPermissions(azureBlobPermissions);
![Page 15: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/15.jpg)
Azure Storage ExplorerAzure Storage Explorer
Demo
![Page 16: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/16.jpg)
Integrating with SharePoint 2010
IFrameIntegrate web roles that use the REST APISimple, but not robust
Silverlight Media Player directly accessing public blobsWCF Web Role Proxy
RESTful interface to blob storage does not support cross-domain callsCreate a simple WCF Web Role to act as proxyHttpWebRequest, WebClient classes
Custom web partsSilverlight applications
![Page 17: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/17.jpg)
WCF Web Role Proxy
Cross Domain CallsNot allowed unless service has ClientAccessPolicy.xml fileAzure does not support uploading this fileCreate WCF Web Role and include ClientAccessPolicy.xml
[ServiceContract] public interface IService1 { [OperationContract] [WebGet(UriTemplate = "{Container}")] Stream BlobInfo(string Container); }
![Page 18: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/18.jpg)
SharePoint 2010 IntegrationSharePoint 2010 Integration
Demo
![Page 19: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/19.jpg)
Summary
Windows Azure Data StorageBlob Data ModelBlob REST interfaceBlob TypesAccess ControlIntegrating Azure Blobs and SharePoint 2010
![Page 20: Banner.jpg .](https://reader036.fdocuments.in/reader036/viewer/2022062407/56649e655503460f94b6018b/html5/thumbnails/20.jpg)
Call to ActionFor Download
Download SharePoint VMhttp://www.microsoft.com/downloads/details.aspx?familyid=751FA0D1-356C-4002-9C60-D539896C66CE&displaylang=en
Download Azure Developer Centerhttp://msdn.microsoft.com/en-us/azure/default.aspx
Windows Azure SDK and Windows Azure Tools for Microsoft Visual Studio (November 2010)
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7a1089b6-4050-4307-86c4-9dadaa5ed018&displaylang=en
For ReferenceChannel 9 SharePoint Developer Training Kit
http://channel9.msdn.com/learn/courses/SharePoint2010Developer/
Channel 9 Azure Developer Training Kithttp://channel9.msdn.com/learn/courses/Azure/