Build and Deploy LightSwitch Application on Windows Azure
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


Build and Deploy LightSwitch Application on Windows Azure



Visual Studio LightSwitch is the simplest way to build business applications for the desktop and cloud. LightSwitch simplifies the development process by letting you concentrate on the business logic, ...

Visual Studio LightSwitch is the simplest way to build business applications for the desktop and cloud. LightSwitch simplifies the development process by letting you concentrate on the business logic, while LightSwitch handles the common tasks for you.

In this session you see the demo, Which shows you end-to-end, how to build and deploy a data-centric business application using LightSwitch and deploy to Windows Azure



Total Views
Views on SlideShare
Embed Views



16 Embeds 532 360 91 44 9 7 6 4 2 2 1 1 1 1 1 1 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • The Windows Azure platform today has four parts: Windows Azure: A Windows environment for running applications and storing data on computers in Microsoft data centers. SQL Azure: Relational data services in the cloud based on SQL Server. Windows Azure AppFabric: Cloud-based infrastructure services for applications running in the cloud or on premisesWindows Azure Marketplace: An online service for purchasing cloud-based data and applications.
  • Compute: The Windows Azure compute service runs applications on a Windows Server foundation. These applications can be created using the .NET Framework in languages such as C# and Visual Basic, or they can be built without .NET in C++, Java, and other languages. Developers can use Visual Studio or other development tools, and they’re free to use technologies such as ASP.NET, Windows Communication Foundation (WCF), and PHP. Storage: This service allows storing binary large objects (blobs), provides queues for communication between components of Windows Azure applications, and even offers a form of tables with a simple query language. (Windows Azure applications that need traditional relational storage can also use SQL Azure.) Both indows Azure applications and on-premises applications can access the Windows Azure storage service, and both do it in the same way: using a RESTful approach. Fabric controller: As the figure suggests, Windows Azure runs on a large number of machines. The fabric controller’s job is to knit the machines in a single Windows Azure data center into a cohesive whole. The Windows Azure compute and storage services are then built on top of this pool of processing power. Content delivery network (CDN): Caching frequently accessed data closer to its users speeds up access to that data. The Windows Azure CDN can do this for blobs, maintaining cached copies at sites around the world. Connect: It’s often useful for organizations to interact with cloud applications as if they were inside the organization’s own firewall. Windows Azure Connect allows this, making it easier for, say, a Windows Azure application to access an on-premises database.
  • The components of SQL Azure today are the following: SQL Azure Database provides a cloud-based database management system (DBMS). This technology lets on-premises and cloud applications store relational data on Microsoft servers in Microsoft data centers. As with other cloud technologies, an organization pays only for what it uses, increasing and decreasing usage (and cost) as the organization’s needs change. Using a cloud database also allows converting what would be capital expenses, such as investments in disks and DBMS software, into operating expenses. SQL Azure Data Sync allows synchronizing data between SQL Azure Database and on-premises SQL Server databases. It can also be used to synchronize data across different SQL Azure databases in different Microsoft data centers. SQL Azure Reporting is a version of SQL Server Reporting Services (SSRS) that runs in the cloud. Intended primarily for use with SQL Azure Database, it allows creating and publishing standard SSRS reports on cloud data.
  • Service Bus: Exposing an application’s services on the Internet is harder than it might seem. The goal of Service Bus is to make this simpler by letting an application expose endpoints in the cloud that can be accessed by other applications, whether on-premises or in the cloud. Each exposed endpoint is assigned a URI, which clients can use to locate and access the service. Service Bus also handles the challenges of dealing with network address translation and getting through firewalls without opening new ports for exposed applications. Access Control: There are many ways for a user to get a digital identity today. The options include Active Directory, Windows Live ID, Google Accounts, Facebook, and more. If an application wants to let users log in with any of these, the application’s creator faces the daunting challenge of supporting this plethora of approaches. Access Control simplifies this by providing built-in support for all of them (and more). It also provides a single place for defining rules to control what each user is allowed to access. Caching: It’s common for applications to access the same data over and over. One way to speed up this kind of application is to cache frequently accessed information, reducing the number of times that application must query a database. The Caching service provides this—and the performance boost it brings—for Windows Azure applications.
  • Key point: As your organization evaluates the multiple environments available to create a cloud based offering, it is important to understand that only PaaS takes away all of the extraneous management tasks that are not directly related to your value add.Across different types of hosted and cloud offerings the resources your organization manages are different:On-Premise: If you develop, test and help customers deploy your offering on-premise, all the components of the stack starting from the base hardware to middleware and right up to the application are managed by you. The place where your organization adds value however is at the very top where the application and the data sits.Managed hosting: If you have already moved part of the way to a hosted environment that manages some of the components of the hardware and may manage middleware partly as well, you still spend a lot of energy on managing the remaining parts of the stack where you don’t add value. You also have to predict usage, rent servers and hope you predicted right. There is no inbuilt process for scaling.IaaS: In an IaaS offering some of this headache of managing non-value added components of the stack goes away however you still manage the databases and security and integration services….so this is better than the 2 prior alternatives but still not ideal.PaaS: This is the offering where your organization is able to use its energies and talent most effectively – in creating more innovative applications, in reaching new markets, and in overcoming your businesses challenges versus managing infrastructure or middleware. The only components of the stack that you manage and focus on are those where you add value and therefore those that are tied to your revenue-stream directly.
  • Introducing Microsoft Visual Studio LightSwitch, a simple self-service tool that allows developers and business professionals to build business applications quickly and easily for the desktop and the cloud- without the need to code!Visual Studio LightSwitch is a new product in the Visual Studio family aimed at developers who want to quickly create data-centric business applications for the desktop and the cloud. LightSwitch is an extensible development environment that simpliies the development process because it lets you concentrate on the business logic while it takes care of a lot of the remaining work. LightSwitch is perfect for small business or departmental productivity applications that need to be done fast. It’s easy to quickly get up and running in LightSwitch so you can focus on features important to your business. You don’t necessarily need to write code to get a LightSwitch application up and running, but you’ll quickly realize that code is necessary for business rules, screen worklows and other user productivity features specii c to your business requirements. Moreover, you can download and install LightSwitch extensions from the Visual Studio Gallery that add features to your application that aren’t available out of the box. You can even create extensions yourself using Visual Studio Professional or higher. It’s a good bet that the community will be creating some interesting extensions for LightSwitch!
  • Architecture OverviewBefore we dive into advanced LightSwitch development, it’s impor-tant to understand the architecture of a LightSwitch application. LightSwitch applications are based on Silverlight and a solid .NET application framework using well-known patterns and best practices, like n-tier application layering and Model-View-ViewModel (MVVM), as well as technologies like the Entity Framework and WCF RIA Services (see ). h e LightSwitch team made sure not to invent new core technologies, such as a new data-access or UI layer; instead we created an application framework and development environment around these existing Microsot .NET Framework-based technologies that lots of developers are already building on today.This architecture means LightSwitch applications can be deployed as desktop applications, with the ability to integrate with hardware devices such as a scanner or bar code reader, as well as other applications like Microsoft Word and Excel; or they can be deployed as browser-based applications when broader reach is required. You can also host LightSwitch applications in a variety of ways, including with Windows Azure.LightSwitch is all about data and screens. The data in a screen is managed by a data workspace, which is responsible for fetching entities from a data service in the middle tier via queries, for tracking changes, and for sending updates back through the save pipeline to the middle-tier data service. When you execute the save command, it invokes the data service with one change set, which runs in one update transaction against the data source. You can have multiple data sources in LightSwitch (and even relate entities across data sources). Each data source you bring into your LightSwitch application has its own data workspace. From the data workspace, you can access all the queries and update operations against the data source. Entities themselves also expose underlying details, such as their entity state and original and current values. 
  • Visual Studio LightSwitch is its own edition of Visual Studio. Its entire development environment is streamlined to focus on building LightSwitch applications. Even with just the LightSwitch edition installed, developers have access to all the LightSwitch APIs, the Silverlight and .NET frameworks, custom screen layouts and screen workflows, complex validation, the save pipeline and access control hooks. You can write complex and composite LINQ queries and use COM interop, as well as access both client and server project code.However, if you already have Visual Studio Professional or higher installed, LightSwitch will integrate into those editions and LightSwitch applications will show up as just another project template in the New Project dialog. In addition, you also have the ability to create custom controls and extensions for LightSwitch.
  • EntitiesThe first step in building a LightSwitch application, after choosing whether you want to code in Visual Basic or Visual C#, is to define your data. You can create new tables or attach to external data sources. If you create tables from scratch, they’re added to the application database, which is a SQL Server Express database. Note that when it’s time to deploy the application, you can choose any edition of SQL Server to host the data. To work with external data, you can connect to an external database such as SQL Server or SQL Azure or any database for which you have an Entity Framework provider. You can also connect to SharePoint lists or WCF RIA Services.Knowing that a LightSwitch application is a Silverlight application, you may be wondering, “Where is the XAML?” A primary goal of LightSwitch is to make it much easier to build applications. It therefore does not expose XAML at design time. Rather, LightSwitch generates XAML at run time based on the screen design. This makes it dramatically easier for users to build applications. If you’re an experienced Silverlight developer, you might be thinking that this also limits your ability to build the screens you’d like.
  • ScreensWhile this may be true if you’re only using Visual Studio LightSwitch, you have much more flexibility if you have LightSwitch on top of Visual Studio 2010 Professional or above. You can create your own Silverlight user controls and add them to LightSwitch screens, as well as use controls that aren’t included in LightSwitch. You can create composite controls or even entire screens that include custom logic, plus you can easily bind these user controls to screen entities.
  • QueriesAll screens are based on queries. The query for a Detail screen returns one row. The query for a List and Details screen returns one parent row and all of the related child rows. The query for a Search or Editable Grid screen will return all rows by default. Note that queries that return a number of rows don’t literally return all of the rows at once. The queries support paging by default. To configure the paging, select the query in either the Screen or Query Designer and change the paging-related properties.You can filter the data returned by a screen query that returns a collection of entities. To do this, click Edit Query in the Screen Designer. In the Query Designer, you can then add Where and Sort clauses. You can also add parameters to queries.Screen queries are specific to a particular screen. Although it’s quick and easy to modify a screen’s query, a better practice is to create a reusable query. For example, you may want customers sorted by company name on the customer search screen. However, customers may also appear in a modal window picker on the screen where you create new appointments and in an autocomplete text box on the screen that displays customers and their projects. Rather than add the same Sort to three queries on three different screens, you can create one query and use it on the three screens.
  • Access ControlAccess control gives you the ability to control what actions users can take in an application. LightSwitch uses the standard ASP.NET membership and role providers to enable both Windows and Forms authentication. You can authorize users to perform actions by creating permissions, assigning them to users and then checking in code whether the user has a particular permission.By default, all users can perform all actions in a LightSwitch application. To change this, open the Application Designer and select the Access Control tab, as shown in Figure 14. Then select either Windows or Forms authentication. The built-in SecurityAdministration permission controls whether a user can see the security administration screens at run time. You use those screens to assign permissions to users and add users if necessary. You can create additional permissions if desired. During development, you can turn off permissions by unchecking Granted for debug. This enables you to test the application using various combinations of permissions.
  • DeploymentLightSwitch provides three models for deploying applications: two-tier desktop application, three-tier desktop application and three-tier Web application.A two-tier desktop application runs entirely on the end user’s computer as an out-of-browser Silverlight application. The UI and all the application’s middle-tier components run locally. The application connects to the database directly in typical client-server fashion. 
