Define Environment Variables Before a Role Starts
Updated: May 9, 2014
You can define environment variables for a role by adding the Runtime element to the definition of the role in the service definition file. For more information about these elements, see the Azure Service Definition Schema (.csdef File).
You can edit the ServiceDefinition.csdef file by using your favorite text editor.
Open the ServiceDefinition.csdef file for your service in the text editor.
Add the Runtime element to the WebRole, WorkerRole, or VirtualMachineRole element. The following code example shows how to set an environment variable for the web role:
Change the name value to the name of the variable, and change value to the value of your variable.
Save the file.
ConceptsRun Startup Tasks in Azure