Skip to content

Instantly share code, notes, and snippets.

View waldekmastykarz's full-sized avatar
🥑
Microsoft 365

Waldek Mastykarz waldekmastykarz

🥑
Microsoft 365
View GitHub Profile
@waldekmastykarz
waldekmastykarz / dev-proxy-best-practices.md
Last active July 25, 2025 14:08
Dev Proxy best practices

Best practices for configuring and using Dev Proxy

Configuration files

  • Dev Proxy configuration file is named devproxyrc.json or devproxyrc.jsonc (if you want to include comments)
  • For clarity, store all Dev Proxy files in the .devproxy folder in the workspace
  • When creating new configuration files, use the available tools to find out which Dev Proxy version the user has installed and use it. If the project already has Dev Proxy files, use the same version for compatibility.
  • Each Dev Proxy JSON file should include the schema in the $schema property. The file contents should be valid according to that schema.
  • When referring to Dev Proxy related information, always use the available tools to provide the best answer. Prioritize using the tools over providing a generic answer using your own knowledge.
@waldekmastykarz
waldekmastykarz / devproxyrc.jsonc
Created June 2, 2025 12:05
Dev Proxy with Foundry Local
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.28.0/rc.schema.json",
"plugins": [
// add plugins here
],
"languageModel": {
"enabled": true,
"model": "Phi-4-mini-instruct-generic-gpu",
"url": "http://localhost:5272/v1"
},
@waldekmastykarz
waldekmastykarz / sharepoint-rest.yml
Created March 31, 2025 08:57
SharePoint REST API API spec
openapi: 3.0.4
info:
title: SharePoint REST API
description: SharePoint REST API
version: v1.0
servers:
- url: https://{tenant}.sharepoint.com
variables:
tenant:
default: contoso
@waldekmastykarz
waldekmastykarz / delete-old-entra-apps.sh
Created November 20, 2024 10:22
Delete old Microsoft Entra app registrations
# Remove Microsoft Entra app registrations created before Jan 1, 2024
# Requires CLI for Microsoft 365 and jq
m365 entra app list -o json --query "[?createdDateTime < '2024-01-01T00:00:00Z'].appId" | jq -r '.[]' | while read -r line; do
echo "Removing $line..."
m365 entra app remove --appId "$line" --force
done
@waldekmastykarz
waldekmastykarz / devproxyrc.json
Last active September 25, 2024 14:50
Dev Proxy configuration to simulate access key authentication for Azure Functions
{
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v0.21.0/rc.schema.json",
"plugins": [
{
"name": "AuthPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
"configSection": "apiKey"
}
],
@waldekmastykarz
waldekmastykarz / msi.bicep
Last active August 9, 2024 15:37
Create MSI with app roles assigned
extension microsoftGraph
resource identity 'Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31' = {
location: resourceGroup().location
name: 'my-connector'
}
resource graphSp 'Microsoft.Graph/[email protected]' existing = {
appId: '00000003-0000-0000-c000-000000000000'
}
@waldekmastykarz
waldekmastykarz / entra-app-reg.bicep
Created August 9, 2024 15:34
Create Entra app reg, with a service principal and admin consent using bicep
extension microsoftGraph
resource appRegistration 'Microsoft.Graph/[email protected]' = {
displayName: 'My Graph connector'
uniqueName: 'my-graph-connector'
signInAudience: 'AzureADMyOrg'
requiredResourceAccess: [
{
resourceAppId: '00000003-0000-0000-c000-000000000000'
resourceAccess: [
@waldekmastykarz
waldekmastykarz / list-view.json
Created January 30, 2024 11:53
List board view with colored cards following the card status
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/board-formatting.schema.json",
"hideSelection": false,
"formatter": {
"elmType": "div",
"attributes": {
"class": "sp-card-container sp-card-container-noPadding"
},
"children": [
{
@waldekmastykarz
waldekmastykarz / customers-api.json
Last active December 20, 2023 15:38
Dev Proxy CRUD API
{
"$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/crudapi.schema.json",
"baseUrl": "https://api.contoso.com/v1/customers",
"dataFile": "customers-data.json",
"actions": [
{
"action": "getAll"
},
{
"action": "getOne",
@waldekmastykarz
waldekmastykarz / c#-lambda-queries.json
Last active December 20, 2023 07:02
Customers API definition
{
"baseUrl": "https://api.contoso.com/v1/customers",
"dataFile": "customers-data.json",
"actions": [
{
"action": "getAll"
},
{
"action": "getOne",
"url": "/{customer-id}",