This avoids the need for a Web server. The application has access to local resources, including COM or local files. COM support provides the ability to control applications such as Word or Excel. Note that desktop applications require Windows.A three-tier desktop application runs as an out-of-browser Silverlight application hosted on IIS or Windows Azure. The UI runs on the end user’s computer, while the middle-tier components run on the host server.A three-tier Web application runs as an in-browser Silverlight application hosted on IIS or Windows Azure. The UI is browser-based and the middle-tier components run on the host server. Web applications don’t have access to COM or local resources, but they do provide the most reach across Mac and Windows OSes and multiple browsers.
  • Desktop client, 2-tier. This deployment scenario creates an application that runs on the end-user’s Windows desktop. The database and server components run on a networked computer.
  • Desktop client, 3-tier. This deployment scenario creates an application that runs on the end-user’s Windows desktop. The database and server components run on a server that is running Internet Information Services (IIS) or on Windows Azure.
  • Browser client, 3-tier. This deployment scenario creates an application that runs in the end-user’s web browser. The database and server components run on a server that is running IIS or on Windows Azure.
  • Extension Another way to add functionality to a LightSwitch application is to use an extension. There are six types of LightSwitch extensions: controls, screen templates, business types, shells (application look and feel), themes (colors and brushes for a shell) and custom data sources. You’ll need Visual Studio 2010 Professional or above and the Visual Studio 2010 SDK to create a LightSwitch extension, but anyone can use them in their LightSwitch project, no matter what edition they have installed.Extensions are distributed via VSIX packages. If you want to make an extension broadly available, you can upload it to the Visual Studio Gallery. It will then appear in the Extension Manager within LightSwitch. After installing an extension, you can enable it on the Extensions tab of the Application Designer. The Contoso Construction sample application uses a Bing map control extension to show the location of customers, as shown in Figure 12.

