Migrating Applications to the Cloud with Azure
eBook - ePub

Migrating Applications to the Cloud with Azure

Re-architect and rebuild your applications using cloud-native technologies

  1. 494 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Migrating Applications to the Cloud with Azure

Re-architect and rebuild your applications using cloud-native technologies

About this book

Modernize your apps with Microsoft Azure by moving web, desktop, and mobile apps to the cloud

Key Features

  • Decide which migration strategy is most suitable for your organization and create a migration roadmap
  • Move existing infrastructure to Azure and learn strategies to reduce cost, increase storage, and improve ROI
  • Design secure, scalable, and cost-effective solutions with the help of practical examples

Book Description

Whether you are trying to re-architect a legacy app or build a cloud-ready app from scratch, using the Azure ecosystem with.NET and Java technologies helps you to strategize and plan your app modernization process effectively.

With this book, you'll learn how to modernize your applications by using Azure for containerization, DevOps, microservices, and serverless solutions to reduce development time and costs, while also making your applications robust, secure, and scalable.

You will delve into improving application efficiency by using container services such as Azure Container Service, Azure Kubernetes Service (AKS), and more. Next, you will learn to modernize your application by implementing DevOps throughout your application development life cycle. You will then focus on increasing the scalability and performance of your overall application with microservices, before learning how to add extra functionality to your application with Azure serverless solutions. Finally, you'll get up to speed with monitoring and troubleshooting techniques.

By the end of this book, you will have learned how to use the Azure ecosystem to refactor, re-architect, and rebuild your web, mobile, and desktop applications.

What you will learn

  • Use DevOps and containerization technologies to modernize your applications and infrastructure
  • Build microservices using Azure Service Fabric
  • Develop scalable applications using Azure Functions
  • Manage and deploy your application code and database connectivity
  • Secure and monitor your applications in Azure effectively
  • Design for high availability and disaster recovery

Who this book is for

This book is for.NET and Java developers who want to modernize their applications using Azure. Solution architects and experienced developers interested in modernizing legacy applications using Azure will also find this book useful. Some prior understanding of cloud computing concepts will be beneficial.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Migrating Applications to the Cloud with Azure by Sjoukje Zaal, Amit Malik, Sander Rossel, Jason Marston, Mohamed Wali, Stefano Demiliani in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Networking. We have over one million books available in our catalogue for you to explore.

Information

Connecting to the Database

Databases are very important in software. When moving your databases to Azure, you have a few databases to choose from, ranging from traditional SQL databases to NoSQL databases. In this chapter, we're going to look at the various database options that are available to us. When you opt for the Microsoft stack, you'll likely use Azure SQL or Cosmos DB, but databases from other vendors, such as MariaDB and Redis, are also offered as PaaS or IaaS solutions.
The following topics will be covered in this chapter:
  • Working with Azure SQL
  • Connecting to SQL Server Management Studio
  • Connecting to Azure SQL from .NET Core
  • Connecting to Azure SQL from Java
  • Understanding Cosmos DB
  • Working with the MongoDB API
  • Working with the Redis cache database

Technical requirements

You will need the following tools to complete the examples in this chapter:
  • SQL Server Management Studio (SSMS): https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
  • Visual Studio 2017: https://www.visualstudio.com/downloads/
  • Eclipse 2019: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/2019-09/R/eclipse-java-2019-09-R-linux-gtk-x86_64.tar.gz
The source code for this chapter can be downloaded here: https://github.com/PacktPublishing/Migrating-Apps-to-the-Cloud-with-Azure/tree/master/Chapter10.

Working with Azure SQL

SQL Server is Microsoft's flagship database. It was released almost 30 years ago and it's still going strong today. So, of course, Azure has its own options for running SQL Server databases. The costs for SQL Server databases range from about €4 (basic) to over €18,093 (business-critical 80 vCores and 4 TB), so there should be something between those price ranges that fits your needs.

Picking your version

