Configuring the Roles
In this third part of the walkthrough, we will configure the web role and the worker role projects so you can publish them on your Windows Azure Cloud service. This configuration is necessary to connect the catalogue data with the metadata of the endpoint. They will be the ones that provide the data to any client that visits your site.
Before you start the steps below, you need to have completed all steps on setting up the Windows Azure account, storages, and service as well as installing all 3rd party dependencies of the projects described previously in this guide.
Configuring the web role
- Load the solution (if you haven’t done so yet), locate the Solution explorer, and find the DataBrowser.Cloud project.
- Expand the branches under the project and look for the folder Roles, where you will find the two roles: DataBrowser.WebRole and DataBrowser.WorkerRole
- Double-click on the DataBrowser.Webrole to open the configuration table. Select the Settings tab on the left.
- In the newly opened window, locate the Service Configuration drop-down box and select Cloud. This way, all changes you make will affect only the configurations for the Azure cloud installation.
- Click on the DataConnectionString and choose ConnectionString in the column Type. Doing that will display a browse button at the end of the same row.
- Click the browse […] button to open a Connection String form.
- Once it opens, select the Enter storage account credentials. These settings will allow you to connect to the storages you created above in this article.
- In the Account name field type the name of the storage account you chose to use for the configuration database. You may remember that we asked you to name them in such a way so you can recognize them later – data and config. Here, you should use the one with the config word in the name.
- In the Account key field you must enter the access key for config storage. You can get it from the Windows Azure Management panel. Locate the Storages panel, select the configuration storage.
- In your Azure Portal, on the bottom toolbar you will see Manage Key. Clicking it will display Primary access key and Secondary access key. They both have access rights but we suggest using the second one. Keep the first for administration purposes and the second for the OGDI DataLab installation itself. This way at a later point you will be able to change it and cancel access to everyone that is not an administrator.
- Go back to Visual Studio and paste it in the Storage Account Connection String form.
- Click OK to save the settings and close the Storage Account Connection String form.
- Repeat the same process for the DiagnosticsConnectionString setting of the web role project (starting from step 5), using the same storage name and key.
- There is one more setting that needs changing – serviceUri. It is on the same Settings tab in the Visual Studio. Go back to Windows Azure Platform portal and select the Cloud Services screen. Click the service you created in the first part of this article and locate the column URL to the right.
- Copy the DNS Prefix. It is just the first part of the ServiceUri. All standard Azure DNS names finish with .cloudapp.net so the service URI you will use starts with the DNS prefix you copied and finishes with cloudapp.net:8080/v1/
In our example, the serviceUri is http://MyOpenCity.cloudapp.net:8080/v1/
Configuring the worker role
Now, you need to configure the same three settings for the DataBrowser.WorkerRole, so follow the exact same steps from above (starting from step 3) but double-clicking on the DataBrowser.WorkerRole in the Solution Explorer. The values for all settings are the same.
You have just completed the configuration of the DataBrowser project and you will be able to publish it on Azure in part 4 of this walkthrough.