Skip to content

Azure Blob Storage Photo Gallery Web Application using ASP.NET MVC 5. The sample uses the .NET 4.5 asynchronous programming model to demonstrate how to call the Storage Service using the Storage .NET client library's asynchronous APIs.

License

Notifications You must be signed in to change notification settings

tzhanl/storage-blobs-dotnet-webapp

 
 

Repository files navigation

languages products page_type
csharp
azure
azure-storage
sample

.NET Photo Gallery Web Application Sample with Azure Blob Storage

This sample application creates a web photo gallery that allows you to host and view images through a .NET web frontend. The code sample also includes functionality for deleting images. At the end, you have the option of deploying the application to Azure.

Azure Blob Storage Photo Gallery Web Application Sample .NET

Azure SDK Versions

To use the latest Azure SDK version WebApp-Storage-DotNet-v3, please add the following dependency:

For the previous Azure SDK version WebApp-Storage-DotNet-v12, please add the following dependency:

Technologies used

  • ASP.NET MVC 5
  • Azure Storage emulator
  • Azure Web Apps
  • Azure Storage

Azure Blob Storage Photo Gallery Web Application using ASP.NET MVC 5. The sample uses asynchronous programming model to demonstrate how to call the Storage Service using the Storage .NET client library's asynchronous APIs.

Running this sample

  1. Before you can run this sample, you must have the following prerequisites:

  2. Open the Azure Storage Emulator. Once the emulator is running it will be able to process the images from the application.

  3. Clone this repository using Git :

    git clone https://github.com/tzhanl/storage-blobs-dotnet-webapp.git
  4. Switch to the appropriate folder. Navigate to your directory where the project file (.csproj) resides and open it with Visual Studio.

  5. In Visual Studio Build menu, select Build Solution (or Press F6).

  6. You can now run and debug the application locally by pressing F5 in Visual Studio.

Deploy this sample to Azure

  1. To make the sample work in the cloud, you must replace the connection string with the values of an active Azure Storage Account. If you don't have an account, refer to the Create a Storage Account article.

  2. Click Storage Account in the Azure Portal to open it. Select Settings > Access keys > Key1/key, copy the associated Connection string to the clipboard, then paste it into a text editor for later use.

  3. In the Web.config file, located in the project root, find the StorageConnectionString app setting and replace the placeholder values with the values obtained for your account.

    <add key="StorageConnectionString" value="[Enter Your Storage Connection string]" />
    
  4. In Visual Studio Solution Explorer, right-click on the project name and select Publish...

  5. Using the Publish Website dialog, select Microsoft Azure Web Apps

  6. In the next dialog, either select an existing web app, or follow the prompts to create a new web application. Note: If you choose to create a web application, the Web App Name chosen must be globally unique.

  7. Once you have selected the web app, click Publish

  8. After a short time, Visual Studio will complete the deployment and open a browser with your deployed application.

For additional ways to deploy this web application to Azure, please refer to the Deploy a web app in Azure App Service article which includes information on using Azure Resource Manager (ARM) Templates, Git, MsBuild, PowerShell, Web Deploy, and many more.

This Sample shows how to do some basic operations of Storage Blobs.

  • Create a container.
  • Upload images to storage blob.
  • List block blobs.
  • Delete blobs.

About the code

The code included in this sample is meant to be a quick start sample for learning about Azure Web Apps and Azure Storage. It is not intended to be a set of best practices on how to build scalable enterprise grade web applications.

More information

About

Azure Blob Storage Photo Gallery Web Application using ASP.NET MVC 5. The sample uses the .NET 4.5 asynchronous programming model to demonstrate how to call the Storage Service using the Storage .NET client library's asynchronous APIs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 42.4%
  • JavaScript 36.0%
  • HTML 18.1%
  • CSS 3.1%
  • Classic ASP 0.4%