Build and Deploy LightSwitch Application on Windows Azure Presentation Transcript

  • 1. Community {Technology} Update 2012K.Mohamed FaizalLead Consultant @ NCS (P) Ltd.Jan 7th 2012
  • 2. Agenda Introduction to Windows Azure Introduction to LightSwitch Build Application on LightSwitch Deploy Application to Windows Azure
  • 3. About Me Community {Technology} Update
  • 4. Windows Azure Platform Marketplace
  • 5. Windows Azure
  • 6. SQL Azure• Familiar • Two-way sync • Reporting relational of SQL Azure service in the database model DBs across DCs cloud• Built for the cloud with high • Enables geo- • Generate availability redundancy & reports using• Accessible via Hybrid models familiar SSRS ADO, TDS, REST tools
  • 7. AppFabric• Application • Single place • Application expose endpoints provides level in the cloud that federated distributed can be accessed authentication cache for by other and rules- better applications driven, claims- performance whether on- based premises authorization
  • 8. “Windows Azure Platform” In One Slide
  • 9. Types Of Cloud Environments
  • 10.  A smooth on-ramp to development  Built-in plumbing that handles common application requirements  Simple and flexible deployment LightSwitch is for End User Developers LightSwitch is for Professional Developers
  • 11. LightSwitch Application Overview
  • 12. LightSwitch App Architecture Data •SQL Server/Express •SQL Azure •SharePoint 2010 Storage Logic •ASP.NET 4.0 •WCF RIA Services IIS/Azure •Entity Framework (Middle-tier) LS DLLs Presentation •Silverlight 4.0 •WCF RIA Services Client )
  • 13. LightSwitch Building Blocks LightSwitch VS Pro Ecosystem Screens Queries Entities Business Logic
  • 14.  Customer information. Product Information Relationship between customer and order details
  • 15. Community {Technology} Update 2012
  • 16. EntitiesCan be local (SQL Server Express) or attached (SQL Server, SQL Azure, SharePoint, WCF RIA service)Custom business types Provide validation and formattingCalculated properties Write code to generate valueCan create relationships within and across data sourcesCan validate at the entity or property level
  • 17. Screens Variety of built in screens New, search, details, editable grid, list and details Always based on queries Can use auto-generated screens for adding/editing or create your own Developers can modify screens at design-time and runtime Generated screens do not expose XAML You can use Silverlight controls you create yourself You can add UI elements packaged as extensions
  • 18. QueriesLightSwitch creates queries automatically Select * query is a collection, eg. CustomerCollection Select where query is a detail, eg. CustomerDetailYou can edit existing queries Filter, sort, add parametersYou can create new queriesYou can base queries on other queries
  • 19. Community {Technology} Update 2012
  • 20. Security in LightSwitch Apps 2 Types of Authentication  Windows Authentication  Forms Authentication (user is automatically prompted for the user name and pw) Users are managed within the running application  built-in administration screens available within the running application (only users with built-in SecurityAdministrator permission have the ability to manage users) Security API providing access points to perform security checks  Detetmine who the current user is (this.Application.User)  Info about permissions and roles
  • 21. Deployment Options 2-tier desktop application Application runs entirely on user’s computer 3-tier desktop application User interface runs on user’s computer Middle-tier components run on Internet Information Services (IIS) or Windows Azure 3-tier web application User interface is browser based Middle-tier components run on IIS or Windows Azure
  • 22. 2-Tier Deployment Clients & Database are on the same Network (LAN) Windows Clients Database  NET Framework 4  All LightSwitch Components (DLLs)  SQL Server Or SQL Express
  • 23. 2-Tier Deployment Clients & Database are on the same Network (LAN) UserID=<sqlUser>;Password=<sqlPwd> Windows Clients Database  NET Framework 4  All LightSwitch Components (DLLs)  SQL Server Or SQL Express
  • 24. 3-Tier Deployment Clients can be on the Internet or same network IIS Authentication: Anonymous (no login), Windows (auto login), Forms (login prompt) Same network or same machine Internet OR Network DomainUser Or SQL Direct Connection LAN/WAN user / pass Database Web Server Clients Silverlight 4  NET Framework 4 LightSwitch Client Application  Internet Information Services (IIS)(Desktop apps = Windows Clients  LightSwitch Application ServicesBrowser apps = Mac/Windows)  SQL Server OR SQL Express
  • 25. 3-Tier Deployment Clients are on the Internet and connect to Windows Azure IIS Authentication: Anonymous (no login), Forms (login prompt) SQL user / pass Internet Windows Azure SQL Azure Clients Silverlight 4  LightSwitch Application Services LightSwitch Client Application  SQL Server(Desktop apps = Windows ClientsBrowser apps = Mac/Windows)
  • 26. Community {Technology} Update 2012
  • 27. Extending LightSwitch LightSwitch has 6 extensibility points
  • 28. Installing ExtensionsLightSwitch developers can install extensions via Extension ManagerOr just click on the VSIX package to install LightSwitch Extensions are installed like any other Visual Studio extension and managed via the Extension Manager
  • 29. Requirements for BuildingLightSwitch Extensions Visual Studio Pro (or higher) + SP1 Visual Studio LightSwitch Visual Studio SDK For building VSIX packages LightSwitch Extension Development Kit (coming soon) Upload to VS Gallery 
  • 30. Extensibility Toolkit om/0dfaa2eb-3951-49e7-ade7- b9343761e1d
  • 31. Publishing LightSwitch App How to publish LightSwitch App on Windows Azure by-step-how-to-publish-to-windows-azure-andy-kung.aspx How to configure IIS to Host LightSwitch App yment-guide-how-to-configure-a-web-server-to-host- lightswitch-applications.aspx
  • 32. K.Mohamed FaizalLead Consultant @ NCS (P) Ltd.Jan 7th 2012 @kmdfaizal