Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
media
README.md

README.md

Developer Environment (Java)

Overview

In this lab, you will set up an Office365 trial subscription, an Azure trial subscription, configure your Azure subscription for the DevCamp, and provision a virtual machine in the subscription to use for development of further labs.

Objectives

In this hands-on lab, you will set up an Office365 developer subscription, and Azure trial subscription, and an Azure-based virtual machine for the development environment for subsequent labs in the DevCamp. To expedite the process, we've prepared a Windows image that you will copy into your own environment, start the virtual machine and connect to it. You will then configure the components for Azure development.

  • Set up an Office365 trial subscription.
  • Set up an Azure trial subscription.
  • Configure your Azure subscription for DevCamp.
  • Create an Azure Virtual Machine for remote development.
  • Connect to the Azure Virtual Machine and configure it for development.
  • Review the features of the Azure Portal.

Prerequisites

You will need a cell phone and credit card for identity verification.

The credit card will not be charged unless you remove the spending limit on the subscription you will create.

Exercises

This hands-on-lab has the following exercises:


Before you start

🔺If you already have an Office 365 subscription, please use an alternate browser or use private mode! This will help avoid any issues with conflicting accounts.

Clear your browsers cache and restart your browser.

Do not skip exercise 1! Even if you already have an Office 365 subscription and address, follow exercise 1 and create a new account.

Use the account created in exercise 1 for all the following exercises and hands-on labs!

To register for a free trial use an e-mail address and a phone number that has not been used for a free trial yet!🔺


Exercise 1: Set up Office 365 trial subscription

  1. In your browser, go to products.office.com/en-us/business/office-365-enterprise-e3-business-software and click the link that says Free Trial.

    image

    This will navigate you to this page:

    image

  2. Enter the information requested, and click Next which will take you to the following page:

    image

  3. Choose a user id and a tenant name for your trial. In this case I chose devcampross, but you can choose anything you'd like, as long as it is unique. You'll also have to choose a password, and click Create my account.

  4. Next you will see this page, which asks for phone verification:

    image

  5. After this process is complete, your O365 trial will be set up, and you'll see this page:

    image

    Make note of your user id, which will be used to sign onto the Azure portal later.

  6. Click You're ready to go, which will take you to the following screen:

    image

  7. Click on the Admin app icon, which will open the Office365 admin center page in your browser. It will look like this:

    image

    If you'd like to see the welcome tour click Next, or simply close the dialog box.

Stay on this page until the next exercise.


Exercise 2: Set up Azure trial subscription

Next, we want to set up an Azure subscription. Go to azure.microsoft.com/en-us/free and click Free trial.

image

If the free trial option is not available login to portal.office.com and click Cost Management + Billing in the menu on the left. This will open the Cost Management + Billing blade. From the blade's menu select Subscriptions and click on New subscription at the top of the blade:

image

From the list select the Developer support option to create a Azure trial:

image

BEGIN Steps for Azure Pass redemption - Follow this step if you are using an Azure Pass. If you are not using an Azure Pass, please skip ahead to END Steps for Azure Pass redemption

  1. Navigate to www.microsoftazurepass.com and sign in. Make sure to clean your browser cache and use a private window! The sign in screen must display the company icon shown on the left side:

    image

  2. Enter the code that is provided by your facilitator into the text box, then click Claim Promo Code.

    image

  3. Click Activate.

    image

END Steps for Azure Pass redemption

  1. After clicking on the Azure Subscription link you will be taken to the page for creating a new trial subscription:

    image

  2. Enter the requested information and click Next.

  3. Enter the information about you, and verify your identity by phone.

  4. Next, you will need to verify via credit card. Your credit card will not be charged unless you remove the spending cap from your subscription. Supported cards must be either a Credit or Debit card, from vendors Visa, Mastercard, American Express, or Discover.

    image

  5. Finally after the verification process, you'll have to agree to the terms of the trial subscription and click the Sign up button.

    image

  6. It will take a few moments to set up your Azure subscription.

    image

  7. When the subscription set up process is complete, click on Get started with your Azure subscription button:

    image

You should now be taken to the Azure Portal where you can explore your new Azure Trial Subscription.