You have two options when it comes to hosting a SQL Server database in Azure. You either go for Azure SQL Server, which gives you a nice database instance without much hassle, or you host a VM and install SQL Server on that. Azure SQL is a Platform as a Service (PaaS) solution, while a VM is an Infrastructure as a Service (IaaS) solution. Since the IaaS solution that's installing your database on a VM is basically the same as hosting your own on-premises version of SQL Server, except on a machine running in the cloud, we're not going to talk about that in this chapter. This chapter will focus on PaaS solutions.
If you're looking for IaaS solutions, Azure has plenty of VM images that come with preinstalled (SQL) databases, such as SQL Server 2008 all the way up to the newest release, in different versions such as Standard and Enterprise, and even with different service packs installed. You're not limited to SQL Server either; you can pick images with Oracle, Postgres, MySQL, MongoDB, Neo4j, and plenty of others. The IaaS solution is ideal for a rehost or lift-and-shift migration, as discussed in Chapter 1, Strategies for App Modernization Using Azure.
When you're looking for a SQL PaaS solution, your options are much more limited. There's Azure Database for MySQL, PostgreSQL, and MariaDB in preview, and then there's Azure SQL, which I'm going to discuss here. I'm not going to discuss all four SQL databases, but if you're interested in MySQL, PostgreSQL, or MariaDB, you can check out the links in the Further reading section at the end of this chapter. Azure SQL is not the same as the on-premises version of SQL Server. They share the same engine, but Azure SQL doesn't give you the same type of control that SQL Server gives you. This is inherent to PaaS because you're not controlling the infrastructure, so you don't have access to the underlying OS. That being said, for a lot of databases, the transition will be rather painless. All your SQL code is still supported, after all. As such, migrating to PaaS solutions can usually be done while refactoring, rearchitecting, or rebuilding. See the Further reading section at the end of this chapter for a side-by-side feature comparison.
You can also use the Data Migration Assistant (DMA see the Further reading section), which helps you by looking for compatibility issues, such as unsupported or partially supported features, in your current database and Azure SQL (or any other SQL Server database).
Microsoft recommends hosting SQL Server in a VM for quick migrations to Azure as it closely resembles what you have on-premises. However, there is a third option: the Azure SQL Database Managed Instance. It provides nearly 100% compatibility with the latest Enterprise edition of your on-premises SQL Server. In this chapter, we're not going to use this, though, as it's not (yet) available in all locations or on all subscription types, it's quite expensive (starting at over €1,000), and it can take up to 6 hours to create.

Creating an Azure SQL Database

Creating an Azure SQL Database is surprisingly easy. Follow these steps to do so:
  1. Either find your SQL databases or go to Create a resource and find SQL Database.
  2. In the blade that opens, select a subscription.
  3. Select or create a resource group.
  4. Give the database a name. This is your database, so it doesn't have to be unique across Azure.
  5. The next part is a little tricky; we need to create an actual server:
    1. Provide a name for your server; it has to be unique across all of Azure.
    2. Enter the name of your server's admin.
    3. Enter a password that meets the requirements (Azure will show you what those requirements are if you don't meet them).
    4. Confirm the password.
    5. Select a location.
    6. Keep Allow Azure services to access server checked. For non-development purposes, it's recommended to uncheck this option as it gives any Azure resource access to your server, even those not in your current subscription.
  6. Now, we can go back to the SQL database settings. We don't want an elastic pool right now.
  1. The pricing tier is interesting; you can go for the Basic tier here, which is already more than we need. I've picked standard with some extra DTUs:
  1. Leave the collation.
  2. When you have filled everything out, you can click Create and the SQL database will be created; this may take a few minutes:
Let's look at the settings that may not be familiar to you. First, there's a server you have to create. Even though Azure SQL is a PaaS solution, you get some control over your server, mostly in terms of backups and security, which will be discussed in Chapter 12, Securing Your Azure Services, and Chapter 14, Designing for High Availability and Disaster Recovery.
With a server, you have a set number of resources that you pay for during the month. When you have multiple databases with varying and unpredictable periods of usage, a server may be sitting idle a lot of the time and peaking a few times a day or week. To overcome this problem, Azure introduced SQL elastic pools, which autoscale individual databases within set parameters as necessary. So, databases under light loads consume fewer resources while databases under heavy loads consume more resources. By placing these databases in a pool, you can save costs since they can share resources.

Pricing tiers

The cost of your SQL database depends on two things: the size of your data and the number of DTUs you have. There are three DTU-based tiers: Basic, Standard, and Premium. The Basic tier gives you five DTUs and a maximum of 2 GB of data. A D...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. About Packt
  4. Contributors
  5. Preface
  6. Planning Application Modernization
  7. Strategies for Application Modernization Using Azure
  8. Building Your Application Migration Roadmap
  9. Implementing Containerization and DevOps in a Development Cycle
  10. Getting Started with Docker and Kubernetes
  11. Deploying Highly Scalable Apps with Kubernetes
  12. Modernizing Apps and Infrastructure with DevOps
  13. Building a Web and Microservices Architecture on Azure
  14. Designing Web Applications
  15. Scalability and Performance
  16. Building Microservices with Service Fabric
  17. Going Serverless and Deploying to the Cloud
  18. Building Scalable Systems with Azure Functions
  19. Connecting to the Database
  20. Managing and Deploying Your Code
  21. Securing Your Azure Services
  22. Planning for Security, Availability, and Monitoring
  23. Diagnostics and Monitoring
  24. Designing for High Availability and Disaster Recovery
  25. Assessments
  26. Other Books You May Enjoy