Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Yoo justinyoo

View GitHub Profile
@justinyoo
justinyoo / 01-v1-legacy.cs
Created Nov 10, 2020
Open API Extension to Support Azure Functions v1
View 01-v1-legacy.cs
namespace MyV1LegacyFunctionApp
{
public static class LoremIpsumHttpTrigger
{
[FunctionName("LoremIpsumHttpTrigger")]
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Function, "GET", Route = "lorem/ipsum")] HttpRequestMessage req,
ILogger log)
{
var content = new MyReturnObject();
@justinyoo
justinyoo / 01-az-func-deploy.yaml
Created Nov 4, 2020
Deploying Azure Functions via GitHub Actions without Publish Profile
View 01-az-func-deploy.yaml
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
...
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output'
@justinyoo
justinyoo / 01-get-inbound-ip-address.ps1
Last active Oct 26, 2020
Updating Azure DNS and SSL Certificate on Azure Functions via Github Actions
View 01-get-inbound-ip-address.ps1
$AppResourceGroupName = "[RESOURCE_GROUP_NAME_FOR_AZURE_FUNCTION_APP]"
AppName = "[NAME_OF_AZURE_FUNCTION_APP]"
$app = Get-AzResource `
-ResourceType Microsoft.Web/sites `
-ResourceGroupName $AppResourceGroupName `
-ResourceName $AppName
$newIp4Address = $app.Properties.inboundIpAddress
@justinyoo
justinyoo / 01-set-azwebapp.ps1
Last active Sep 30, 2020
3 Ways Mapping APEX Domains to Azure Functions
View 01-set-azwebapp.ps1
$resourceGroupName = "<RESOURCE_GROUP_NAME>"
$functionAppName = "<FUNCTION_APP_NAME>"
$domainName = "contoso.com"
Set-AzWebApp `
-ResourceGroupName $resourceGroupName `
-Name $functionAppName `
-HostNames @( $domainName, "$functionAppName.azurewebsites.net" )
@justinyoo
justinyoo / 01-bicep-build.ps1
Created Sep 20, 2020
GitHub Actions and ARM Template Toolkit to Test Bicep Codes
View 01-bicep-build.ps1
bicep build **/*.bicep
View 01-arm-template.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": {},
"variables": {},
"resources": [],
"outputs": {}
}
View 01-create-resource.txt
Set(request, "{ 'deploymentName': '" & DeploymentName.Text & "', 'resourceGroupName': '" & ResourceGroupName.Text & "', 'vmName': '" & VMName.Text & "', 'vmAdminUsername': '" & VMAdminUsername.Text & "', 'vmAdminPassword': '" & VMAdminPassword.Text & "' }");
ClearCollect(result, CreateResource.Run(request))
@justinyoo
justinyoo / 01-remote.js
Created Aug 18, 2020
Remote Controlling Home Appliances Using Raspberry PI and Power Platform
View 01-remote.js
let lirc_node = require('lirc_node');
lirc_node.init();
const remote = (device, command) => {
lirc_node.irsend.send_once(device, command, () => {
console.log(command);
});
}
@justinyoo
justinyoo / 01-install-lirc.sh
Last active Aug 18, 2020
Turning Raspberry PI into Remote Controller
View 01-install-lirc.sh
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install lirc -y
View 01-dockerfile.txt
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic
WORKDIR /home/
COPY . .
RUN bash ./setup.sh
You can’t perform that action at this time.