How to: Host an Application on Windows Azure
You can deploy LightSwitch 3-tier desktop applications or Web applications to Windows Azure and can use SQL Azure databases. Use the LightSwitch Publish Application Wizard to deploy an application.
Note
You must have a subscription to Windows Azure to deploy an application to Windows Azure.
To publish an application to Windows Azure
On the Build menu, click Publish <Application Name>.
The LightSwitch Publish Application Wizard appears.
On the Welcome to the LightSwitch Publish Wizard page, select either Desktop or Web and then click Next.
On the Application Services page, select Windows Azure and then click Next.
On the Connect to Windows Azure page, click Open the Windows Azure Portal, and then locate your subscription ID and copy it.
In the publish wizard, paste the subscription ID in the Copy the subscription ID and paste it here box.
In the Select a certificate to identify the project to Windows Azure list, select the certificate for your project and then click Next.
Note
The Windows Azure certificate store must contain a copy of the certificate. You can upload the certificate to the store by clicking Copy Path and then opening the Windows Azure portal and following the instructions.
On the Select the Azure Service and Storage page, in the Service: list, select the service that the application will run under.
If you are uploading the application to test it, in the Environment: list, select Staging.
In the Storage: list, select the storage for the application binaries and then click Next.
On the Security Settings page, select the security certificate that you want to use and then click Next.
You can upload a certificate by clicking Upload a PFX File and specifying the certificate and passwords in the Upload PFX File dialog box.
On the LightSwitch Application Data – SQL Database Connection page of the wizard, verify that the administrator connection string and user connection string are valid for the Windows Azure account. You can change the strings to specify a different database and different user credentials if they are required.
To change the connection strings
Select the connection string that you want to change and then click the ellipsis (…) button.
In the Connection Properties dialog box, in the Server name field, type the name of the server where you want to publish the application database.
In the Log on to the server section, select Use SQL Authentication and type a valid User name and Password for the server.
In the Select or enter a database name, type the name of your application.
This name must be the same as the one that you used for the Application Name property in the Application Designer.
Click OK.
In the publish wizard, click Next.
If you have enabled authentication for your application, the Application Administrator page appears. On the Authentication page, in the Should the Application Administrator be created when the application is deployed? section, select Yes, create the Application Administrator at this time.
Note
If you have not enabled authentication, go to Step 18.
In the User Name field, type the user name of the user who will be the default administrator.
In the Full Name field, type the full name of the default administrator.
In the Password field, type the password for the default administrator.
In the Confirm Password field, type the password again.
Remember the user name and password because they are required later.
Click Next.
If you have specified additional data sources for your application, the Other Connections page appears. Verify that the connection strings are correct and then click Next.
Note
Data sources outside Windows Azure may not be available from an application that is hosted on Windows Azure.
On the Specify a Certificate page, select the Sign the Xap File option and then add a certificate (.pfx) file in one of the following three ways.
To add a certificate from the local store
On the Specify a Certificate page, click Select a certificate from this computer’s store.
In the Windows Security dialog box, select the certificate that you want to use and then click OK.
Basic information about the certificate is displayed. To see more information about the certificate, click More Details.
To add a certificate from another location
On the Specify a Certificate page, click Browse for a certificate.
In the Select File dialog box, browse to the location of the certificate that you want to use and then click OK.
Basic information about the certificate is displayed. To see more information about the certificate, click More Details.
To create a test certificate
On the Specify a Certificate page, click Create a Test Certificate.
A password dialog box appears.
Type a password for the new certificate, confirm it, and then click OK.
Basic information about the certificate is displayed. To see more information about the certificate, click More Details.
Click Next.
On the Summary page, click Publish to publish the application.
When the application is published, the Windows Azure portal is displayed.
Note
There may be a delay before the application is available on Windows Azure.
The application administrator must authorize users before they can run the application. For more information, see How to: Create a Role-based Application.
See Also
Tasks
How to: Change the Deployment Topology and Application Type
How to: Create a Role-based Application