How to: Publish a LightSwitch Application to Windows Azure
You can deploy Visual Studio LightSwitch applications, such as web applications and three-tier desktop applications, to a Windows Azure cloud service or a Windows Azure website by using a wizard. You can also host application data in SQL Azure databases.
Note |
|---|
| To deploy an application to Windows Azure, you must have a subscription and install the Windows Azure SDK for .NET. |
To publish an application to a Windows Azure cloud service
To publish an application to a Windows Azure website
To publish an application to a Windows Azure cloud service
-
On the menu bar, choose Build, PublishApplicationName.
The LightSwitch Publish Application Wizard appears.
-
On the Welcome to the LightSwitch Publish Wizard page, choose either the Desktop, Web or Service only option button, and then choose the Next button.
-
On the Application Server Configuration page, choose the Windows Azure option button, and then choose the Next button.
-
On the Subscription page, in the Choose your publish settings list, choose the authentication credentials for your Windows Azure subscription, and then choose the Next button. If the list is empty, choose Import to locate your .publishsettings file.
Note If you have never published to Windows Azure, you must choose the Sign in to download credentials link and then create a .publishsettings file that contains your credentials. For more information, see Setting Up Named Authentication Credentials. -
On the Service Type page, choose the Cloud Service option button, and then choose the Next button.
-
On the Service Configuration page, in the Cloud service list, choose the service to which you want to publish.
You can publish to a cloud service that’s empty or that another application is using.
Note If no cloud services are listed, choose the Create new link to create one for your subscription. -
In the Environment list, choose the deployment environment to which you want to publish.
-
(Optional) To allow access to the Windows Azure role for troubleshooting and development purposes, select the Enable Remote Desktop for all roles check box.
The Remote Desktop Configuration dialog box appears, and you can enter configuration settings in it. For more information, see Using Remote Desktop with Windows Azure Roles.
-
Choose the Advanced tab, and, in the Deployment Name text box, specify the name for the deployment.
This name will appear in the Windows Azure Management Portal; the default value is the application name.
-
(Optional) Clear the Append current date and time check box to prevent the current date and time from being appended to the deployment name each time the application is published.
-
In the Storage list, choose the storage service in which the application binaries will be stored.
Note If no storage services are listed, choose the Create new link to create one for your subscription. -
(Optional) Clear the Enable deployment upgrade check box to stop overwriting the previous version of an application each time that you publish it.
If you clear this check box, you must manually remove the previous version of the application in the management portal before you publish a new version.
-
Choose Next to continue.
If you have enabled authentication for your application, the Application Administrator tab of the Security Settings page appears.
-
If the Application Administrator tab appears, enter a valid User Name, Full Name, and Password for the user who will be the initial application administrator.
Note When you publish updates, the application administrator already exists. Select the No, an Application Administrator already exists check box to skip this step. -
Choose the HTTPS tab, and, in the Choose your certificate list, choose the security certificate that you want to use for the application.
Note If no certificates are listed, choose the Upload button to add an existing certificate. When you publish your application to a staging environment for testing, you can create a test certificate by choosing Create new self-signed certificate. -
(Optional) To verify the publisher of the application to end users, specify a certificate by choosing the Digital Signature tab, and then, in the Choose your certificate list, choosing the security certificate that you want to use for the application.
Note If no certificates are listed, choose the Upload button to add an existing certificate. When you publish your application to a staging environment for testing, you can create a test certificate by choosing Create new self-signed certificate. -
Choose the Next button to continue.
-
On the Data Connections page, choose the Database Connections tab, and, in the Specify the user connection text box, enter the connection string for the intrinsic database.
-
In the Publish database schema text box, enter the connection string for the intrinsic database.
Note When you publish updates, clear the Publish database schema check box unless you have changed the schema. -
Choose the Attached Data Sources tab, update the connection strings for any additional connections as needed, and then choose the Next button.
Note The Attached Data Sources tab is available only if you have specified an external data source for your application. -
On the Summary page, review the settings, and then choose the Publish button.
When the publishing operation finishes, the Windows Azure Management Portal appears in your browser.
Note The publishing operation may take several minutes depending on connection speed, application size, and other factors. -
In the management portal, choose Hosted Services, Storage Accounts and CDN, and then choose Hosted Services.
-
In the Name column, choose the deployment name that you specified for your application.
Note The Status column may display Initializing while Windows Azure configures the services. When the status changes to Ready, your application is ready to run. -
In the Properties pane, choose the link for the DNS name property to launch the application.
To publish an application to a Windows Azure website
-
On the menu bar, choose Build, PublishApplicationName.
The LightSwitch Publish Application Wizard appears.
-
On the Welcome to the LightSwitch Publish Wizard page, choose either the Desktop, Web or Service only option button, and then choose the Next button.
-
On the Application Server Configuration page, choose the Windows Azure option button, and then choose the Next button.
-
On the Subscription page, in the Choose your publish settings list, choose the authentication credentials for your Windows Azure subscription, and then choose the Next button. If the list is empty, choose Import to locate your .publishsettings file.
Note If you have never published to Windows Azure, you must choose the Sign in to download credentials link and then create a .publishsettings file that contains your credentials. For more information, see Setting Up Named Authentication Credentials. -
On the Service Type page, choose the Web Site option button, and then choose the Next button.
-
On the Service Configuration page, in the dropdown list, choose the website where you want to host your application and then choose the Next button.
Note If no websites are listed, choose the Sign-in to the Azure portal link, and create a website. -
If you have enabled authentication for your application, the Application Administrator tab of the Security Settings page appears.
-
If the Application Administrator tab appears, enter a valid User Name, Full Name, and Password for the user who will be the initial application administrator.
Note When you publish updates, the application administrator already exists. Select the No, an Application Administrator already exists check box to skip this step. -
Choose the HTTPS tab, and choose On to require a secure HTTPS connection, or choose Off if your application doesn’t need a secure connection, and then choose the Next button.
For more information about security, see Security Considerations for LightSwitch.
-
On the Data Connections page, on the Database Connections tab, the connection strings for the intrinsic database should appear in the Specify the user connection and Publish database schema text boxes. If they don’t appear, choose the Provision a database at the Azure portal link, create a database, and then copy the new connection string to both the Specify the user connection and Publish database schema text boxes.
Note When you publish updates, clear the Publish database schema check box unless you have changed the schema. -
Choose the Next button to continue.
-
Choose the Attached Data Sources tab, update the connection strings for any additional connections as needed, and then choose the Next button.
Note The Attached Data Sources tab is available only if you have specified an external data source for your application. -
On the Summary page, review the settings, and then choose the Publish button.
When the publishing operation finishes, the Windows Azure Management Portal appears in your browser.
Note The publishing operation may take several minutes depending on connection speed, application size, and other factors. -
In the management portal, choose Web Sites.
-
In the Name column, choose the deployment name that you specified for your application.
Note The Status column may display Initializing while Windows Azure configures the services. When the status changes to Ready, your application is ready to run. -
In the Properties pane, choose the link for the URL to launch the application.
See Also