image


Exercise 3: Start your VSTS trial subscription

In a future lab we will use Visual Studio Team Services, or "VSTS" for short. In this exercise we will enable a free trial subscription.

  1. In your browser, go to www.visualstudio.com/team-services and click on Sign in in the upper right corner.

    image

    Complete the sign in process if needed, and you should be taken to a screen that looks like this:

    image

    Add your name and email address (if not already populated) and click Continue.

  2. On the My Benefits screen, click Use your benefits under the heading Visual Studio Dev Essentials.

    image

  3. Click the Accept button to access your Visual Studio Dev Essentials benefits.

    image

    Click Confirm in the modal dialogue.

    image

You have now activated a Visual Studio Team Services Trial Subscription, which will be used in a future lab.


Exercise 4: Configure your Azure subscription for DevCamp

  1. We have created an Azure Resource Group template that will configure the resources you need in Azure for the DevCamp. To deploy these resources in your Azure subscription, control + click on the blue Deploy to Azure button below (on a MAC, use Apple Key + click):

    Full deployment: 👉 👈

    Alternative without artifacts: 👉 👈

    If you are using the alternative deployment you have to manually install: Chrome, git, VS Code and execute \DevCamp\Shared\ARMTemplate\Scripts\InstallNodeJS.ps1 in a PowerShell to install Chocolatey and NodeJS.

  2. You should see a new tab open in your browser and open the Azure portal, with a blade that looks like this:

    image

  3. Name your resource group DevCamp, and choose a location for your deployment.

    Please do not choose the region West India for your deployment. It is missing a resource that is needed for the labs!

  4. Check the box that indicates you agree to the terms and conditions, and click the Purchase button.

    The Resource Group template will start deploying, and the portal may pin a tile to the dashboard showing the status:

    image

    It will also be visible in the Notifications dropdown:

    image

  5. This will take approximately 20-30 minutes to complete. Please do not continue on until the template has completed.

    In a later session, we will take a look at Azure Resource Group templates, and how to manage your infrastructure the same way you manage your code. As a short introduction, a template is a JSON file that contains definitions for the resources you want in your resource group. When you apply the resource group template, Azure will apply the template to your Azure resource group, and create the resources you have specified in the template. This makes it easy to maintain the infrastructure definition in the JSON text file.

    In the resource group template we have created for DevCamp, there are several types of resources including Web Apps and a Virtual Machine. Resource Group Templates are usually fairly quick to apply - the reason this one takes so long is that we are creating a Windows Virtual machine and installing all the tools you will need for the DevCamp including Visual Studio, the Java development kit, and other software resources.

  6. You will know when the Resource Group finishes provisioning either by the Notification drop-down, or by navigation on the left-hand bar to Resource Groups -> DevCamp and check the Deployments status for Succeeded.

    image

    Once the Resource Group creation is done, you can visit the resource group by clicking Resource Groups on the left navigation pane:

    image

  7. Then click on your Resource group to open it:

    image


