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
-- Right click copy and paste | |
config.mouse_bindings = { | |
{ | |
event = { Down = { streak = 1, button = "Right" } }, | |
mods = "NONE", | |
action = wezterm.action_callback(function(window, pane) | |
local has_selection = window:get_selection_text_for_pane(pane) ~= "" | |
if has_selection then | |
window:perform_action(act.CopyTo("ClipboardAndPrimarySelection"), pane) |
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
using Microsoft.EntityFrameworkCore; | |
var customers = new List<Customer>(); | |
for (int i = 0; i < 20; i++) | |
{ | |
customers.Add(new Customer(i, i % 5, i * 2)); | |
} | |
using (var context = new AppDbContext()) | |
{ |
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
## Get an access token using standard cli functionality | |
data "external" "token" { | |
program = ["az", "account", "get-access-token"] | |
} | |
## Put the access token in a local variable for ease of use | |
locals { | |
accessToken = data.external.token.result["accessToken"] | |
} |
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
$downstreamApp = az ad app list --all --query "[?displayName=='$downstreamServiceName']" | ConvertFrom-Json | |
if (!$downstreamApp) { | |
throw "The app registration $downstreamServiceName does not exist." | |
} | |
# Get the downstream app scopes | |
$downstreamAppScopes = az ad app show --id $downstreamApp.appId --query "api.oauth2PermissionScopes" | ConvertFrom-Json | |
# Get the id and name of the first scope (using the first because we have just one and it's usually the user_impersonation scope) | |
$scopeName = $downstreamAppScopes[0].value |
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
{ | |
"Scopes": [ | |
{ | |
"adminConsentDescription": "Allows the app to read the available Teams templates, on behalf of the signed-in user.", | |
"adminConsentDisplayName": "Read available Teams templates", | |
"id": "cd87405c-5792-4f15-92f7-debc0db6d1d6", | |
"isEnabled": true, | |
"type": "User", | |
"userConsentDescription": "Read available Teams templates, on your behalf.", | |
"userConsentDisplayName": "Read available Teams templates", |
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
Executed DbCommand (37ms) [Parameters=[@p0='?' (Size = 4000)], CommandType='Text', CommandTimeout='30'] | |
SET IMPLICIT_TRANSACTIONS OFF; | |
SET NOCOUNT ON; | |
INSERT INTO [Blogs] ([Name]) | |
OUTPUT INSERTED.[Id] | |
VALUES (@p0); | |
Executed DbCommand (17ms) [Parameters=[@p0='?' (DbType = Int32), @p1='?' (Size = 4000), @p2='?' (DbType = DateTimeOffset), @p3='?' (Size = 4000), @p4='?' (DbType = Int32), @p5='?' (Size = 4000), @p6='?' (DbType = DateTimeOffset), @p7='?' (Size = 4000)], CommandType='Text', CommandTimeout='30'] | |
SET IMPLICIT_TRANSACTIONS OFF; | |
SET NOCOUNT ON; |
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
No deployment in progress | |
wrk -t8 -c32 -d2m --latency --timeout 5s https://xxxxxxxxxxxxxxxxxx.azurecontainerapps.io/api/echo/ping | |
Running 2m test @ https://xxxxxxxxxxxxxxxxxx.azurecontainerapps.io/api/echo/ping | |
8 threads and 32 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 36.48ms 31.84ms 216.95ms 72.82% | |
Req/Sec 126.06 26.67 250.00 75.33% | |
Latency Distribution | |
50% 14.21ms |
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
#!/bin/bash | |
rg=<your resource group name here> | |
app=<your container app name here> | |
baseimage=<your acr name here>.azurecr.io/<your repository name here> | |
tag=<your image tag here> | |
host=<your deployment app host here> | |
url=http://$host/resource-groups/$rg/apps/$app/deploy | |
echo "Starting deployment at: $url" | |
curl --get --data-urlencode imageName=$baseimage:$tag $url |
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
$errorActionPreference = "Stop" | |
Write-Output "--- Connecting to Azure using MSI..." | |
Connect-AzAccount -Identity | |
Write-Output "--- Reading variables...." | |
$rg = Get-AutomationVariable -Name 'rg-name' | |
$servicePlan = Get-AutomationVariable -Name 'service-plan-name' | |
$sk = Get-AutomationVariable -Name 'scale-down-sku' |
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 "azapi_resource" "aca-test-environment" { | |
name = "aca-test-environment" | |
type = "Microsoft.App/managedEnvironments@2022-03-01" | |
location = var.location | |
parent_id = azurerm_resource_group.aca-test-rg.id | |
body = jsonencode({ | |
properties = { | |
appLogsConfiguration = { | |
destination = "log-analytics" | |
logAnalyticsConfiguration = { |
NewerOlder