Skip to content

Instantly share code, notes, and snippets.

View xximjasonxx's full-sized avatar

Jason Farrell xximjasonxx

View GitHub Profile
@xximjasonxx
xximjasonxx / main.tf
Created February 24, 2019 04:34
Terraform - Project01 - Azure App Service Def
resource "azurerm_app_service" "test" {
name = "test-service123456789"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
app_service_plan_id = "${azurerm_app_service_plan.test.id}"
app_settings {
WEBSITES_ENABLE_APP_SERVICE_STORAFE = false
DOCKER_REGISTRY_SERVER_URL = "${data.azurerm_container_registry.test.login_server}"
DOCKER_REGISTRY_SERVER_USERNAME = "${data.azurerm_container_registry.test.admin_username}"
@xximjasonxx
xximjasonxx / edi.json
Created February 26, 2019 16:08
JSON Gist
[{"WorkOrderLineItems":[],"Record":{"attributes":{"type":"WorkOrder","url":"/services/data/v45.0/sobjects/WorkOrder/0WO3D00000015cvWAA"},"Id":"0WO3D00000015cvWAA","OwnerId":"00G3D000000rqtVUAQ","IsDeleted":false,"WorkOrderNumber":"WO-4698","RecordTypeId":"0123D000000N4laQAC","CreatedDate":"2018-11-06T21:51:53.000+0000","CreatedById":"0051W000004sGPGQA2","LastModifiedDate":"2019-01-28T19:31:25.000+0000","LastModifiedById":"0053D000000wQuXQAU","SystemModstamp":"2019-01-28T19:31:25.000+0000","Address":null,"RootWorkOrderId":"0WO3D00000015cvWAA","Status":"Received","Priority":"Low","Subtotal":0.00,"TotalPrice":0.00,"LineItemCount":6,"Discount":0.00,"GrandTotal":0.00,"IsClosed":false,"DurationType":"Hours","ServiceAppointmentCount":0,"StatusCategory":"New","IsGeneratedFromMaintenancePlan":false,"FSL__IsFillInCandidate__c":true,"FSL__Prevent_Geocoding_For_Chatter_Actions__c":false,"FSL__Scheduling_Priority__c":4,"Market__c":"0Hh3D00000000zrSAA","WorkOrderNumberExternalID__c":"WO-4698","PickupClientLocationName__c":
@xximjasonxx
xximjasonxx / main.tf
Created March 26, 2019 03:07
Portion of Terraform file that dictates provider and backend storage of state
provider "azurerm" {
version = "=1.22.0"
}
terraform {
backend "azurerm" {
resource_group_name = "ListApp-General"
storage_account_name = "listapptfstatestorage"
container_name = "tfstate"
key = "listapp-feedservice"
@xximjasonxx
xximjasonxx / main.tf
Created March 26, 2019 03:14
Complete TF file
provider "azurerm" {
version = "=1.22.0"
}
terraform {
backend "azurerm" {
resource_group_name = "ListApp-General"
storage_account_name = "listapptfstatestorage"
container_name = "tfstate"
key = "listapp-feedservice"
apiVersion: v1
kind: Namespace
metadata:
name: kube-demo
FROM mcr.microsoft.com/dotnet/core/sdk:2.2.203 as build
WORKDIR /code
COPY . .
RUN dotnet restore
RUN dotnet publish -o output -c Release
FROM mcr.microsoft.com/dotnet/core/runtime:2.2 as runtime
WORKDIR /app
COPY --from=build /code/output ./
FROM mcr.microsoft.com/dotnet/core/sdk:2.2.203 as build
WORKDIR /code
COPY . .
RUN dotnet restore
RUN dotnet publish -o output -c Release
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 as runtime
WORKDIR /app
COPY --from=build /code/output ./
apiVersion: apps/v1
kind: Deployment
metadata:
name: stockapi-deployment
namespace: kube-demo
labels:
app: stockapi
spec:
replicas: 3
selector:
@xximjasonxx
xximjasonxx / main.tf
Created July 5, 2019 21:53
Azure Function v2 Resource Block
resource "azurerm_function_app" "main" {
name = "${var.resource-prefix}-analyticsapp"
location = "${azurerm_resource_group.main.location}"
resource_group_name = "${azurerm_resource_group.main.name}"
app_service_plan_id = "${azurerm_app_service_plan.main.id}"
storage_connection_string = "${azurerm_storage_account.main.primary_connection_string}"
version = "~2"
app_settings {
FUNCTIONS_EXTENSION_VERSION = "~2"
using CalcApi.Models;
using Microsoft.AspNetCore.Mvc;
namespace CalcApi.Controllers
{
[Route("api/calc")]
[ApiController]
public class CalcController : ControllerBase
{