Exercise 5: Use an Azure Virtual Machine for remote development

  1. The Azure resource group template will have created a virtual machine that can be used for remote development on Windows. Exercise 5 describes the configuration for the Windows virtual machine, which would be appropriate for any of the languages.

  2. In the DevCamp resource group, select the DevCamp DevTest Lab.

    image

  3. Find the Windows virtual machine in your DevTest lab. The name will start with the prefix windev:

    image

  4. Select the machine name and open the virtual machine blade then click Connect to connect to the machine using Remote Desktop:

    image

    This will download a remote desktop connection file, and when you open it, remote desktop on your local machine will attempt to attach to your virtual machine.

    image

    When the windows security dialog pops up, the user name l-admin should be pre-selected. If not click on the More choices link, then choose Use a different account.

    image

  5. Use the following credentials to log on to the machine:

    User Name = .\l-admin

    Password = Devc@mp2016!

    image

    It would be wise to change the password in the virtual machine.

  6. When remote desktop is connected, you will see server manager initially. We will want to turn of IE enhanced security, to make accessing the web within the virtual machine easier. First click local server.

    image

  7. Then click the On next to IE Enhanced Security Configuration.

    image

    A dialog box pops up - choose to turn enhanced security off for administrators.

  8. We are going to use git to clone the DevCamp github repository to this development machine. Click on the Start menu, and type cmd.

    NOTE: On some high resolution monitors (HIGH DPI), you will notice that the icons and command line windows appear small. If this is an issue, you can download Remote Desktop Connection Manager 2.7.

  9. Change directory to the root using cd c:\ .

  10. Type git clone https://github.com/AzureCAT-GSI/DevCamp.git:

    image

    All of the content for this DevCamp will now be located in c:\DevCamp.

  11. Inside your development Virtual Machine, open a NEW command prompt window and execute this command to verify that the node version is v6 or greater:

    node -v

    If the Node version on your machine does not equal v6, we will need to update the version. Open a browser window and go to nodejs.org, and click on the Other Downloads link under the current version LTS, you may have to scroll down and click on Previous Releases to find v6 or download it directly from here. If a newer version is already installed you have to uninstall it first:

    image

    In the next page, click on 32-bit next to Windows Installer (.msi), download the MSI and run the installation.

    image

    Please do not skip this step, because we will need node.js to install the Azure cross platform command line interface in the next step.

  12. We will use the Microsoft Azure Cross Platform Command Line to interact with our subscription.

    There is a new python-based command line interface in preview - we are not going to use that one. Please follow these instructions to install the node-based command line interface.

    If necessary finish the Node installation, then install the Microsoft Azure Cross Platform Command Line by executing in a NEW command prompt window:

    npm install azure-cli -g
  13. If you are not developing in Java for the DevCamp, you can skip this step. We have already installed the Java JDK, but we will install gradle and Eclipse. We will be using the gradle build manager - to install that using the chocolatey package manager, open a NEW command window as administrator and type:

    choco install -y gradle

    Close the command window, open a NEW command window as administrator and also install maven with:

    choco install -y maven

    Close the command window, open a NEW command window as administrator and go to the root directory using cd \ , and perform these commands in sequence:

    refreshenv
    git clone https://github.com/swagger-api/swagger-codegen.git
    cd swagger-codegen
    mvn clean package

    Eclipse Mars or Neon can be used.

    Be careful to not upgrade to versions newer than Neon since they no longer support gradle.

    Spring Tool Suite is available here:

    http://spring.io/tools/sts

    For example, after downloading the Eclipse installer, run it and you'll get this screen:

    image

    choose Eclipse IDE for Java EE developers. In the next screen, leave the defaults and choose INSTALL:

    image

    When that is done, click LAUNCH to start the IDE and choose a directory for your workspace. You will end up with the initial Eclipse screen:

    image

    Click Help in the menu bar, and choose Install New Software...:

    image

    In the window that pops up, choose All Available Sites for the Work with dropdown, type gradle in the search box, and when the search is complete (which sometimes takes a minute or two - there is a progress bar in the lower left corner of the Eclipse main window), choose Buildshop: Eclipse Plug-ins for Gradle:

    image

    Click through the dialog, install the package and let Eclipse restart.

    Again select Help -> Install New Software..., and click the Add.. button next to the Work with dropdown. In the Add Repository dialog box, give the repository a name, and type http://dl.microsoft.com/eclipse for the Location, and click OK:

    image

    This will load a list of available packages. Choose the Azure Toolkit for Java package and the Team Explorer Everywhere package in the list, and complete the package installation as before:

    image

    If you encounter an error you might have to manually download a previous version of the Scala IDE matching your Eclipse version from http://scala-ide.org/download/prev-stable.html (select the highest available version for matching your Eclipse version). Install it by extracting the zip file. Again select Help -> Install New Software..., and click the Add.. button next to the Work with dropdown. Select the extracted folder. Now the Scala IDE components will be listed. Select them all and continue the installation.

    Also, install the Spring Tool Suite (STS) for Eclipse package by using the menu item Help -> Eclipse Marketplace..., type spring in the Find: box and choose Go. In the list of packages, scroll down to Spring Tools (aka Spring IDE and Spring Tool Suite) X.X.X.RELEASE and click Install.

    image


