I am writing a new Cloud Service in .NET using Azure SDK 2.5.
I'm aware that there have been some significant changes to diagnostics with the 2.5 SDK rekesae.
Where I am getting conflicting information is whether or not I can still use Azure Diagnostics to capture Trace.* output to WADLogsTable in Azure Table Storage?
I'm aware that I can use ETW as an alternative, but that's now what I'm asking for.
According to this article I can still use Trace to capture my logs with Azure Diagnostics 1.3 - which I understand has shipped with SDK 2.5.
Unfortunately I cannot get it to work.
The app.config of my worker role looks like:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
</configuration>
Throughout the code in my worker role I have tracing code that looks like this:
Trace.TraceInformation("Something happened");
My public diagnostics.wadcfg file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<PublicConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<WadCfg>
<DiagnosticMonitorConfiguration overallQuotaInMB="4096">
<Logs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Information" />
</DiagnosticMonitorConfiguration>
</WadCfg>
<StorageAccount>mystorageAccount</StorageAccount>
</PublicConfig>
I have used this file to configure the diagnostics service extension using the PowerShell command:
Set-AzureServiceDiagnosticsExtension
No WADLogsTable is ever created.
If I enable other diagnostics services such as Perf Counter then the relevant tables (WADPerformanceCountersTable) are created and populated.
I am using:
Visual Studio 2012
.NET 4.5.1
Azure Powershell (latest v from Web Platform Installer)
Azure SDK 2.5
Can anyone put me out of my misery?
Many Thanks
How are you deploying? On the same setup (VS2012, Azure 2.5 SDK), I only saw the WADLogsTable get created using the Visual Studio "Publish" wizard, which apparently configures the diagnostics extension for you. See:
https://msdn.microsoft.com/en-us/library/azure/dn873976.aspx
Diagnostics configuration must be applied separately after deployment - Because Azure SDK version 2.5 uses the extension model, the diagnostics extension and configuration are no longer part of the deployment package and must be applied separately after the deployment. Visual Studio will apply the extension and configuration for you when you use the Publish wizard to deploy your application [...]
I wasn't able to get the PowerShell cmdlets to work (didn't put much effort into that, honestly) but as a workaround, when I deployed using the VS "Publish" wizard, the WADLogsTable was created and I could see my logs flowing. This didn't happen when I packaged and uploaded through the Azure Portal.
It may be this way for the foreseeable future; the situation doesn't seem to have changed in the 2.6 SDK (though they fixed a lot of the irksomeness with diagnostics in 2.5): https://msdn.microsoft.com/en-us/library/azure/dn186185.aspx
I just created a default worker role that is producing trace logs and I noticed one difference in the public config
<?xml version="1.0" encoding="utf-8"?>
<PublicConfig xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<WadCfg>
<DiagnosticMonitorConfiguration overallQuotaInMB="4096">
<WindowsEventLog scheduledTransferPeriod="PT1M">
<DataSource name="Application!*" />
</WindowsEventLog>
<Logs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Information" />
</DiagnosticMonitorConfiguration>
</WadCfg>
<StorageAccount>mystorageAccount</StorageAccount>
</PublicConfig>
Related
We are trying to configure AntiMalware extensions for classic Azure Cloud Services by changing the service definition file (csdef). We know we can do this via powershell/portal, but we want this to be part of the definition so that re-deployments don't wipe out the config each time.
We've added the import entry:
<Import moduleName="AntiMalware" />
As well as the settings definitions:
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.ServiceLocation" />
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.EnableAntimalware" />
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.EnableRealtimeProtection" />
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.EnableWeeklyScheduledScans" />
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.DayForWeeklyScheduledScans" />
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.TimeForWeeklyScheduledScans" />
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.ExcludedExtensions" />
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.ExcludedPaths" />
<Setting name="Microsoft.WindowsAzure.Plugins.Antimalware.ExcludedProcesses" />
But when I try to build/package the cloud service using Visual Studio 2019 v16.8.2 and I get the following error:
Unable to import module AntiMalware. No manifest was found.
There seems to be virtually no documentation on this outside of very out dated blog posts. I'm wondering if the name of this module changed?
I agree that you provide the method in the link, use the definition and use the ps1 file to install AntiMalware.
Searching a lot of documents and materials, your needs should be achievable, and there are detailed steps in the 2012 official documents.
Microsoft Endpoint Protection for Windows Azure Customer Technology Preview Now Available For Free Download
There are also blogs explaining about this .csdef file, using <Import moduleName="AntiMalware" />.
How to Protect Against Malware on Windows Azure
Suggestions, raise a support ticket on the portal, and seek official final advice. Because this document is too old, I did not try it.
I am deploying Azure Mobile Apps to a deployment slot, and am getting the error below within Xamarin iOS.
500 The request could not be completed (Internal Server Error)
I have done the following:
Set <customErrors mode="Off" ></customErrors>
Inspect Application Insights Live Metrics Screen
Enabled failed request tracing
Inspect the event logs (2147024891 azure runtime failed to initialize)
Search for "web service" based DLLs and references in my "web app". I found some suspicious ones in Application Insights that contain the word "ROLE"
.
<?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
<TelemetryInitializers>
<Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector" />
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer" />
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureWebAppRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer" />
View the full list of references here
Future testing and debugging
The Azure help page didn't seem to tell me how to enable remote debugging, which is the next thing I'm googling.
(image of the help page that could be more helpful in this regard ;)
I'm writing a chapter on this in the ZUMO book: https://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter8/developing/
How can I access nuget packages hosted in private nuget server in Azure Functions?. Is there any way I can specify my private nuget server info?
Thanks!
Krishh,
This is possible using a nuget.config file as you normally would:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="MyPrivateFeed" value="http://myhost/myfeed" />
... other feeds ...
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
Using Kudu, or another deployment method outlined here, copy that file to either the function folder or wwwroot (that would apply to all functions) and your config will be used.
There are several posts related to your question if we assume that your private nuget package can be deployed as a simple .Net library:
Execute pre-compiled .NET code as Azure Function
How do you include references to external assemblies in Azure Functions
How do I use external assemblies with Microsoft Azure Function Apps?
How to put the entry point of an Azure Function inside a .NET DLL?
I have an Azure web role running an MVC Web API site. I'm using the diagnostics.wadcfg file to configure logging. So far I've just be using tracing and I view it with the Azure Diagnostics Monitor 2 from Cerebrata/Redgate. All is well.
I wanted to start logging out IIS requests. I know I can go to the wad-control-container to do some tweaks to logging by updating the content there as seen here:
<?xml version="1.0"?>
<ConfigRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DataSources>
<OverallQuotaInMB>4096</OverallQuotaInMB>
<Logs>
<BufferQuotaInMB>1024</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>1</ScheduledTransferPeriodInMinutes>
<ScheduledTransferLogLevelFilter>Verbose</ScheduledTransferLogLevelFilter>
</Logs>
<DiagnosticInfrastructureLogs>
<BufferQuotaInMB>0</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>0</ScheduledTransferPeriodInMinutes>
<ScheduledTransferLogLevelFilter>Undefined</ScheduledTransferLogLevelFilter>
</DiagnosticInfrastructureLogs>
<PerformanceCounters>
<BufferQuotaInMB>0</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>0</ScheduledTransferPeriodInMinutes>
<Subscriptions />
</PerformanceCounters>
<WindowsEventLog>
<BufferQuotaInMB>0</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>0</ScheduledTransferPeriodInMinutes>
<Subscriptions />
<ScheduledTransferLogLevelFilter>Undefined</ScheduledTransferLogLevelFilter>
</WindowsEventLog>
<Directories>
<BufferQuotaInMB>0</BufferQuotaInMB>
<ScheduledTransferPeriodInMinutes>0</ScheduledTransferPeriodInMinutes>
<Subscriptions />
</Directories>
</DataSources>
<IsDefault>true</IsDefault>
</ConfigRequest>
For example I can switch from Verbose to Information log tracing.
Can I turn on the IIS logging from here? Or do I have to update my diagnostics.wadcfg and redeploy?
Thanks for any help!
You can use Cerebrata's Diagnostic Manager to change the configuration. It is done instance by instance. That change will be lost once you redeploy your application or your instance gets reimaged by Azure.
I'm using Windows Azure to host my python project and I'm trying to enable the diagnostics without good results.
As I'm using python and not .NET, the only way I can actually configure it is through config files.
Below my config files:
ServiceDefinition.csdef
...
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
...
ServiceConfiguration.Cloud.cscfg
....
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=<my-account-name>;AccountKey=<my-account-key"/>
....
diagnostics.wadcfg:
<DiagnosticMonitorConfiguration xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration"
configurationChangePollInterval="PT10M"
overallQuotaInMB="1200">
<DiagnosticInfrastructureLogs bufferQuotaInMB="100"
scheduledTransferLogLevelFilter="Warning"
scheduledTransferPeriod="PT5M" />
<Logs bufferQuotaInMB="200"
scheduledTransferLogLevelFilter="Warning"
scheduledTransferPeriod="PT5M" />
<Directories bufferQuotaInMB="600"
scheduledTransferPeriod="PT5M">
<CrashDumps container="wad-crash-dumps" directoryQuotaInMB="200" />
<FailedRequestLogs container="wad-frq" directoryQuotaInMB="200" />
<IISLogs container="wad-iis" directoryQuotaInMB="200" />
</Directories>
<WindowsEventLog bufferQuotaInMB="200"
scheduledTransferLogLevelFilter="Warning"
scheduledTransferPeriod="PT5M">
<DataSource name="System!*" />
</WindowsEventLog>
</DiagnosticMonitorConfiguration>
In Diagnostics Manager, I can't actually see any data.
Thanks.
May i ask where your diagnostics.wadcfg located? For a regular worker role the diagnostics.wadcfg must be in the root folder and because you don't have worker role module in your project the location of the architecture of your role folder is very important. Be sure to have exact same folder structure in your Python application as a regular worker role and then drop the diagnostics.wadcfg in the role root folder. (add that info back to your question to verify)
Do you see a diagnostics configuration XML is created in your Windows Azure Blob storage which is configured in the *.Diagnostics.ConnectionString. This is a check which suggests that the diagnostics component in the Azure role was able to read the provided configuration and could create the configuration XML at destination blob stroage (same Azure Storage will be use to write log Azure Table storage). Please verify.
Finally your diagnostics.wadcfg need some more work. As this is a non .net worker role you have configured IIS logging (do you really have IIS running in worker role? ) and also have System event log scheduled to transfer "warning only" so if there are no warnings. Finally the log transfer time is set to 5 minutes which is long during test.
What i can suggest as below to test if diagnostics is working or not:
Remove the IIS log if you dont have IIS running the Azure VM
Replace event log DataSource from System!* to Application!* and set filter to Info level
Change the log transfer time to less then a minutes
Run the exact same code in Development Fabric with Diagnostics connection string connected to Actual Azure Storage.
Add custom event log in your machine and see if they are transferred within the time limit to Azure Table storage and specific tables are created
Above should help you to troubleshoot the problem.