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
.create table FrontDoorDiagnosticLogs ( | |
Timestamp: datetime, | |
Category: string, | |
ResourceId: string, | |
OperationName: string, | |
TrackingReference: string, | |
HttpMethod: string, | |
HttpVersion: string, | |
RequestUri: string, | |
RequestBytes: long, |
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
.create table APIManagementDiagnosticLogs ( | |
Timestamp: datetime, | |
Category: string, | |
ResourceId: string, | |
OperationName: string, | |
Method: string, | |
Url: string, | |
BackendResponseCode: int, | |
ResponseCode: int, | |
ResponseSize: int, |
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
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: { |
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
## Initialising Variables | |
$AzureEnvironment = [PSCustomObject]@{ | |
Location = 'North Europe' | |
Code = 'neu' | |
} | |
$Tags = @{ | |
scope = 'training' | |
practice = 'VPN Access to Storage' |
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
# 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 |
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
### 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 |