Zakos
Zakos

Reputation: 1510

Azure - many sites 1 service ( blob )

assuming I have 10 web sites & 1 blob(for images) site/cloud-service/wcf/whatever MS call it ,

How all 10 web sites , using this 1 blob service? For example I wanna each site to have admin page

to manage blob images ( crud ) ,

Make Azure-WCF-Blob service and each site will use it? How to secure it that only the 10 site can

have access ?

Other options?

( with 1 DB it no problem , only connection string... )

UPDATE :

I'll ask it more simple , 10 web sites , in each web site I don't wanna duplicate 10 times the code for Container operations , how I create 1 blob service/site/what's the best option here/ and then reuse it in each site ? each site will have a siteName/Admin controller , which can manage the container/blob

Upvotes: 0

Views: 83

Answers (2)

user94559
user94559

Reputation: 60143

I'm not sure I fully understood the question, but based on the sentence "With 1 DB it's no problem, only connection string," I think what you're missing is that Windows Azure storage works the same way. You create a storage account, and from that you have an account name and key. In .NET, you even construct it as a connection string, so from all your websites, you would do:

var blobs = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=abcd1234...").CreateCloudBlobClient();
// do stuff with blobs here

As long as you use the same connection string, all your websites will be using the same storage.

Upvotes: 1

Sandrino Di Mattia
Sandrino Di Mattia

Reputation: 24895

Ok so you're talking about blob storage. And if I understand your question, it looks like you want to make sure a website cannot access data (images) of an other website. In that case you have a few options:

  1. 1 website = 1 storage account. In Windows Azure you can create multiple storage accounts. These storage accounts will each have their own keys in order to get access to them. If you create a storage account per website it will be very easy to restrict access to those storage accounts.
  2. You can have a single storage account with multiple containers. On each container you can add a SharedAccessBlobPolicy to control access to a container without any time constraints, but you'll need the new "unreleased" version of the SDK to do this. This will allow your websites to access a specific container by using SAS signatures (this access can be revoked at any time).
  3. Build something yourself with a WCF services, but this could be more work.

Upvotes: 1

Related Questions