Skip to content

Well-begun... #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5d793d4
Well-begun...
ciroque Apr 19, 2024
5738247
CHECKPOINT: Powershell scxript added
ciroque Apr 19, 2024
fd0d735
CHECKPOINT: Punt on tabbed interface for now
ciroque Apr 19, 2024
9331602
CHECKPOINT: Add shell script
ciroque Apr 19, 2024
7403637
Lab3 draft (#12)
chrisakker Apr 19, 2024
f892bd8
Merge (#17)
chrisakker Apr 25, 2024
da498eb
Refactor of lab1 and lab6 and lab7 WIP (#21)
sdutta9 Apr 29, 2024
d9d67e4
Lab10 addition (#23)
apcurrier May 1, 2024
59e1483
Lab1 and Lab2 edits (#24)
sdutta9 May 1, 2024
ec482eb
Lab4 final, diagrams added Labs1-4 (#25)
chrisakker May 2, 2024
e4e2fcd
Lab1,2 graphics added (#26)
chrisakker May 3, 2024
c09149a
lab3 changes (#27)
sdutta9 May 3, 2024
0166b40
Lab3 and Lab4 final edits (#28)
sdutta9 May 7, 2024
87899cd
Lab5 almost done (#29)
chrisakker May 7, 2024
b4dbb6e
Lab6 final updates and screenshots added (#30)
sdutta9 May 8, 2024
ca48990
Add HTTP1.1 (#34)
chrisakker May 14, 2024
bdff804
Updated Grafana Dashboard (#35)
apcurrier May 17, 2024
5a90fa5
removed ca-notes
chrisakker May 20, 2024
d7bae79
Removing ac-notes folder
apcurrier May 20, 2024
72ec2bc
updated dashboard image to add hit ratio
apcurrier May 21, 2024
32e9076
Remove ca-notes (#38)
chrisakker May 21, 2024
b16d131
Update readme.md
apcurrier May 21, 2024
892511c
Update readme.md
apcurrier May 21, 2024
f9b1a52
Lab 7 logging and monitoring updates (#40)
sdutta9 May 21, 2024
7803f21
xRefactory (#41)
sdutta9 May 21, 2024
5fc3da7
Lab9 update (#42)
chrisakker May 21, 2024
52927c7
remove old readme (#43)
chrisakker May 21, 2024
36a9eaa
Swapped labs and removed unnecessary badges from main readme (#44)
sdutta9 May 22, 2024
4e9ef8b
Labs 1, 2, 3, 5 and 6 edits (#45)
sdutta9 May 28, 2024
edf8396
Well-begun...
ciroque Apr 19, 2024
36e1231
CHECKPOINT: Powershell scxript added
ciroque Apr 19, 2024
d829ba6
CHECKPOINT: Add shell script
ciroque Apr 19, 2024
b07c4fe
CHECKPOINT: Exercise 1 in place
ciroque May 30, 2024
f948461
CHECKPOINT: Build tar on MBP
ciroque Jun 18, 2024
3df949e
CHECKPOINT: Remove secrets
ciroque Jun 18, 2024
95e2d62
CHECKPOINT: Cleanup and Working
ciroque Jun 18, 2024
9487318
CHECKPOINT: Ignore gzip archives
ciroque Jun 18, 2024
87999e1
CHECKPOINT: Things are working now
ciroque Jun 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Thumbs.db
# Logs #
########
*.log
/.vs
Binary file added labs/lab8/MyGarage-Home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/lab8/MyGarage-PhotoGallery.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/lab8/MyGarage-SeedData.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added labs/lab8/MyGarage-Vehicles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
170 changes: 154 additions & 16 deletions labs/lab8/readme.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,175 @@
# NGINX Garage or Azure Petshop
# NGINX My Garage

<style>
.tabbed-area {
overflow: hidden;
border: 1px solid #ccc;
background-color: #f9f9f9;
}

.tabbed-area input[type=radio] {
display: none;
}

.tabbed-area label {
float: left;
padding: 10px 20px;
cursor: pointer;
background-color: #ddd;
}

.tabbed-area input[type=radio]:checked + label {
background-color: #ccc;
}

.tabbed-area .tab {
display: none;
}

.tabbed-area input[type=radio]:checked ~ .tab {
display: block;
padding: 20px;
}
</style>

## Introduction

In this lab, you will build ( x,y,x ).

< Lab specific Images here, in the /media sub-folder >
In this lab, you will install the My Garage application, configure it for external access, learn to scale the web service, and set up caching for the image gallery (optional).

The My Garage application is a modern web application built using Microsoft .Net technologies. It is comprised of a frontend application and supporting web service backend. The front-end is a Single Page Application (SPA) that uses [Blazor WebAssembly](https://dotnet.microsoft.com/en-us/apps/aspnet/web-apps/blazor) to render the UI in the browser. The back-end is a RESTful API built using [ASP.Net Core MVC](https://learn.microsoft.com/en-us/aspnet/core/mvc/overview?view=aspnetcore-8.0).

| ![My Garage Home Page](./MyGarage-Home.png) | ![My Garage Vehicles Page](./MyGarage-Vehicles.png) |
|------|------|
| ![My Garage Photo Gallery Page](./MyGarage-PhotoGallery.png) | ![My Garage Seed Data Page](./MyGarage-SeedData.png) |


NGINX aaS | Docker
:-------------------------:|:-------------------------:
![NGINX aaS](media/nginx-azure-icon.png) |![Docker](media/docker-icon.png)

## Learning Objectives

By the end of the lab you will be able to:

- Introduction to `xx`
- Build an `yyy` Nginx configuration
- Test access to your lab enviroment with Curl and Chrome
- Investigate `zzz`

- Create all the resources necessary to deploy the My Garage application
- Ensure the My Garage application is accessible from the internet
- Monitor traffic to the My Garage application using the NGINX Dashboard

## Pre-Requisites

- You must have `aaaa` installed and running
- You must have `bbbbb` installed
- See `Lab0` for instructions on setting up your system for this Workshop
You need to have followed the labs up to this point. Specifically, Lab 0 and Lab 4 are required to have been completed.

- You must have the Azure CLI installed and configured to manage Azure Resources
- Familiarity with basic Linux commands and commandline tools
- Familiarity with basic Docker concepts and commands
- Familiarity with basic HTTP protocol
- You must have created a Resource Group

<br/>

### Lab exercise 1

In this exercise you will establish the necessary Azure resources to deploy the My Garage application. There are two Azure resources that need to be created:

1. A Storage Account to store the images for the photo gallery
1. An AppConfig to store configuration settings for the My Garage application

First, let's establish the Storage Account.

<div class="tabbed-area">
<input id="tab1" type="radio" name="tabs" checked>
<label for="tab1">Bash</label>

<input id="tab2" type="radio" name="tabs">
<label for="tab2">PowerShell</label>

<div class="tab">
```bash
# Bash code here
```
</div>

<div class="tab">
```powershell
<#
establish-azure-resources.ps1

This script creates all the Micorosft Azure Resources needed to run the My Garage application.

The script assumes that you have the Azure CLI installed and configured to point to the desired Azure Subscription.
#>

$Ticks = (Get-Date).Ticks
$Location = "westus2"
$ResourceGroupName = "<YOUR_RESOURCE_GROUP_NAME>"
$StorageAccountName = "mygsa" + $Ticks
$StorageContainerName = "mygsc" + $Ticks
$SasTokenName = "mygsas" + $Ticks
$SasExpiry = "2024-05-31T23:59:59Z"
$AppConfigName = "mygac" + $Ticks
$SasTokenAppConfigKey = "AzureStorageSasToken"
$StorageConnectionStringConfigKey = "AzureStorageConnectionString"
$StorageContainerNameConfigKey = "AzureStorageContainerName"
$RedisConnectionStringConfigKey = "RedisConnectionString"
$owner = $(whoami)

clear

<# -------------------------------- #>
<# Clean Up Previous Run #>

echo "Deleting existing resources..."

az group delete --name $ResourceGroupName --yes

<# -------------------------------- #>
<# Create a new set of stuff #>

echo "Creating resources..."

#-- Storage Account, The Place to Store Stuff
# * The --allow-blob-public-access true is required to allow the container to be public
az storage account create --name $StorageAccountName --resource-group $ResourceGroupName --location $Location --sku Standard_LRS --kind StorageV2 --access-tier Cool --allow-blob-public-access true --tags environment=production owner=$owner

#-- The Account Key is needed for subsequent resources
$accountKey=$(az storage account keys list --resource-group $ResourceGroupName --account-name $StorageAccountName --query "[0].value" --output tsv)

#-- CORS ensure that the storage account can be accessed from the web
az storage cors add --account-name $StorageAccountName --account-key $accountKey --services b --origins "*" --methods GET HEAD --allowed-headers "*" --exposed-headers "*" --max-age 3600

#-- The Storage Connection String is necessary for the App Configuration Store, it is used to let the Application store images
$storageConnectionString=$(az storage account show-connection-string --name $StorageAccountName --resource-group $ResourceGroupName --output tsv)

#-- Storage Container, The Place to Store Images
az storage container create --name $StorageContainerName --account-name $StorageAccountName --account-key $accountKey --public-access blob

#-- Is this really necessary??
#az storage container set-permission --name $StorageContainerName --account-name $StorageAccountName --account-key $accountKey --public-access blob

#-- The App Configuration Store, The Place to Store Configuration
az appconfig create --name $AppConfigName --resource-group $ResourceGroupName --location $Location --sku Standard --query id --output tsv

#-- The Web Application -- My Garage -- needs this to be able to connect to the AppConfig instance and grab configuration
$appConfigConnectionString=$(az appconfig credential list --name $AppConfigName --resource-group $ResourceGroupName --query "[?name=='Primary Read Only'].connectionString" -o tsv)

#-- The values required by the application need to be seeded. Note that all except for the RedisConnectionString have been gathered by this script
az appconfig kv set --yes --name $AppConfigName --key $StorageConnectionStringConfigKey --value "$storageConnectionString"
az appconfig kv set --yes --name $AppConfigName --key $StorageContainerNameConfigKey --value "$StorageContainerName"
az appconfig kv set --yes --name $AppConfigName --key $RedisConnectionStringConfigKey --value "kungdu.wagner-x.net"

#echo "Resource Group ID: $(az group show --name $ResourceGroupName --query id --output tsv)"
#echo "Storage Account ID: $(az storage account show --name $StorageAccountName --resource-group $ResourceGroupName --query id --output tsv)"
#echo "App Configuration Store ID: $(az appconfig show --name $AppConfigName --resource-group $ResourceGroupName --query id --output tsv)"
#echo "Storage Container ID: $(az storage container show --name $StorageContainerName --account-name $StorageAccountName --account-key $accountKey --query id --output tsv)"
#echo "Account Key: $accountKey"
#echo "Storage Connection String: $storageConnectionString"
#echo "Storage Container Name: $StorageContainerName"

#-- Burp out the AppConfig ConnectionString so it can be included in the MyGarage application startup. It is an argument to the docker-compose command:
# docker-compose -e AppConfigurationConnectionString=$appConfigConnectionString up
echo "AppConfig Connection String: $appConfigConnectionString"

```
</div>
</div>


<numbered steps are here>

### Lab exercise 2
Expand Down Expand Up @@ -71,6 +208,7 @@ By the end of the lab you will be able to:
- Chris Akker - Solutions Architect - Community and Alliances @ F5, Inc.
- Shouvik Dutta - Solutions Architect - Community and Alliances @ F5, Inc.
- Adam Currier - Solutions Architect - Community and Alliances @ F5, Inc.
- Steve Wagner - Solutions Architect - Community and Alliances @ F5, Inc.

-------------

Expand Down