Skip to content

Instantly share code, notes, and snippets.

View Jeroen-VdB's full-sized avatar

Jeroen VdB Jeroen-VdB

View GitHub Profile
@Jeroen-VdB
Jeroen-VdB / DeleteADB2CUsers.ps1
Created November 30, 2023 14:51
Delete thousands of AD B2C users. When, for example, you want to delete your B2C tenant. Delete bulk operation via Excel upload did not always work for me, so I looked for another more automated method.
if (Get-Module -ListAvailable -Name Microsoft.Graph) {
Write-Host "Module Microsoft.Graph exists."
}
else {
throw "Module Microsoft.Graph is not installed yet. Please install it first! Run 'Install-Module Microsoft.Graph'."
}
$B2CTenantName = "REPLACE-WITH-YOUR-B2C-TENANT-NAME"
$AdminName = "REPLACE-WITH-YOUR-ADMIN-NAME"
@Jeroen-VdB
Jeroen-VdB / Client.Class.BeforeSend.liquid
Created December 8, 2021 11:12
NSwag CSharp Client GZip template
request_.Content = new System.Net.Http.ByteArrayContent(Compress(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)));
@Jeroen-VdB
Jeroen-VdB / appsettings.json
Created October 25, 2021 13:55
Logging Formatter for AKS Log Analytics
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
},
"Console": {
"FormatterName": "json",
"FormatterOptions": {
@Jeroen-VdB
Jeroen-VdB / logic-app-callback-url.bicep
Last active January 18, 2022 17:00
A Logic App Bicep template with a HTTP GET trigger. The generated URL will be returned as an output.
// az deployment group create -g 'my-resource-group' -f logic-app-callback-url.bicep
param location string = resourceGroup().location
param appNameSuffix string = 'my-logic-app-name'
var logicAppName = 'la-${appNameSuffix}'
resource myLogicApp 'Microsoft.Logic/workflows@2017-07-01' = {
name: logicAppName
location: location
@Jeroen-VdB
Jeroen-VdB / Atlassian.JiraServiceDesk.v1.nswag
Created June 10, 2020 13:28
Swag configuration file to generate a client for the Jira Service Desk REST API. Based on https://developer.atlassian.com/cloud/jira/service-desk/swagger.v3.json (version: 1001.0.0-SNAPSHOT) ! Removed POST /rest/servicedeskapi/servicedesk/{serviceDeskId}/attachTemporaryFile due to a generation error in NSwag with a binary request body !
{
"runtime": "NetCore31",
"defaultVariables": null,
"documentGenerator": {
"fromDocument": {
"json": "{\r\n \"openapi\": \"3.0.1\",\r\n \"info\": {\r\n \"title\": \"Service Desk Public REST API\",\r\n \"description\": \"Public REST API for Jira Service Desk\",\r\n \"termsOfService\": \"https://www.atlassian.com/legal/customer-agreement\",\r\n \"version\": \"1001.0.0-SNAPSHOT\"\r\n },\r\n \"servers\": [\r\n {\r\n \"url\": \"https://your-domain.atlassian.net\"\r\n }\r\n ],\r\n \"tags\": [\r\n {\r\n \"name\": \"Customer\"\r\n },\r\n {\r\n \"name\": \"Info\"\r\n },\r\n {\r\n \"name\": \"Knowledgebase\"\r\n },\r\n {\r\n \"name\": \"Organization\"\r\n },\r\n {\r\n \"name\": \"Request\"\r\n },\r\n {\r\n \"name\": \"Requesttype\"\r\n },\r\n {\r\n \"name\": \"Servicedesk\"\r\n }\r\n ],\r\n \"paths\": {\r\n \"/rest/servicedeskapi/customer\": {\r\n \"post\": {\r\n \"tags\": [\r\n
@Jeroen-VdB
Jeroen-VdB / DeployIntegrationAccountSchemasAndMaps.ps1
Last active June 10, 2020 13:29
Creats or updates schemas and maps from a local source to an Integration Account. Deploy from a location where the schemas and maps are located in their subfolders.
Param(
[string] $ResourceGroupName = "MYDEFAULTRESOURCEGROUPNAME",
[string] $IntegrationAccountName = "MYDEFAULTINTEGRATIONACCOUNTNAME"
)
$schemasFolder = $PSScriptRoot + "\Schemas"
$schemas = Get-ChildItem -Path $schemasFolder -Recurse | Where-Object { $_.PSIsContainer -eq $false }
$mapsFolder = $PSScriptRoot + "\Maps"
$maps = Get-ChildItem -Path $mapsFolder -Recurse | Where-Object { $_.PSIsContainer -eq $false }