3
votes

We are looking to deploy our Azure cloud services to multiple subscriptions but want to be able to be able to access the same Storage accounts for storing blobs and tables. Wanted to know if it is possible to access storage accounts from across different subscriptions using just the storage account name and key? Our data connection takes the form

Trying to use the above and it always try to find end point for given accountname within the current subscription

1
I think you missed something in your question. A screenshot may be?Gaurav Mantri

1 Answers

2
votes

If i understood your question...

able to access the same Storage accounts

  • Via Azure Panel (Management Portal) : you can access the storage account only in the subscription.
  • Via Visual Studio: you can attach storage account outside your current login account in visual studio <-> azure with account name and key (and manage it) enter image description here
  • Via Code: You can access storage account (blob, queue, table) from all your apps with storage connection strings (don't put it in code)

If you want, you can restrict blob access with CORS settings. Something like this :

  private static void InitializeCors()
    {
        ServiceProperties blobServiceProperties = blobClient.GetServiceProperties();

        //Attiva e Configura CORS
        ConfigureCors(blobServiceProperties);

        //Setta
        blobClient.SetServiceProperties(blobServiceProperties);
    }

    private static void ConfigureCors(ServiceProperties prop)
    {
        var cors = new CorsRule();
        cors.AllowedOrigins.Add("www.domain1.net, www.domain2.it");
        prop.Cors.CorsRules.Add(cors);
    }