This file contains 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
{ | |
"definition": { | |
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", | |
"contentVersion": "1.0.0.0", | |
"triggers": { | |
"Recurrence": { | |
"type": "Recurrence", | |
"recurrence": { | |
"frequency": "Day", | |
"interval": 1 |
This file contains 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
#r "Newtonsoft.Json" | |
using System.Net; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Primitives; | |
using Newtonsoft.Json; | |
public static async Task<IActionResult> Run(HttpRequest req, ILogger log) | |
{ | |
log.LogInformation("C# HTTP trigger function processed a request."); | |
string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); |
This file contains 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 | |
## Define the output CSV file | |
output_file="aws_resources.csv" | |
## List of resource types to include in the report | |
resource_types=("ec2" "lambda" "ecs" "eks" "rds" "dynamodb" "elasticmapreduce" "kinesis" "elasticache") | |
## Check if the AWS CLI is installed | |
if ! command -v aws &> /dev/null; then |
This file contains 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 | |
az functionapp list --query "[].{n:name,g:resourceGroup}" -o Table | |
az functionapp list --query "[].{n:name,g:resourceGroup}" -o tsv | awk -F'\t' '{system("az functionapp function list -n "$1" -g " $2 " --query \"[].{g:resourceGroup,n:name,t:type}\" -o table")}' |
This file contains 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 namespace System.Net | |
# Input bindings are passed in via param block. | |
param($Request, $TriggerMetadata) | |
function Parse-JWTtoken { | |
[cmdletbinding()] | |
param([Parameter(Mandatory=$true)][string]$token) | |
This file contains 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
<TrustFrameworkPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06" | |
PolicySchemaVersion="0.3.0.0" | |
TenantId="yourtenant.onmicrosoft.com" | |
PolicyId="B2C_1A_SendgridCustomTemplateId" | |
PublicPolicyUri="http://tonycosite.onmicrosoft.com/B2C_1A_SendgridCustomTemplateId" | |
DeploymentMode="Development" | |
UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights"> |
This file contains 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
# First, connect to Azure AD | |
Connect-AzureAD | |
# Make sure there is no same policy already defined | |
# Get your policies and inspect them | |
Get-AzureADPolicy | |
# modify your gorup filter as appropriate | |
# ref: https://learn.microsoft.com/en-us/azure/active-directory/develop/reference-claims-mapping-policy-type#group-filter | |
$PolicyDefinitionString = "{ |
This file contains 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
Connect-MgGraph -Scopes "Directory.AccessAsUser.All" -TenantId b2c.idhero.de | |
Get-MgApplication -Filter "startswith(displayname,'Tonyco SaaS')" | ForEach-Object { Remove-MgApplication -ApplicationId $_.Id } |
This file contains 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
# This script is used to clean users' tenants association for a demo environment | |
$extProps = New-Object System.Collections.Generic.Dictionary"[String,String]" | |
$extProps.Add("extension_f7032a421ae74f8b8919f15dad3b290b_TenantsAll","") | |
Get-AzureADUser -all $true | ForEach-Object { Set-AzureADUser -ObjectId $_.ObjectId -ExtensionProperty $extProps } |
This file contains 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
#!/usr/bin/env bash | |
# first disable HTTP and force HTTPS only | |
az webapp list --query "[].id" --output tsv | az webapp update --https-only true --ids @- | |
# then force min-tls version | |
az webapp list --query "[].id" --output tsv | az webapp config set --min-tls-version '1.2' --ids @- | |
# then force FTPS in general. | |
# depending on your process, you might want to enforce FTPS (FtpsOnly) insted of completely disable it (Disabled). | |
az webapp list --query "[].id" --output tsv | az webapp config set --ftps-state FtpsOnly --ids @- |
NewerOlder