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 / declare-blob-sink-for-schema-registry.cs
Last active Oct 17, 2020
Introduction to Schema Registry for Azure Messaging Service
View declare-blob-sink-for-schema-registry.cs
// Declare the main schema registry
var mainConnectionString = "AZURE_MAIN_STORAGE_CONNECTION_STRING";
var mainBlobClient = CloudStorageAccount.Parse(mainConnectionString)
.CreateCloudBlobClient();
var mainBlobBaseUri = "AZURE_MAIN_BLOB_STORAGE_BASE_URI";
var mainSchemaContainer = "schemas";
var mainSink = new BlobStorageSchemaSink(mainBlobClient)
.WithBaseLocation(mainBlobBaseUri)
.WithContainer(mainSchemaContainer);
@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
@justinyoo
justinyoo / local-settings.json
Last active Sep 15, 2020
Introducing Swagger UI on Azure Functions
View local-settings.json
{
"IsEncrypted": false,
"Values": {
...
"OpenApi__Info__Version": "2.0.0",
"OpenApi__Info__Title": "Open API Sample on Azure Functions",
"OpenApi__Info__Description": "A sample API that runs on Azure Functions either 1.x or 2.x using Open API specification.",
"OpenApi__Info__TermsOfService": "https://github.com/aliencube/AzureFunctions.Extensions",
"OpenApi__Info__Contact__Name": "Aliencube Community",
"OpenApi__Info__Contact__Email": "no-reply@aliencube.org",
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);
});
}
You can’t perform that action at this time.