Skip to content

Instantly share code, notes, and snippets.

View paulyuk's full-sized avatar

Paul Yuknewicz paulyuk

View GitHub Profile
@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 September 23, 2024 10:11
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
@paulyuk
paulyuk / gist:85d59f0cd0d16036a147121c8c69b17e
Last active May 30, 2024 14:31
Installing x64 Azure Functions CLI (Core Tools) on Mac M1 ARM64
# First uninstall any existing Core Tools
brew uninstall azure-functions-core-tools@4
# Install x64 Intel Brew tools in an alternate path
# Follow: https://medium.com/mkdir-awesome/how-to-install-x86-64-homebrew-packages-on-apple-m1-macbook-54ba295230f
# Copy next SIX lines into bottom of your ~/.zshrc file and then restart Terminal
# need this for x86_64 brew
export PATH=$HOME/bin:/usr/local/bin:$PATH
# for intel x86_64 brew
@paulyuk
paulyuk / diagnose-docker-pull.sh
Created November 14, 2022 20:31
Diagnose docker pull on network
curl --request GET --url https://mcr.microsoft.com/v2/dotnet/aspnet/manifests/sha256:fd2378d2cf94cb60c7bcccf176c3175151827b4d2d99ae9e94f991478e1c70d1 --header 'Accept: application/vnd.docker.distribution.manifest.v2+json' --user-agent "mcrafdinvestiongation1" -v
curl --request GET --url https://mcr.microsoft.com/v2/dotnet/aspnet/blobs/sha256:dd6189d6fc13cb03db0f4a3d9659b6b6044fd5858019d659001eaf8367584d67 --header 'Accept: application/vnd.docker.image.rootfs.diff.tar.gzip' --user-agent "mcrafdinvestiongation1" -v
curl --request GET --url https://eastus.data.mcr.microsoft.com/aba285c624a04409823b708c7a50e7b9-jttfjm99vo//docker/registry/v2/blobs/sha256/dd/dd6189d6fc13cb03db0f4a3d9659b6b6044fd5858019d659001eaf8367584d67/data\?se\=2022-11-14T19%3A49%3A14Z\&amp\;sig\=juQIf7%2FhRfWKjdYEqKGxzn1W7JvjsOeGpLUirhLv9oI%3D\&amp\;sp\=r\&amp\;spr\=https\&amp\;sr\=b\&amp\;sv\=2016-05-31\&amp\;regid\=aba285c624a04409823b708c7a50e7b9 --user-agent "mcrafdinvestiongation1" -v --output dockerlayer.tar
@paulyuk
paulyuk / servicebus-topic.bicep
Last active July 7, 2022 00:17
Service Bus Topic and deadletter Bicep
param resourceToken string
param location string
param skuName string = 'Standard'
param topicName string = 'orders'
resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2018-01-01-preview' = {
name: 'sb-${resourceToken}'
location: location
sku: {
name: skuName