Skip to content

Instantly share code, notes, and snippets.

View stephenweinrich's full-sized avatar

Stephen Weinrich stephenweinrich

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
</head>
<body>
<div id="bot" />
<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
<script>
BotChat.App({
@stephenweinrich
stephenweinrich / environment.tf
Last active January 3, 2019 14:55
terraform azure configuration
variable "subscription_id" {}
variable "client_id" {}
variable "client_secret" {}
variable "tenant_id" {}
variable "environment" {}
# Configure the Azure Provider
provider "azurerm" {
subscription_id = "${var.subscription_id}"
client_id = "${var.client_id}"
@stephenweinrich
stephenweinrich / config.dev01.tfvars
Last active June 29, 2018 16:56
config.dev01.tfvars
subscription_id = "<--paste-your-subscription-id-here-->"
client_id = "<--paste-your-client-id-here-->"
tenant_id = "<--paste-your-tenant-id-here-->"
client_secret = "<--paste-your-secret-here-->"
environment = "dev01"
@stephenweinrich
stephenweinrich / environment.tf
Last active June 29, 2018 20:26
terraform asp and as
# Create App Service Plans
resource "azurerm_app_service_plan" "app-service-plan-westus" {
name = "asp-westus-contoso-${var.environment}"
location = "${azurerm_resource_group.resource-group-westus.location}"
resource_group_name = "${azurerm_resource_group.resource-group-westus.name}"
sku {
tier = "Free"
size = "F1"
}
@stephenweinrich
stephenweinrich / environment.tf
Last active August 6, 2018 19:36
vnet, subnet and pip
# Create Vnets
resource "azurerm_virtual_network" "vnet_west" {
name = "vnet-westus-contoso-${var.environment}"
resource_group_name = "${azurerm_resource_group.resource-group-westus.name}"
location = "${azurerm_resource_group.resource-group-westus.location}"
address_space = ["10.0.0.0/16"]
}
resource "azurerm_virtual_network" "vnet_east" {
name = "vnet-eastus-contoso-${var.environment}"
@stephenweinrich
stephenweinrich / environment.tf
Last active July 12, 2018 17:38
app gateways
# Create Application Gateways
resource "azurerm_application_gateway" "application-gateway-west" {
name = "ag-westus-contoso-${var.environment}"
resource_group_name = "${azurerm_resource_group.resource-group-westus.name}"
location = "${azurerm_resource_group.resource-group-westus.location}"
sku {
name = "WAF_Medium"
tier = "WAF"
capacity = 2
@stephenweinrich
stephenweinrich / environment.tf
Last active July 12, 2018 16:25
traffic manager
# Create Traffic Manager API Profile
resource "azurerm_traffic_manager_profile" "traffic-manager" {
name = "tm-global-contoso-${var.environment}"
resource_group_name = "${azurerm_resource_group.resource-group-global.name}"
traffic_routing_method = "Performance"
dns_config {
relative_name = "tm-global-contoso-${var.environment}"
ttl = 300
}
# Signing into azure with principal account
$clientID = "<--client-id-->"
$key= "<--secret-key-->"
$SecurePassword = $key | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential ` -argumentlist $clientID, $SecurePassword
Add-AzureRmAccount -Credential $cred -Tenant "<--tenant-id-->" -ServicePrincipal
# Selecting Subscription
Select-AzureRmSubscription "<--subscription-id-->"
@stephenweinrich
stephenweinrich / restrict-ip.ps1
Created July 12, 2018 18:05
app service IP restriction
# Signing into azure with principal account
$clientID = "<--client-id-->"
$key= "<--secret-key-->"
$SecurePassword = $key | ConvertTo-SecureString -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential ` -argumentlist $clientID, $SecurePassword
Add-AzureRmAccount -Credential $cred -Tenant "<--tenant-id-->" -ServicePrincipal
# Selecting Subscription
Select-AzureRmSubscription "<--subscription-id-->"