Giter Club home page Giter Club logo

jornada-azureexpert's Introduction

Jornada Azure Expert

Participe da Jornada Azure Expert de 11 a 18 de outubro, evento ONLINE e gratuito: https://guilhermemaia.com/jornada

Projeto Hands-on Lab

Implantação 100% prática de Aplicação em Alta disponibilidade e Escalável no Azure

Parts Unlimited Online Auto Parts

A slide shows the Parts Unlimited

Application Archicture

A slide shows the Parts Unlimited Architecture

Deploy Application (20 minutes)

  1. Deploy the template Template.json to a new resource group. This template deploy a virtual machine with Application and Database.

  2. You can deploy the template by selecting the 'Deploy to Azure' button below. You will need to create a new resource group RG-PU-App. You will also need to select a location East US or other close to you to deploy the template to. Then choose Review + create followed by Create.

Deploy to Azure

 > **Note:** The template will take around 10-15 minutes to deploy. Once template deployment is complete, several additional scripts are executed to bootstrap the lab environment. **Allow at least 15 hour from the start of template deployment for the scripts to run.**
  1. In the Azure portal, select the Virtual machines icon, after selecting More services. You should see a single VM named webVM listed.

  2. Select the webVM item in the list. The details for the VM appear.

  3. On the upper details toolbar, select Connect, and then select RDP from the dropdown list.

  4. On the Connect pane, select Download RDP File.

  5. Open the webVM.rdp file. You'll be prompted for the VM's security credentials in the Windows Security dialog box. Select Use a different account. Copy and paste the username and password from step 1 into the dialog box, and select OK.

  6. On the remote desktop, open Internet Explorer, and go to http://localhost. Confirm that the Parts Unlimited website is successfully running. This site is hosted in IIS in the virtual machine, and connects to an Azure SQL database.

Migration to Azure App Service (20 minutes)

  1. On the remote webVM desktop, double-click the icon to open the Azure App Service Migration Assistant. The user interface then lists the Migration Assistant's steps with the first step highlighted, Choose a site. In the main area, the Migration Assistant informs that it found one site to assess.

  2. Select the Default Web Site option.

  3. After a moment, the assessment report step should finish. You should see that all 13 assessments were successful with no warnings or errors.

  4. Select Next to display the Login to Azure step. Here you'll use a special code to associate this assessment on your server to your Azure account.

  5. In the Migration Assistant, you'll see the Login to Azure page with a device code and a button. Copy the device code to the clipboard.

  6. Go to the device login service. You should see the Enter code webpage on your local computer.

  7. On your local computer, select Next. Sign in by using the same account that you used to sign in to Azure.

  8. Back in the Migration Assistant running in the remote VM, the step Azure Options is displayed. Here you'll enter details about the target App Service instance to which you'll move your app.

  9. Use the following table to make your selections:

    Field Value
    Resource Group Select the Use exiting option
    Destination Site Name Enter a valid name for the destination site apppu####
    App Service Plan Select the Create new
    Region East US or other
    Azure Migrate Project Leave this field empty
  10. Select Migrate. The Migration in Progress screen displays the current status of the migration.

  11. After the migration is complete, you'll continue to the Migration Results step.

  12. Open the Azure portal on a new tab on your local computer. Select App Service from the home page. From the list of deployed services, select the one that matches the name that you created earlier. This will display the settings for your new App Service account.

  13. Select the Browse button at the top of the overview page to browse to your migrated site running in Azure.

