Coder Social home page Coder Social logo

mshankarrao / 2019-global-azure-bootcamp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brendonthiede/2019-global-azure-bootcamp

0.0 2.0 0.0 1.13 MB

Code samples for the Lansing Codes, 2019 Global Azure Bootcamp

License: MIT License

PowerShell 25.34% HTML 4.83% CSS 3.44% JavaScript 22.92% C# 5.15% Vue 38.32%

2019-global-azure-bootcamp's Introduction

2019 Global Azure Bootcamp

Code samples for the 2019 Global Azure Bootcamp, presented by Lansing Codes and the Lansing DevOps Meetup.

Stages

Storage Account

Web App (App Insights)

Web App with Azure Database

Web App wih Cosmos DB

Function App (storage)

Web App, Function App, Storage, and Cosmos DB

Running PowerShell Scripts

In order to run unsigned scripts on Windows, you can run the following:

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force

Deploying a Template

Connecting to a subscription

Here are some PowerShell commands to get you connected to a subscription:

# Connect to Azure:
(Connect-AzAccount).Subscription.Name

# Show current subscription:
(Get-AzContext).Subscription.Name

# List your subscriptions:
Get-AzSubscription | Select-Object -Property Name

# Switch to a different subscription ("Azure Pass - Sponsorship" in this case):
(Set-AzContext -Subscription "Azure Pass - Sponsorship").Subscription.Name

Creating a Resource Group

You need to create a resource group before you can deploy to it. This is an example of a resource group named "bootcamp-rg" in the "East US" region:

(New-AzResourceGroup -Name bootcamp-rg -Location eastus -Force).ProvisioningState

Deploying the ARM Template

Provide any required parameters either through the command line or using a parameters file:

$DeploymentName = "$(Get-Date -Format "yyyyMMddHHmmss")$env:COMPUTERNAME"
New-AzResourceGroupDeployment -Name $DeploymentName -ResourceGroupName bootcamp-rg -Mode Incremental -TemplateFile .\stage-01\autodeploy.json

System Prerequisite Notes

Installing Git, Node 10, and Dev Tools on Ubuntu 18.04

sudo apt-get install git
sudo apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y gcc g++ make

Git Config

When first setting up git, you will need to configure your username and email:

git config --global user.name "yourusername"
git config --global user.email "[email protected]"

On Linux or a Mac you may want to set up an SSH key to automatically authenticate you:

ssh-keygen -t rsa -b 4096 -C "[email protected]"

If you use the defaults you can grab the public key like this:

cat /home/brendon/.ssh/id_rsa.pub

And then add that to your GitHub account at https://github.com/settings/ssh/new

Installing PowerShell on Ubuntu

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo add-apt-repository universe
sudo apt-get install -y powershell

Setting PowerShell as the Default Shell

On Ubuntu, to set PowerShell as the default shell, run the following and then logout and log back in (just starting a new shell is not enough):

chsh -s /usr/bin/pwsh $USER

Installing Az Modules

From a PowerShell prompt, run:

Install-Module -Name Az -AllowClobber -Scope CurrentUser

Installing ChromeDriver

You will need to install Chrome in order to use the ChromeDriver. To install Chrome on Ubuntu, you can run this:

sudo echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list
wget https://dl.google.com/linux/linux_signing_key.pub
sudo apt-key add linux_signing_key.pub
sudo apt update
sudo apt install google-chrome-stable
rm ./linux_signing_key.pub

Install ChromeDriver from http://chromedriver.storage.googleapis.com/index.html by downloading the latest zip file for your operating system and then putting the executable from the zip into your path.

Example for Windows:

Invoke-WebRequest "http://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_win32.zip" -OutFile chromedriver_win32.zip
Expand-Archive -Path .\chromedriver_win32.zip -DestinationPath $env:USERPROFILE\bin
$systemPath = [System.Environment]::GetEnvironmentVariable('PATH', 'User') + ";$env:USERPROFILE\bin" -replace ';;',';'
[System.Environment]::SetEnvironmentVariable('PATH', $systemPath, 'User')
$env:PATH += ";$env:USERPROFILE\bin"

Example for Linux:

wget -q https://chromedriver.storage.googleapis.com/74.0.3729.6/chromedriver_linux64.zip
unzip ./chromedriver_linux64.zip
rm ./chromedriver_linux64.zip
sudo mv ./chromedriver /usr/local/bin/ -f

2019-global-azure-bootcamp's People

Contributors

brendonthiede avatar

Watchers

James Cloos avatar Evolution 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.