Skip to content

Instantly share code, notes, and snippets.

View paulyuk's full-sized avatar

Paul Yuknewicz paulyuk

View GitHub Profile
@paulyuk
paulyuk / redis.yaml
Created July 23, 2024 21:14
redis.yaml that works with `dapr init -k --dev`
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
spec:
type: state.redis
version: v1
metadata:
# These settings will work out of the box if you use `helm install
# bitnami/redis`. If you have your own setup, replace

How to - Securing your Azure Function

Paul's secret mision "do this, and dont do that"

Using indentity

Using identity for AzureWebJobsStorage

Using identity for Bindings

Using identity for Deployment

Networking

Setting up vnet in your function app

@paulyuk
paulyuk / flex-commands.md
Last active June 25, 2024 19:27
NDC Oslo 2024 Snippets

NDC Oslo 2024 Snippets for Functions Under the Hood at Scale

Configuring scale

General command to set

az functionapp scale config set --resource-group <RESOURCE_GROUP> --name <APP_NAME> --trigger-type http --trigger-settings perInstanceConcurrency=10

e.g. set to 2 events per instance

@paulyuk
paulyuk / function-user-identity-101.md
Last active June 7, 2024 19:37
Converting a Function App to Managed Identity - 101

Converting a Function App to Managed Identity - 101

Overview

This shows how to take a simple Function App (e.g. the output of our client tools templates for a trigger or binding) or a simple sample and "modernize" it from using ConnectionStrings and secrets in favor of Managed Identity and RBAC.

Assumptions

  • User-assigned managed identity is prefered. Beware if you do not select an identity to use in code (ClientId), it will default to system assigned.
  • local development will make Connections to local emulators if they exist, and otherwise will make remote cloud connections to resource using identity based connections. Some resources like Service Bus, AI Cognitive, Open AI, and Datalake will
@paulyuk
paulyuk / flex-scaling-notes.md
Last active June 13, 2024 14:54
Flex Consumption Scaling Under the Hood Notes
@paulyuk
paulyuk / gist:c0a6ad7fd125a931c66788f57d205800
Created April 3, 2024 15:16
Flex beta function - from Portal (eastasia)
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"sites_py_flex_beta_function2_name": {
"defaultValue": "py-flex-beta-function2",
"type": "String"
},
"serverfarms_py_flex_beta_function2FlexPlan_externalid": {
"defaultValue": "/subscriptions/ca5ce512-88e1-44b1-97c6-22caf84fb2b0/resourceGroups/py-flex-beta-2/providers/Microsoft.Web/serverfarms/py-flex-beta-function2FlexPlan",
@paulyuk
paulyuk / azurefunctionsps.md
Last active June 20, 2023 21:00
Install tools for Azure Functions PowerShell prerelease

PowerShell

install latest - 7.3

winget search Microsoft.PowerShell
winget install --id Microsoft.Powershell

or alternatively:

OPTIONAL install PowerShell preview - 7.4

@paulyuk
paulyuk / install-functions-apple-silicon.md
Last active June 7, 2023 03:08
Install Function Core Tools (func cli) on Apple Silicon

one-time setup

set this alias, and/or insert at the end of your ~/.zshrc file

alias intel="env /usr/bin/arch -x86_64 /bin/zsh --login" 

start every development session in intel to be safe

intel
arch
@paulyuk
paulyuk / install-unsigned-func-cli.md
Last active May 19, 2023 20:58
Install unsigned functions core tools CLI
  1. unzip the tools that match your OS and Arch, and copy to your usr folder ~/funccli/Azure.Functions.Cli.osx-x64.4.0.5194

  2. make the func cli executable

cd ~/funccli/Azure.Functions.Cli.osx-x64.4.0.5194
chmod +x func
  1. run func cli in this folder
./func version
@paulyuk
paulyuk / get-dapr-latest.md
Last active February 27, 2024 18:31
Create a Dapr dev environment with the latest OSS version