Skip to content

Instantly share code, notes, and snippets.

View justinyoo's full-sized avatar

Justin Yoo justinyoo

View GitHub Profile
@justinyoo
justinyoo / 01-get-inbound-ip-address.ps1
Last active October 26, 2020 13:02
Updating Azure DNS and SSL Certificate on Azure Functions via Github Actions
$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 September 30, 2020 09:13
3 Ways Mapping APEX Domains to Azure Functions
$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 September 20, 2020 13:59
GitHub Actions and ARM Template Toolkit to Test Bicep Codes
bicep build **/*.bicep
@justinyoo
justinyoo / 01-arm-template.json
Last active September 3, 2020 03:41
Bicep Sneak Peek
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": {},
"variables": {},
"resources": [],
"outputs": {}
}
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 August 18, 2020 03:31
Remote Controlling Home Appliances Using Raspberry PI and Power Platform
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 July 26, 2021 12:30
Turning Raspberry PI into Remote Controller
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install lirc -y
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic
WORKDIR /home/
COPY . .
RUN bash ./setup.sh
@justinyoo
justinyoo / 01-feed-reader.cs
Last active February 8, 2021 07:42
Creating Custom Connector from Azure Functions with Swagger
namespace FeedReaders.FunctionApp
{
public static class FeedReaderHttpTrigger
{
[FunctionName(nameof(FeedReaderHttpTrigger.GetFeedItemsAsync))]
public static async Task<IActionResult> GetFeedItemsAsync(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "feeds/items")] HttpRequest req,
ILogger log)
{
...
@justinyoo
justinyoo / 01-azfuncopenapi.ps1
Created July 7, 2020 15:05
Generating Open API Document for Azure Functions in Command-Line
# PowerShell Console
azfuncopenapi `
--project <PROJECT_PATH> `
--configuration Debug `
--target netcoreapp2.1 `
--version v2 `
--format json `
--output output `
--console false