Skip to content

Latest commit

 

History

History
 
 

valet-key

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Valet Key Pattern

This document describes the Valet Key Pattern example from the guide Cloud Design Patterns.

System Requirements

  • Microsoft .NET Framework version 4.5
  • Microsoft Visual Studio 2015 Comunity, Enterprise, or Professional
  • Windows Azure SDK for .NET version 2.9

Before you start

Ensure that you have installed all of the software prerequisites.

The example demonstrates operational aspects of applications running in Windows Azure. Therefore, you will need to use the diagnostics tools in order to understand how the code sample works. You must ensure that the web and worker roles in the solution are configured to use the diagnostics mechanism. If not, you will not see the trace information generated by the example.

About the Example

This example shows how a client application can obtain a shared access signature with the necessary permissions to write directly to blob storage. For simplicity, this sample focuses on the mechanism to obtain and consume a valet key and does not show how to implement authentication or secure communications.

Running the Example

You can run this example locally in the Visual Studio Windows Azure emulator. You can also run this example by deploying it to a Windows Azure Cloud Service.

  • Start Visual Studio using an account that has Administrator privileges ("Run as Administrator").

  • Open the solution you want to explore from the subfolders where you downloaded the examples.

  • Right-click on each role in Solution Explorer, select Properties, and ensure that the role is configured to generate diagnostic information.

  • If you want to run the example on Windows Azure, provision a Windows Azure Cloud Service and deploy the application to it from Visual Studio. Alternatively you can run the example in the local Windows Azure emulator.

  • Start the Web Service and note the URL of the web role shown in the browser address bar.

  • Open the file app.config from the ValetKey.Client project and change the setting for serviceEndpointUrl to [your-URL]/api/values/

  • Start a new instance of the ValetKey.Client project to upload the blob. Right-click the project, select Debug, and click Start new instance.

  • If you are running the application locally in the Windows Azure emulator:

    • Open the Windows Azure Compute Emulator UI from the icon in the notification area.
    • Select each role in turn and view the diagnostic information generated by Trace statements in the code.
  • If you are running the application on Windows Azure:

    • Open the Server Explorer Window in Visual Studio and expand the Windows Azure entry.
    • Expand Cloud Services and then expand the entry for the solution you deployed.
    • Right-click each role instance and select View Diagnostics Data to see the diagnostic information generated by Trace statements in the code. This is written to the WADLogsTable in the Storage/Development/Tables section.