View iobindingfunction.py
from io import BytesIO | |
from logging import FileHandler | |
import logging | |
import azure.functions as func | |
from PIL import Image | |
def main(msg: func.QueueMessage, inputblob: func.InputStream, | |
outputblob: func.Out[func.InputStream]) -> None: | |
blob_source_raw_name = msg.get_body().decode('utf-8') |
View function.json
{ | |
"scriptFile": "__init__.py", | |
"bindings": [ | |
{ | |
"name": "msg", | |
"type": "queueTrigger", | |
"direction": "in", | |
"queueName": "images", | |
"connection": "customserverless01_STORAGE" | |
}, |
View JpegUploadRouter.cs
using System; | |
using System.IO; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Host; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.WindowsAzure.Storage.Blob; | |
namespace Siliconvalve.Demo | |
{ | |
public static class JpegUploadRouter |
View Get-AzureIPRangeFile.ps1
$fileDate = Get-Date -Format "yyyy-MM-dd-HH-mm" | |
$urlDownload = (Invoke-WebRequest https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519 -UseBasicParsing).Links | Where-Object {$_.href -Match "ServiceTags"} | Select-Object -Property href -First 1 | |
Invoke-WebRequest $urlDownload.href -OutFile "$fileDate.json" |
View deploy-thumbnail-k8s.yaml
data: | |
AzureWebJobsStorage: XXXXX | |
FUNCTIONS_WORKER_RUNTIME: XXXX | |
kedademo01_STORAGE: XXXXX | |
VIDEOCONTAINER: XXXXX | |
THUMBNAILCONTAINER: XXXX | |
VIDEOFILESTORAGE: XXXXX | |
STORAGE_ACCOUNT_NAME: XXXX | |
ACCOUNT_ACCESS_KEY: XXXXX | |
apiVersion: v1 |
View sample.workflow
workflow "Publish to App Service" { | |
on = "push" | |
resolves = ["Deploy to Web App"] | |
} | |
action "Azure Login" { | |
uses = "Azure/github-actions/login@master" | |
env = { | |
AZURE_SUBSCRIPTION = "YOUR_AZURE_SUBSCRIPTION_NAME" | |
} |
View createlinuxappservice.sh
#!/bin/bash | |
# Based on: https://docs.microsoft.com/en-us/azure/app-service/scripts/cli-linux-docker-aspnetcore#sample-script | |
# Variables | |
appName=$1 | |
appPlanName="${appName}plan" | |
resGroupName=$2 | |
location="WestUS2" |
View build-deploy-python-func.yaml
resources: | |
- repo: self | |
queue: | |
name: Hosted Ubuntu 1604 | |
variables: | |
FunctionFolder: '**yourfoldername**' | |
FunctionAppName: '**yourfunctionname**' | |
steps: | |
- task: DotNetCoreInstaller@0 | |
displayName: 'Use .NET Core sdk 2.1.502' |
View build-deploy-python-func.sh
# | |
# Build and deploy Python Azure Function v2 (preview) on Azure DevOps | |
# | |
# Paste this as an inline script into an "Azure CLI" Build Task running on an Ubuntu 16.04 managed host. | |
# | |
# Set Build Variables: | |
# | |
# FunctionFolder = name of folder containing your Function | |
# FunctionAppName = name of the target Azure Function that will receive the deployment. |
View migrate-static-web-content.sh
#!/bin/bash | |
resourcegroup=$1 | |
demolocation=$2 | |
storageacctname=$3 | |
##### | |
# Setup AWS | |
##### |
NewerOlder