Exercise 6: Deploy shared API application

  1. The API application has been prepared for you to be available as a communication partner during different exercises and just needs to be deployed once. It will be first used in the second hands on lab.

  2. Open a browser and navigate to https://portal.azure.com. Locate the app service named incidentapi... in the resource group blade:

    image

  3. Click on the app service, which will bring up the app service blade. Click on Browse at the top:

    image

    A new browser tab will open.

    If the page looks like the image displayed below, this means the API was automatically deployed from GitHub, and you can skip the rest of this exercise.

    image

    If the page looks like the image below, continue with this exercise

    image

  4. In the Azure portal, select the API Application (noted with the image icon).

    image

  5. On the details blade select Deployment options.

    image

  6. If the app deployment is connected, click Disconnect on the menu bar.

    image

  7. Then select Setup on the menu bar.

    image

  8. Select External repository.

  9. Paste the following in the Repository URL field https://github.com/AzureCAT-GSI/DevCamp.git.

    image

  10. Select OK.


Exercise 7: Azure Portal walk-through

  1. On your local machine or the virtual machine in Azure, open a browser window and go to the main Azure portal page, http://portal.azure.com. Log in with the credentials you supplied in the subscription sign-up exercise. You should see the Azure portal, similar to this:

    image

    There is a lot to notice on this screen. At the upper left corner, the icon under the Microsoft Azure banner allows you to shrink and expand the left bar:

    image

    Under that, clicking on the + New item will allow you to create new deployments, virtual machines, databases, etc:

    image

  2. On the left you will see a list of the Azure services that you can use on the left hand side. Notice that this list will scroll up and down to reveal more services, and finally an item that says More Services >:

    image

    You can click on any of these and see what items are deployed, and easily create new deployments.

  3. At the top of the window you have a search box where you can search for any resources:

    image

  4. The bell icon is for notifications, and in this screenshot, it indicates that there are two notifications pending:

    image

    Clicking on the bell will show you the notifications:

    image

    If you click on one of the notifications, you can go to the details blade that matches the content of the notification, e.g. the details blade of the starting virtual machine.

  5. The >_ icon opens the Azure Cloud Shell which gives you authenticated shell access to Azure within the browser. It opens at the bottom of the window.

    image

  6. The gear at the top of the screen lets you set the color palate for the portal, whether or not there will be animations, and other options for the portal itself:

    image

  7. The "smiley face" button allows you to send feedback to Microsoft:

    image

    Clicking on the icon will give you a form to let us know about your experience:

    image

  8. The Question icon will give you the ability to enter a support case, manage support requests, or get further information on Azure.

    image

  9. Your login name and company name on the upper left hand corner has two functions:

    image

    If you hover the mouse over your name, you'll get information about your login, the directory and subscription:

    image

    If you click on your name, you can sign out, change your password, view your permissions, and view your bill:

    image

  10. Next we will look at the resource group we set up with the template. Click on Resource Groups on the left hand side:

    image

  11. Click on the resource group that you created:

    image

    A new blade will open with the overview of all of the contents of the resource group listed:

    image

    You can click on any of the items on the left hand side which will view or manipulate settings for the resource group as a whole. If you click on any of the individual resources in the center, you will get more information on that resource.

  12. Azure automatically logs changes to resource group and who made those changes. Clicking Activity log on the left of the blade will allow you to query the log, and clicking on any logged items will give you additional information on that entry:

    image

  13. Clicking on Automation script will allow you to view, edit or download the resource group template that would create this resource group.

    image

  14. The Windows VM is managed by an Azure DevTest lab named DevCamp which handles the startup and shutdown of the machine. To change the start up schedule, click on the DevTest Lab icon and select Configuration and policies under the Settings headline.

    image

    image

  15. Select Auto-shutdown.

    image

  16. Modify the Auto-shutdown schedule based on your time zone.

    image

The Azure portal is currently in a re-designing phase during which the Auto-Start option may not be available at all times. Skip the next to steps if it does not show up on the VM's menu.

  1. The machine does not automatically turn on. To enable this, in the Policy Settings blade, select Auto-Start.

    image

  2. Change the schedule based on your time zone.

    image

