De diagnostische extensie van Microsoft Azure toepassen in Cloud Services (uitgebreide ondersteuning)
U kunt belangrijke prestatiegegevens voor elke cloudservice bewaken. Elke cloudservicerol verzamelt minimale gegevens: CPU-gebruik, netwerkgebruik en schijfgebruik. Als de cloudservice de extensie Microsoft.Azure.Diagnostics heeft toegepast op een rol, kan die rol meer gegevenspunten verzamelen. Zie Overzicht van extensies voor meer informatie
Microsoft Azure Diagnostics-extensie kan worden ingeschakeld voor Cloud Services (uitgebreide ondersteuning) via PowerShell of ARM-sjabloon
Microsoft Azure Diagnostics-extensie toepassen met behulp van PowerShell
# Create WAD extension object
$storageAccountKey = Get-AzStorageAccountKey -ResourceGroupName "ContosOrg" -Name "contosostorageaccount"
$configFilePath = "<Insert WAD public configuration file path>"
$wadExtension = New-AzCloudServiceDiagnosticsExtension -Name "WADExtension" -ResourceGroupName "ContosOrg" -CloudServiceName "ContosoCS" -StorageAccountName "contosostorageaccount" -StorageAccountKey $storageAccountKey[0].Value -DiagnosticsConfigurationPath $configFilePath -TypeHandlerVersion "1.5" -AutoUpgradeMinorVersion $true
# Add <privateConfig> settings
$wadExtension.ProtectedSetting = "<Insert WAD Private Configuration as raw string here>"
# Get existing Cloud Service
$cloudService = Get-AzCloudService -ResourceGroup "ContosOrg" -CloudServiceName "ContosoCS"
# Add WAD extension to existing Cloud Service extension object
$cloudService.ExtensionProfile.Extension = $cloudService.ExtensionProfile.Extension + $wadExtension
# Update Cloud Service
$cloudService | Update-AzCloudService
Download de schemadefinitie van het openbare configuratiebestand door de volgende PowerShell-opdracht uit te voeren:
(Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' -ProviderNamespace 'Microsoft.Azure.Diagnostics').PublicConfigurationSchema | Out-File -Encoding utf8 -FilePath 'PublicWadConfig.xsd'
Hier volgt een voorbeeld van het XML-bestand voor openbare configuratie
<?xml version="1.0" encoding="utf-8"?>
<PublicConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<WadCfg>
<DiagnosticMonitorConfiguration overallQuotaInMB="25000">
<PerformanceCounters scheduledTransferPeriod="PT1M">
<PerformanceCounterConfiguration counterSpecifier="\Processor(_Total)\% Processor Time" sampleRate="PT1M" unit="percent" />
<PerformanceCounterConfiguration counterSpecifier="\Memory\Committed Bytes" sampleRate="PT1M" unit="bytes"/>
</PerformanceCounters>
<EtwProviders>
<EtwEventSourceProviderConfiguration provider="SampleEventSourceWriter" scheduledTransferPeriod="PT5M">
<Event id="1" eventDestination="EnumsTable"/>
<DefaultEvents eventDestination="DefaultTable" />
</EtwEventSourceProviderConfiguration>
</EtwProviders>
</DiagnosticMonitorConfiguration>
</WadCfg>
</PublicConfig>
Download de schemadefinitie van het privéconfiguratiebestand door de volgende PowerShell-opdracht uit te voeren:
(Get-AzureServiceAvailableExtension -ExtensionName 'PaaSDiagnostics' -ProviderNamespace 'Microsoft.Azure.Diagnostics').PrivateConfigurationSchema | Out-File -Encoding utf8 -FilePath 'PrivateWadConfig.xsd'
Hier volgt een voorbeeld van het XML-bestand met de privéconfiguratie
<?xml version="1.0" encoding="utf-8"?>
<PrivateConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<StorageAccount name="string" key="string" />
<AzureMonitorAccount>
<ServicePrincipalMeta>
<PrincipalId>string</PrincipalId>
<Secret>string</Secret>
</ServicePrincipalMeta>
</AzureMonitorAccount>
<SecondaryStorageAccounts>
<StorageAccount name="string" />
</SecondaryStorageAccounts>
<SecondaryEventHubs>
<EventHub Url="string" SharedAccessKeyName="string" SharedAccessKey="string" />
</SecondaryEventHubs>
</PrivateConfig>
Microsoft Azure Diagnostics-extensie toepassen met behulp van EEN ARM-sjabloon
"extensionProfile": {
"extensions": [
{
"name": "Microsoft.Insights.VMDiagnosticsSettings_WebRole1",
"properties": {
"autoUpgradeMinorVersion": true,
"publisher": "Microsoft.Azure.Diagnostics",
"type": "PaaSDiagnostics",
"typeHandlerVersion": "1.5",
"settings": "Include PublicConfig XML as a raw string",
"protectedSettings": "Include PrivateConfig XML as a raw string”",
"rolesAppliedTo": [
"WebRole1"
]
}
}
]
},
Volgende stappen
- Controleer de implementatievereisten voor Cloud Services (uitgebreide ondersteuning).
- Bekijk veelgestelde vragen over Cloud Services (uitgebreide ondersteuning).
- Implementeer een cloudservice (uitgebreide ondersteuning) met behulp van Azure Portal, PowerShell, Template of Visual Studio.