This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Disable automatic sleep on AC only | |
| # Run this as Administrator | |
| Write-Host "Disabling automatic sleep when on AC..." -ForegroundColor Cyan | |
| # AC power (plugged in) | |
| powercfg /change standby-timeout-ac 0 | |
| # Battery power | |
| # powercfg /change standby-timeout-dc 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Disable IPv6 on all network adapters (including VPNs) | |
| # Run this script as Administrator | |
| # you may need to run this first: | |
| # Set-ExecutionPolicy RemoteSigned -Scope Process -Force | |
| # this is to run it | |
| # .\disable-ipv6.ps1 | |
| # this is full-blown automation...runs when you login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RESOURCE_GROUP=blah | |
| STORAGE_NAME=blah234234234 | |
| APP_NAME=blahfunc | |
| ACR=blahacr | |
| az login | |
| # make sure you are connected to the right subscription (IsDefault = True) | |
| az account list --output table | |
| az group create --name $RESOURCE_GROUP --location eastus2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "scriptFile": "__init__.py", | |
| "bindings": [ | |
| { | |
| "type": "eventHubTrigger", | |
| "name": "event", | |
| "direction": "in", | |
| "eventHubName": "ch-7-eventhub", | |
| "connection": "myEventHubReadConnectionAppSetting", | |
| "cardinality": "many", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import json | |
| import uuid | |
| import azure.functions as func | |
| def main(event: func.EventHubEvent, doc: func.Out[func.Document]): | |
| message = event.get_body().decode('utf-8') | |
| logging.info('Python EventHub trigger processed an event: %s', message) | |
| sale_events = json.loads(message) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import azure.functions as func | |
| import json | |
| def main(req: func.HttpRequest, ratings: func.DocumentList) -> func.HttpResponse: | |
| if ratings.count == 0: | |
| return func.HttpResponse( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import azure.functions as func | |
| from jsonschema import validate, ValidationError | |
| import requests | |
| import uuid | |
| import time | |
| import json | |
| def main(req: func.HttpRequest, ratings: func.Out[func.Document]) -> func.HttpResponse: | |
| schema = { |