Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@
<Link>ScenarioTests\Common.ps1</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<Content Include="ConfigFiles\DiagnosticsExtensionConfig.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="ScenarioTests\AddVhdTests.ps1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -281,6 +284,9 @@
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiagnosticsExtensionTests\TestDiagnosticsExtensionSepcifyStorageAccountName.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DiagnosticsExtensionTests\TestDiagnosticsExtensionSupportJsonConfig.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.Azure.Commands.Compute.Test.ScenarioTests.DscExtensionTests\TestGetAzureRmVMDscExtension.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"WadCfg": {
"DiagnosticMonitorConfiguration": {
"DiagnosticInfrastructureLogs": {
"scheduledTransferLogLevelFilter": "Error"
},
"Directories": {
"IISLogs": {
"containerName": "wad-iis-logfiles"
},
"FailedRequestLogs": {
"containerName": "wad-failedrequestlogs"
},
"scheduledTransferPeriod": "PT1M"
},
"PerformanceCounters": {
"PerformanceCounterConfiguration": [
{
"annotation": [],
"counterSpecifier": "\\Memory\\Available MBytes",
"sampleRate": "PT3M"
},
{
"annotation": [],
"counterSpecifier": "\\Web Service(_Total)\\ISAPI Extension Requests/sec",
"sampleRate": "PT3M"
},
{
"annotation": [],
"counterSpecifier": "\\Web Service(_Total)\\Bytes Total/Sec",
"sampleRate": "PT3M"
},
{
"annotation": [],
"counterSpecifier": "\\ASP.NET Applications(__Total__)\\Requests/Sec",
"sampleRate": "PT3M"
},
{
"annotation": [],
"counterSpecifier": "\\ASP.NET Applications(__Total__)\\Errors Total/Sec",
"sampleRate": "PT3M"
},
{
"annotation": [],
"counterSpecifier": "\\ASP.NET\\Requests Queued",
"sampleRate": "PT3M"
},
{
"annotation": [],
"counterSpecifier": "\\ASP.NET\\Requests Rejected",
"sampleRate": "PT3M"
},
{
"annotation": [],
"counterSpecifier": "\\Processor(_Total)\\% Processor Time",
"sampleRate": "PT3M"
}
],
"scheduledTransferPeriod": "PT1M"
},
"WindowsEventLog": {
"DataSource": [
{
"name": "Application!*[System[(Level=1 or Level=2 or Level=3)]]"
},
{
"name": "Windows Azure!*[System[(Level=1 or Level=2 or Level=3 or Level=4)]]"
}
],
"scheduledTransferPeriod": "PT1M"
},
"CrashDumps": {
"CrashDumpConfiguration": [
{
"processName": "WaIISHost.exe"
},
{
"processName": "WaWorkerHost.exe"
},
{
"processName": "w3wp.exe"
}
]
},
"Logs": {
"scheduledTransferLogLevelFilter": "Error",
"scheduledTransferPeriod": "PT1M"
},
"overallQuotaInMB": 4096
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@ public void TestDiagnosticsExtensionCantListSepcifyStorageAccountKey()
{
ComputeTestController.NewInstance.RunPsTest("Test-DiagnosticsExtensionCantListSepcifyStorageAccountKey");
}

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestDiagnosticsExtensionSupportJsonConfig()
{
ComputeTestController.NewInstance.RunPsTest("Test-DiagnosticsExtensionSupportJsonConfig");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,47 @@ function Test-DiagnosticsExtensionCantListSepcifyStorageAccountKey
$storagename = 'notexiststorage'
Assert-ThrowsContains `
{ Set-AzureRmVMDiagnosticsExtension -ResourceGroupName $rgname -VMName $vmname -DiagnosticsConfigurationPath '.\ConfigFiles\DiagnosticsExtensionConfig.xml' -StorageAccountName $storagename } `
'Failed to list storage account key'
'Storage account key'
}
finally
{
# Cleanup
Clean-ResourceGroup $rgname
}
}

<#
.SYNOPSIS
Test that we support config file in json format
#>
function Test-DiagnosticsExtensionSupportJsonConfig
{
$rgname = Get-ComputeTestResourceName
$loc = Get-ComputeVMLocation

try
{
# Setup
$vm = Create-VirtualMachine -rgname $rgname -loc $loc
$vmname = $vm.Name
$storagename = $vmname + "storage"
$storagetype = 'Standard_GRS'
New-AzureRmStorageAccount -ResourceGroupName $rgname -Name $storagename -Location $loc -Type $storagetype

# If diagnostics extension already exist, remove it
$extension = Get-AzureRmVMDiagnosticsExtension -ResourceGroupName $rgname -VMName $vmname
if ($extension) {
Remove-AzureRmVMDiagnosticsExtension -ResourceGroupName $rgname -VMName $vmname
$extension = Get-AzureRmVMDiagnosticsExtension -ResourceGroupName $rgname -VMName $vmname
Assert-Null $extension
}

Set-AzureRmVMDiagnosticsExtension -ResourceGroupName $rgname -VMName $vmname -DiagnosticsConfigurationPath '.\ConfigFiles\DiagnosticsExtensionConfig.json' -StorageAccountName $storagename
$extension = Get-AzureRmVMDiagnosticsExtension -ResourceGroupName $rgname -VMName $vmname

Assert-NotNull $extension
$settings = $extension.PublicSettings | ConvertFrom-Json
Assert-AreEqual $settings.storageAccount $storagename
}
finally
{
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading