Duration (Pacific Standard Time):
To (Pacific Standard Time):
  • None
User Action:
  • None

LocalResource Class


Updated: October 18, 2011

Represents a local storage resource that is reserved for a hosted service.

Namespace:   Microsoft.WindowsAzure.ServiceRuntime
Assembly:  Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)


Public MustInherit Class LocalResource
Name Description
System_CAPS_pubproperty MaximumSizeInMegabytes

System_CAPS_pubproperty Name

Gets the name of the local storage resource that was specified in the service definition file.

System_CAPS_pubproperty RootPath

Gets the full directory path of the local storage resource.

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

A local storage resource is a reserved directory in the file system of the virtual machine in which an instance of a role is running. To define a local storage resource for your hosted service, you must add a LocalResources element with LocalStorage elements to the ServiceDefinition.csdef file of the hosted service for each directory that you want to create. For more information about defining local storage resources, see the Configure Local Storage Resources.

After you define the local storage resources in the ServiceDefinition.csdef file, you can access the directories by using the properties defined in the LocalResource class. The following code example shows how you can write text to a file in the local storage resource:

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top