Deploy Azure Front Door (30 minutes)

  1. From the Azure portal, select +Create a resource, then search for and select Front Door. Select Create.

  2. Complete the Basics tab of the Create a Front Door blade using the following inputs, then select Next: Configuration >:

    • Resource group: Use existing / RG-PU-Web
    • Location: Automatically assigned based on the region of RG-PU-Web.
  3. Select the plus icon on the Frontend/domains box to set the host name of Front Door. In the Add a frontend host pane, enter the following values, then select Add:

    • Host name: Enter a unique name with the prefix of puwebafd####.
    • Session affinity: Disabled
    • Web application firewall: Disabled
  4. Select the plus button on the Backend pools box to begin adding endpoints to the backend pool. On the Add a backend pool pane, enter the following value, then select the Add a backend link.

    • Name: PUPool
  5. On the Add a backend pane, enter the following values (leave others as defaults), then select Add:

    • Backend host type: App Service
    • Backend host name: puwebafd####
    • Backend host header: puwebafd####
  6. Select Add to add the backend pool.

    • Health Probes - Protocol: HTTPs
  7. Select Add to create the backend pool.

  8. Select the plus button on the Routing rules box. On the Add a rule pane, enter the following values (leave others as defaults), then select Add.

    • Name: PURule
    • Accepted protocol: HTTP / HTTPs
    • Backend pool: PUPool
    • Forwarding protocol: HTTPs Only
  9. Select Review + Create. Once validation has completed, select Create to provision the Front Door service.

  10. Navigate to the Azure Front Door resource. Select the Frontend host URL of Azure Front Door, the Policy Connect web application will load.

    Note: If you get a "Our services aren't available right now" error (or a 404-type error) accessing the web application, then continue on with the lab and come back to this later. Sometime this can take a ~10 minutes for the routing rules to publish before it's "live".

Autoscale Azure App Service (30 minutes)

  1. Open the Azure portal on a new tab on your local computer. Select App Service from the home page. From the list of deployed services, select the one that matches the name that you created earlier.

  2. On the blade displaying the production slot of the web app, in the Settings section, click Scale out (App Service plan).

  3. Click Custom autoscale.

    Note: You also have the option of scaling the web app manually.

  4. Leave the default option Scale based on a metric selected and click + Add a rule

  5. On the Scale rule blade, specify the following settings (leave others with their default values):

    Setting Value
    Metric source Current resource
    Time aggregation Average
    Metric namespace App Service plans standard metrics
    Metric name CPU Percentage
    Operator Greater than
    Metric threshold to trigger scale action 10
    Duration (in minutes) 5
    Time grain statistic Average
    Operation Increase count by
    Instance count 1
    Cool down (minutes) 10
  6. Select ++ Add a rule

    Setting Value
    Metric source Current resource
    Time aggregation Average
    Metric namespace App Service plans standard metrics
    Metric name CPU Percentage
    Operator Less than
    Metric threshold to trigger scale action 5
    Duration (in minutes) 5
    Time grain statistic Average
    Operation Decrease count by
    Instance count 1
    Cool down (minutes) 10

    Note: Obviously these values do not represent a realistic configuration, since their purpose is to trigger autoscaling as soon as possible, without extended wait period.

  7. Click Add and, back on the App Service plan scaling blade, specify the following settings (leave others with their default values):

    Setting Value
    Instance limits Minimum 1
    Instance limits Maximum 3
    Instance limits Default 1
  8. Click Save.

  9. In the Azure portal, open the Azure Cloud Shell by clicking on the icon in the top right of the Azure Portal.

  10. If prompted to select either Bash or PowerShell, select PowerShell.

  11. From the Cloud Shell pane, run the following to start and infinite loop that sends the HTTP requests to the web app:

    while ($true) { Invoke-WebRequest -Uri URLFRONTDOOR }
  12. Minimize the Cloud Shell pane (but do not close it) and, on the web app blade, in the Monitoring section, click Process explorer.

    Note: Process explorer facilitates monitoring the number of instances and their resource utilization.

  13. Monitor the utilization and the number of instances for a few minutes.

    Note: You may need to Refresh the page.

  14. Once you notice that the number of instances has increased to 2, reopen the Cloud Shell pane and terminate the script by pressing Ctrl+C.

  15. Close the Cloud Shell pane.

Delete the Hands-on Lab resources

  1. Within the Azure portal, select Resource Groups on the left navigation.

  2. Delete each of the resource groups created in this lab by selecting them followed by the Delete resource group button. You will need to confirm the name of the resource group to delete.

You should follow all steps provided after attending the hands-on lab.

Continue in the Treinamento Azure Expert.

jornada-azureexpert's People

Contributors

maiaacademy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.