Skip to content

Instantly share code, notes, and snippets.

@kdemanuele
kdemanuele / frontdoor-create-table.kql
Created November 7, 2023 09:27
Azure Data Explorer - Frontdoor Monitoring Data
.create table FrontDoorDiagnosticLogs (
Timestamp: datetime,
Category: string,
ResourceId: string,
OperationName: string,
TrackingReference: string,
HttpMethod: string,
HttpVersion: string,
RequestUri: string,
RequestBytes: long,
@kdemanuele
kdemanuele / api-management-create-table.kql
Last active November 7, 2023 09:23
Azure Data Explorer - API Management Monitoring Data
.create table APIManagementDiagnosticLogs (
Timestamp: datetime,
Category: string,
ResourceId: string,
OperationName: string,
Method: string,
Url: string,
BackendResponseCode: int,
ResponseCode: int,
ResponseSize: int,
@kdemanuele
kdemanuele / azure_function.bicep
Last active July 21, 2021 20:24
Creating an Azure Function with Source Code as part of Bicep script
param LocationCode string
resource Storage 'Microsoft.Storage/storageAccounts@2021-04-01' = {
name: 'stor${LocationCode}labfunction'
location: resourceGroup().location
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
properties: {
## Initialising Variables
$AzureEnvironment = [PSCustomObject]@{
Location = 'North Europe'
Code = 'neu'
}
$Tags = @{
scope = 'training'
practice = 'VPN Access to Storage'
@kdemanuele
kdemanuele / Disable_PSRemoting.ps1
Created December 30, 2016 10:10
Easily Disabling PowerShell Remoting
# Remove all trusted hosts
Set-Item WSMan:\localhost\Client\TrustedHosts -Value '*'
# Disable PSRemoting
Disable-PSRemoting -Force
# Disabling PSRemoting is not enough to reverse the changes that were done when PSRemoting was enabled.
# The PSSession Configurations created when the command Set-WSManQuickConfig was executed needs to be reverted
Unregister-PSSessionConfiguration -Name *
# Ensure that all PSRemoting configuration were removed
Get-PSSessionConfiguration | Format-Table -Property Name, Permission -Wrap
@kdemanuele
kdemanuele / Enable_PS_Remoting_Source.ps1
Created December 30, 2016 09:49
Easy steps to enable Powershell Remoting
### Enable PSRemoting on Source Machine
# Enable the PSRemoting on all interfaces even the Public Network Interfaces
Enable-PSRemoting -Force -SkipNetworkProfileCheck -Verbose
# Allow only remote access from specific computers
Set-Item WSMan:\localhost\Client\TrustedHosts -Value '[List of IPs or Computer Names to where commands will be sent]'
# Restart the WinRM service
Restart-Service WinRM