Table of Contents
-
Microsoft Azure subscription must be pay-as-you-go or MSDN.
- Trial subscriptions will not work.
-
Azure CLI - version 2.0.68 or later
-
- If you are running Visual Studio 2017, install SDK 2.2.109
Duration: 10 minutes
Synopsis: In this exercise, you will set up your environment for use in the rest of the hands-on lab. You should follow all the steps provided in the Before the Hands-on Lab section to prepare your environment before attempting the labs.
-
Open a browser window to the cloud workshop GitHub repository (https://github.com/AzureCosmosDB/scenario-based-labs).
-
Select Clone or download, then select Download Zip.
-
Extract the zip file to your local machine, be sure to keep note of where you have extracted the files. You should now see a set of folders:
-
Open a Chrome browser window to https://api.themoviedb.org
-
Create an account and copy your API Key for use in the next task
- Select SIGN UP
- Fill in your account details, select Sign up
- Select your profile icon in the menu, select Settings
- Select API
- Select click here underneath Request an API Key to generate a new key.
- Select the Developer option for the API key type, accept the license agreement, then complete the form to create a new API key. Select Website under Type of Use. You may enter any URL (such as http://www.microsoft.com), and you must enter a description, such as:
Creates a movie recommendation engine
.
- Copy the
API Key (v3 auth)
key for later use
-
Open a browser window to the Azure Portal, be sure to login as the user that has access to your soon to be created resource group
NOTE: This is necessary as the script will open a window that requires you to have already logged in to the portal.
-
Open a PowerShell ISE window, run the following command, if prompted, click Yes to All:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
-
Execute the following command to update the Azure CLI to the latest version:
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'
-
Close the PowerShell ISE window after the Azure CLI update completes. This ensures that the latest CLI version is used when running the following scripts.
-
Re-open the PowerShell ISE window, then browse to the C:\scenario-based-labs-master\Retail\deploy\deploy.ps1 PowerShell script in an PowerShell ISE window
NOTE You can reference the Frequently Asked Questions/Issues if you run into issues with your deployment.
-
Set the following variables:
NOTE: If you are performing a demo of this solution, select the "demo" setting, otherwise leave as "lab"
$githubPath = "PATH YOU EXTRACTED REPO ZIP TO" # Such as: C:\scenario-based-labs-master $mode = "lab" # Can be 'lab' or 'demo' $subscriptionId = "YOUR SUBSCRIPTION ID" # You can find this at the top of your Azure resource group or any Azure resource, or in the Subscriptions link under "All services" in the portal's left-hand menu $prefix = "YOUR INITIALS" $isSpektra = $true # Set to $true if you are running in a Spektra-hosted environment (https://manage.cloudlabs.ai) instead of your own Azure subscription. Otherwise, set to $false. $databaseId = "movies" $movieApiKey = "YOUR MOVIE API KEY"
NOTE: You should have Azure CLI 2.0.68 or higher to run this script. You can check by running
az --version
-
Press F5 to run the script, this will do the following:
- Deploy the starter ARM template(s)
- Deploy the initial web and function apps
- Setup the web and function app configuration variables
- Create starter objects in the 'object' collection of the Cosmos DB database
- Update your project application configuration files with the target azure keys and settings
-
The deployment will take 15-25 minutes to complete. You will be prompted for information in both
demo
andlab
modes. As part of the deployment, you will see the following items created:- Function App
- Web App
- App Service Plans
- Event Hub
- Stream Analytics Job
- Databricks Service
- Cosmos DB
- Key Vault
- Storage Accounts
- Application Insights
-
Record the values that were output from the script for use in the lab
You should follow all steps provided before attending the hands-on lab.