It is particularly useful to create resources in the Azure portal, then save or edit the resource group template. Resource group templates will be explained further in a later lab.


Exercise 8: View the resources you created

Going back to the list of resources in the resource group DevCamp, we'll go through the list of each resource, with a description. Feel free to click on the resource and view its detail blade.

image

Also, our resource group template has added a random string to the end of many of the resources. In this description, we have replaced that string with ...:

  • adevcamp... - Storage account for storing artifacts for the DevTest labs.

  • DevCamp - This is the DevTest lab that is used to manage the VM images and artifacts.

  • DevCamp... - This is the Azure Key Vault that is used to manage secure credentials.

  • DevCampVnet - This is an Azure Virtual Network, which will allow components of the resource group to communicate as if they were on the same physical network.

  • dotnetapp... - App service for running the .NET application when deployed to the cloud. If you are not using .NET in the labs, you can safely delete this.

  • incidentapi... - App service for running the API service that provides a REST API to the web applications.

  • incidentappplan... - App Service Plan, which defines how the app services in the resource group will be configured.

  • incidentblobstg... - Storage account for storing the uploaded images and the Azure Queue, from the modern-cloud-apps hands on lab.

  • incidentcache... - This is the Redis cache that we use from the application to make data access faster. The modern-cloud-apps hands on lab adds support to the application to be able to leverage the cache.

  • incidentdb... - This is the CosmosDB database that will hold the JSON incident documents stored by the application.

  • incidentdiagstg... - Storage account for storing diagnostics from the services in the resource group.

  • javaapp... - App service for running the Java application when deployed to the cloud. If you are not using Java in the labs, you can safely delete this.

  • nodejsapp... - App service for running the Node.js application when deployed to the cloud. If you are not using Node.js in the labs, you can safely delete this.

In the second resource group DevCamp-WinDev-..., additional resources were created.

image

They are all called WinDev-... but are of different types:

  • Public IP address - This is a public IP that will allow the Windows development virtual machine to communicate with the Internet (e.g. via Remote Desktop). If you delete the Windows virtual machine, you can safely delete this.

  • Virtual machine - This is the Windows server virtual machine that we are using as a development machine for these hands-on-labs. You can delete this machine after the developer-environment lab if you are using an on-premises/local machine for development.

  • Network interface - This is a public network interface that will allow the Windows development virtual machine to communicate on the network. If you delete the Windows virtual machine, you can safely delete this.

  • Disk - Storage account for storing for VHDs for the machines DevTest labs.


Clean Up

🔺 Please refer back to this section after the DevCamp concludes! This is instructional only! Do NOT clean up until the DevCamp is done! 🔺

To clean up a Resource Group, we typically simply delete the Resource Group. However, since we are using an Azure DevTest Lab to manage our Virtual Machine, we have an additional step.

Azure DevTest Labs create a series of Resource Locks that prevent accidental deletion of resources. Locks allow us to safeguard against accidental deletion of critical resources, and to delete the Resource Group we first need to delete the locks.

Open your DevCamp Resource Group, and in the navigation pane select Locks. You should see the 3 locks created by the DevTest Lab. To delete, select the three dots to the right of the Notes column, and select Delete.

image

After all 3 locks have been deleted you are able to delete the resource group. Navigate to the Overview tab and select Delete. The Resource Group will take several minutes to remove, but when finished all resources will no longer accrue charges in your subscription.

image


Summary

In this hands-on lab, you learned how to:

  • Set up an Office365 developer subscription.
  • Set up an Azure trial subscription allowing you to complete this course free of charge.
  • Configure your Azure subscription for DevCamp.
  • Create an Azure Virtual Machine for development where you can carry out the following hands on labs.
  • Connect to the Azure Virtual Machine and configure it for development.
  • Use the Azure portal to view the resources that you created giving you a first overview of the management of Azure resources.

After completing this module, you can continue on to Module 2: Building modern cloud apps.

View Module 2 instructions for Java.


Copyright 2016 Microsoft Corporation. All rights reserved. Except where otherwise noted, these materials are licensed under the terms of the MIT License. You may use them according to the license as is most appropriate for your project. The terms of this license can be found at https://opensource.org/licenses/MIT.