Sunday, 23 November 2014

MUGH November 2014 Dev Day

MUGH November 2014 Dev Day

Microsoft User Group Hyderabad

Saturday, November 29, 2014 at 9:00 AM (IST)

Microsoft User Group Hyderabad invites you to November 2014 Developer Day on 29th Nov'14.

09:00 AM - 09:50 AM Registration
10:00 AM - 11:00 AM A lap around C# 6.0 and Visual Studio 2015 Preview

Abhijit Jana, Microsoft
11:00 AM - 12:00 PM JavaScript Unit Testing

Shravan Kasagoni, Pramati Technologies
12:00 PM - 12:10 PM Break
12:10 PM - 01:10 PM Leap ahead with Windows 10

Akshay Dixit, Microsoft

Hyderabad, India


Event Details



Tuesday, 18 November 2014

exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occured in Microsoft.WindowsAzure.Storage.dll

exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occured in Microsoft.WindowsAzure.Storage.dll

Additional information: The remote server returned an error: (400) Bad Request.

This kind of exception will come while creation of Container, the container name should be lowercase letters and numbers from 3-24 length.

Container creation in Azure Storage

Every blob in the AzureStorage must reside in the Container.
Today i would like the simple way of creation of Containers from c#.Net, We can also create containers from Azure Management portal.

We need to configure Storage account connection String that i explained my earlier post

Configuring Azure Connection string using .Net Application

Next we need to add namespace declaration in the top of c# programming file, for accessing Azure Storage.

make sure we need to add reference the Microsoft.windowsAzure.Storage.dll

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;

// Retrieve storage account from connection string.           
 CloudStorageAccount storageAccount = CloudStorageAccount.Parse( 
 // Create the blob client.
  CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

// Retrieve a reference to a container.
  CloudBlobContainer container = blobClient.GetContainerReference("MyPictures");

 // Create the container if it doesn't already exist.

By default containers are private in, we can also give the permissions for downloading the blobs.

Monday, 17 November 2014

Configuring Azure Connection string using .Net Application

Hi Folks, Today i will explain about how to configure Azure Connection strings from .NET Application.

There are two ways we can configure from connection string from Azure Cloud service application and  from .NET application.

If your application runs on Azure Virtual Machines or If you are building .NET applications that will run outside azure save your connection String in Web.config OR app.config files.


If your application runs in Azure cloud service you can save the connection string in Azure service configuration system(like *.cscfg nd csdef files).

<add key="StorageConnectionString" value="DefaultEndpointsProtocol=[https/http];AccountName=storageAccount-name;AccountKey=StorageAccount-key" />

DefaultEndPointsProtocaol will be either https or http.

replace the AccountName with your storage account Name.

accountKey will your storageAccount primary or secondary Access Key.

you will find these values from Azure Management Portal --> Storage.

Select your storage and at the bottom Navigational panel you will see the Manage Access Keys

Then it will populate the Manage Access keys Window.