Azure autoscaling exception when trying to read performance counter - c#

I am working on an example from Microsoft that shows how to use autoscaling (http://www.windowsazure.com/en-us/develop/net/how-to-guides/autoscaling/). The worker role installed on the cloud generates a performance counter and locally, a console application reads this counter and applies autoscaling.
Everything looks fine, the performance counter is available from WADPerformanceCountersTable and the console application accesses correctly to the storage but it cannot find the worker role inside WADPerformanceCountersTable. This is the generated exception:
Autoscaling General Error: 2001 :
Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling.DataPointsCollection.DataPointsCollectionException:
Could not retrieve performance counter with name '\Processor(_Total)\% Processor Time'
for target 'WorkerRoleExample' from the WADPerformanceCountersTable table. --->
System.ArgumentOutOfRangeException: Could not retrieve the role with alias 'WorkerRoleExample' from the service information store.
Please review the service information store to fix this.
Configuration files of Autoscaling Application Block (both files are part of a console application):
rules.xml:
<?xml version="1.0" encoding="utf-8" ?>
<rules xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/rules">
<constraintRules>
<rule name="default" enabled="true" rank="1" description="The default constraint rule">
<actions>
<range min="1" max="2" target="WorkerRoleExample"/>
</actions>
</rule>
</constraintRules>
<reactiveRules>
<rule name="ScaleUpOnHighUtilization" rank="10" description="Scale up the web role" enabled="true" >
<when>
<any>
<greaterOrEqual operand="WebRoleA_CPU_Avg_5m" than="60"/>
</any>
</when>
<actions>
<scale target="WorkerRoleExample" by="1"/>
</actions>
</rule>
<rule name="ScaleDownOnLowUtilization" rank="10" description="Scale up the web role" enabled="true" >
<when>
<all>
<less operand="WebRoleA_CPU_Avg_5m" than="60"/>
</all>
</when>
<actions>
<scale target="WorkerRoleExample" by="-1"/>
</actions>
</rule>
</reactiveRules>
<operands>
<performanceCounter alias="WebRoleA_CPU_Avg_5m"
performanceCounterName="\Processor(_Total)\% Processor Time"
source ="WorkerRoleExample"
timespan="00:05:00" aggregate="Average"/>
</operands>
</rules>
services.xml:
<?xml version="1.0" encoding="utf-8" ?>
<serviceModel xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/serviceModel">
<subscriptions>
<subscription name="TestingWorkerRole"
certificateThumbprint="**************"
subscriptionId="**************"
certificateStoreLocation="CurrentUser"
certificateStoreName="My">
<services>
<service dnsPrefix="**************" slot="Staging">
<roles>
<role alias="AutoscalingApplicationRole"
roleName="WorkerRoleExample"
wadStorageAccountName="targetstorage"/>
</roles>
</service>
</services>
<storageAccounts>
<storageAccount alias="targetstorage"
connectionString="DefaultEndpointsProtocol=https;AccountName=*****;AccountKey=*******">
</storageAccount>
</storageAccounts>
</subscription>
</subscriptions>
</serviceModel>
Worker role running on the cloud generates a performance counter:
public override bool OnStart()
{
// Set the maximum number of concurrent connections
ServicePointManager.DefaultConnectionLimit = 12;
CreatePerformanceCounters();
return base.OnStart();
}
private static void CreatePerformanceCounters()
{
DiagnosticMonitorConfiguration diagConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
var procTimeConfig = new PerformanceCounterConfiguration();
procTimeConfig.CounterSpecifier = #"\Processor(_Total)\% Processor Time";
procTimeConfig.SampleRate = TimeSpan.FromSeconds(10);
diagConfig.PerformanceCounters.DataSources.Add(procTimeConfig);
diagConfig.PerformanceCounters.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagConfig);
}

In services.xml try changing this:
<role alias="AutoscalingApplicationRole"
roleName="WorkerRoleExample"
wadStorageAccountName="targetstorage"/>
To this:
<role alias="WorkerRoleExample"
roleName="WorkerRoleExample"
wadStorageAccountName="targetstorage"/>
In rules.xml the target attribute of the scale element looks for a matching alias attribute on the role element in services.xml - it was looking for WorkerRoleExample and couldn't find it.
It would also work if, instead of the above, in rules.xml you changed:
<scale target="WorkerRoleExample" by="1"/>
To this:
<scale target="AutoscalingApplicationRole" by="1"/>

Related

How to get list of Sabre Traveler Profiles using EPS_EXT_ProfileSearchRQ

I'm using the EPS_EXT_ProfileSearchRQ Sabre API, trying to gather a list of profile references (TPA_Identities) for a given Corporate Profile. My payloads are below (redacted) - all I am getting back is the corporate profile itself, not the traveler level references, despite indicating the ProfileTypeCode of "TVL".
What am I getting wrong with this request?
Request:
<?xml version="1.0" encoding="utf-16"?>
<Sabre_OTA_ProfileSearchRQ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="6.46" ReturnPaymentCardToken="Y">
<ProfileSearchCriteria ProfileNameOnly="Y" ReturnCount="250" xmlns="http://www.sabre.com/eps/schemas">
<TPA_Identity ProfileTypeCode="TVL" ClientCode="TN" ClientContextCode="TMP" ProfileName="COMPANY NAME" DomainID="XX12" />
<CustomerReferenceInfo />
</ProfileSearchCriteria>
Response:
<?xml version="1.0" encoding="utf-16"?>
<Sabre_OTA_ProfileSearchRS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" TimeStamp="2019-06-08T19:19:31.529Z" Version="6.51">
<ResponseMessage xmlns="http://www.sabre.com/eps/schemas">
<Success />
</ResponseMessage>
<ProfileInfo xmlns="http://www.sabre.com/eps/schemas">
<Profile CreateDateTime="2018-03-30T20:51:31.386Z" UpdateDateTime="2018-04-18T15:33:08.904Z" PrimaryLanguageIDCode="EN-US">
<TPA_Identity ClientCode="TN" ClientContextCode="MYS" UniqueID="6164723212" ProfileTypeCode="TVL" ProfileName="COMPANY NAME" ProfileNameModifyIndicator="Y" ProfileDescription="COMPANY NAME" DomainID="XX12" ProfileStatusCode="AC">
<ProfileSubType SubTypeCode="NN" />
</TPA_Identity>
<Traveler>
<Customer ChildIndicator="N" SeniorIndicator="N" LapInfantIndicator="N" IsSubjectToSecureFlightRule="N">
<Email EmailTypeCode="UNK" EmailAddress="SPETERSON#COMPANYNAME.COM" OrderSequenceNo="1" />
<Address LocationTypeCode="BUS" Attention="COMPANY NAME" OrderSequenceNo="1">
<AddressLine>5331 XXXX STREET</AddressLine>
<CityName>ROGER</CityName>
<PostalCd>81205</PostalCd>
<StateCode>AK</StateCode>
</Address>
<CustLoyalty VendorTypeCode="CR" VendorCode="ZI" MembershipID="X1A87DG" OrderSequenceNo="1" />
</Customer>
<TPA_Extensions>
<CustomerReferenceInfo TripTypeCode="AZ" BranchID="CMI" ReferenceID="888" OrderSequenceNo="1" />
<STARData STARName="COMPANY NAME" OrderSequenceNo="1"></STARData>
</TPA_Extensions>
</Traveler>
</Profile>
</ProfileInfo>
</Sabre_OTA_ProfileSearchRS>
It all depends on how you have built your Profiles structure. If you are looking for all of the Traveler profiles that are associated to the "COMPANY NAME" corporate profile, you could use something like this:
<Sabre_OTA_ProfileSearchRQ xmlns="http://www.sabre.com/eps/schemas" xmlns:ns2="http://services.sabre.com/res/tir/v3_9" xmlns:ns3="http://services.sabre.com/res/or/v1_9" xmlns:ns4="http://services.sabre.com/STL/v01" xmlns:ns5="http://webservices.sabre.com/triprecord" xmlns:ns6="http://webservices.sabre.com/pnrbuilder/v1_19" xmlns:ns7="http://services.sabre.com/res/or/v1_14" TimeStamp="2019-06-10T17:04:53.879+08:00" Version="6.35">
<ProfileSearchCriteria CountAll="Y" PageNumber="1" ReturnCount="50" SearchOperationType="AND">
<TPA_Identity ClientCode="TN" ClientContextCode="TMP" DomainID="XX12" ProfileName="*" ProfileTypeCode="TVL"/>
<AssociatedProfiles AssocProfileName="COMPANY NAME" IncludeTemplateAssoc="Y"/>
<SortPreference SortByCreateDate="N" SortByProfileName="Y"/>
</ProfileSearchCriteria>
</Sabre_OTA_ProfileSearchRQ>
Bear in mind that the request is also looking for profiles that are associated within the template, if that's available, with IncludeTemplateAssoc="Y". So, this search will look for all of your TVL profiles, given they are associated to that particular CRP profile, through the profiles themselves or through an association object (template).

Service Fabric service exists but returns 404 upon calling

I have a service fabric cluster that works fine locally but when deployed to azure the WebAPI stateless service returns
404 FABRIC_E_SERVICE_DOES_NOT_EXISTS
However the SF cluster shows that the service actually does exists and is up and running
Below is my service manifest for the service
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="SvcWebAPIPkg"
Version="1.0.9"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceTypes>
<!-- This is the name of your ServiceType.
This name must match the string used in RegisterServiceType call in
Program.cs. -->
<StatelessServiceType ServiceTypeName="SvcWebAPIType" />
</ServiceTypes>
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.9">
<EntryPoint>
<ExeHost>
<Program>SvcWebApi.exe</Program>
<WorkingFolder>CodePackage</WorkingFolder>
</ExeHost>
</EntryPoint>
</CodePackage>
<ConfigPackage Name="Config" Version="1.0.9" />
<Resources>
<Endpoints>
<Endpoint Protocol="http" Name="ServiceEndpoint" Type="Input"
Port="80" />
</Endpoints>
</Resources>
</ServiceManifest>
If that's the way how you access your service - "myaddress.com/api/BriefcaseApi/GetString" - it's incorrect. SF tries to resolve 'api' as a registered service, which is obviously does not exist. Right? Here is the way how you should construct the url -
http(s)://<Cluster FQDN | internal IP>:Port/<ServiceInstanceName>/<Suffix path>?PartitionKey=<key>&PartitionKind=<partitionkind>&ListenerName=<listenerName>&TargetReplicaSelector=<targetReplicaSelector>&Timeout=<timeout_in_seconds>
In your case, here is how it may look like -
http(s)://myaddress.com/SvcWebAPI/api/BriefcaseApi/GetString
Find more info here - Reverse proxy in Azure Service Fabric.

Stateless Web API service with HTTPS endpoint throws health state error

I want a https endpoint for my in a local service fabric (GA version) cluster hosted stateless Web API service. After achieving that, I want to deploy my cluster in Azure.
I followed the steps in the "Secure a Service Fabric cluster" article of the service fabric documentation and created a self-signed certificate and uploaded it to my key vault. I also imported my certificate to my machine's "trusted people" store with the Import-PfxCertificate commands on step 2.5.
AddCertToKeyVault:
Invoke-AddCertToKeyVault -SubscriptionId <Id> -ResourceGroupName 'ResourceGroupName' -Location 'West Europe' -VaultName 'VaultName' -CertificateName 'TestCert' -Password '****' -CreateSelfSignedCertificate -DnsName 'www.<clustername>.westeurope.cloudapp.azure.com' -OutputPath 'C:\MyCertificates'
Now I adjusted the ServiceManifest.xml, ApplicationManifest.xml (like in RunAs: Run a Service Fabric application with different security permissions) and my OwinCommunicationListener.cs:
ServiceManifest.xml (MasterDataServiceWebApi):
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="MasterDataServiceWebApiPkg"
Version="1.0.0"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceTypes>
<StatelessServiceType ServiceTypeName="MasterDataServiceWebApiType" />
</ServiceTypes>
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>MasterDataServiceWebApi.exe</Program>
</ExeHost>
</EntryPoint>
</CodePackage>
<ConfigPackage Name="Config" Version="1.0.0" />
<Resources>
<Endpoints>
<Endpoint Name="ServiceEndpoint" Type="Input" Protocol="https" Port="5030" CertificateRef="TestCert"/>
</Endpoints>
</Resources>
</ServiceManifest>
ApplicationManifest:
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="exCHANGETestCluster2Type" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="MasterDataServiceWebApi_InstanceCount" DefaultValue="-1" />
</Parameters>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="MasterDataServiceWebApiPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<EndpointBindingPolicy EndpointRef="ServiceEndpoint" CertificateRef="TestCert" />
</Policies>
</ServiceManifestImport>
<DefaultServices>
<Service Name="MasterDataServiceWebApi">
<StatelessService ServiceTypeName="MasterDataServiceWebApiType" InstanceCount="[MasterDataServiceWebApi_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
<Certificates>
<EndpointCertificate X509FindValue="<Thumbprint>" Name="TestCert" />
</Certificates>
</ApplicationManifest>
OwinCommunicationListener.cs:
[...]
public Task<string> OpenAsync(CancellationToken cancellationToken)
{
var serviceEndpoint = this.serviceContext.CodePackageActivationContext.GetEndpoint(this.endpointName);
int port = serviceEndpoint.Port; //NEW!
if (this.serviceContext is StatefulServiceContext)
{
[...]
}
else if (this.serviceContext is StatelessServiceContext)
{
var protocol = serviceEndpoint.Protocol;
this.listeningAddress = string.Format(
CultureInfo.InvariantCulture,
//"http://+:{0}/{1}",
"{0}://+:{1}/{2}", //NEW!
protocol,
port,
string.IsNullOrWhiteSpace(this.appRoot)
? string.Empty
: this.appRoot.TrimEnd('/') + '/');
}
else
{
throw new InvalidOperationException();
}
[...]
When I deploy the stateless service to my local cluster now, my service fabric explorer reports some very "expressive" errors and I am not able to access my service:
Kind Health State Description
=============================================================================
Services Error Unhealthy services: 100% (1/1), ServiceType='MasterDataServiceWebApiType', MaxPercentUnhealthyServices=0%.
Service Error Unhealthy service: ServiceName='fabric:/sfCluster/MasterDataServiceWebApi', AggregatedHealthState='Error'.
Partitions Error Unhealthy partitions: 100% (1/1), MaxPercentUnhealthyPartitionsPerService=0%.
Partition Error Unhealthy partition: PartitionId='e5635b85-3c23-426b-bd12-13ae56796f23', AggregatedHealthState='Error'.
Event Error Error event: SourceId='System.FM', Property='State'. Partition is below target replica or instance count.
Visual Studio isn't providing me with any further error details. It's quite the opposite. The stacktrace prints: fabric:/sfCluster/MasterDataServiceWebApi is ready.
What did I miss? Did I configured something wrong?
BTW: After that, I created a new cluster in Azure with my self-signed certificate, but when I try to acess the Service Fabric Explorer of this cluster I have no UI and a blank site..
I have learned, that Service Fabric uses the local machine store for the certificate validation. (https://github.com/Azure-Samples/service-fabric-dotnet-web-reference-app/issues/3)
So I had to import the certificate into my local machine store by this slightly modified powershell-script:
Import-PfxCertificate -Exportable -CertStoreLocation cert:\localMachine\my -FilePath C:\MyCertificates\TestCert.pfx -Password (Read-Host -AsSecureString -Prompt "Enter Certificate Password")
Before that, I imported my certificate into Cert:\CurrentUser\TrustedPeople and Cert:\CurrentUser\My. But the local Service Fabric cluster doesn't look up there.
BTW:
I still get a blank site, when I try to access the Service Fabric Explorer of my azure-hosted Service Fabric cluster, that I have secured with the same certification key. I will create another question for this problem. EDIT: Using the Internet Explorer instead of Firefox solved my blank site issue.

Orleans Specify SqlServer for Liveness

I am trying to setup a test environment for Orleans that uses SQL Server for liveness. This is my server config file:
<?xml version="1.0" encoding="utf-8" ?>
<OrleansConfiguration xmlns="urn:orleans">
<Globals>
<Liveness LivenessType="SqlServer" DeploymentId="42783519-d64e-44c9-9c29-111111111133" DataConnectionString="Data Source=.\\SQLEXPRESS;Initial Catalog=Orleans;Integrated Security=True;" />
<!--<SeedNode Address="localhost" Port="11111" />-->
</Globals>
<Defaults>
<Networking Address="localhost" Port="11111" />
<ProxyingGateway Address="localhost" Port="30000" />
<Tracing DefaultTraceLevel="Info" TraceToConsole="true" TraceToFile="{0}-{1}.log">
<TraceLevelOverride LogPrefix="Application" TraceLevel="Info" />
</Tracing>
<Statistics MetricsTableWriteInterval="30s" PerfCounterWriteInterval="30s" LogWriteInterval="300s" WriteLogStatisticsToTable="true" />
</Defaults>
<Override Node="Primary">
<Networking Address="localhost" Port="11111" />
<ProxyingGateway Address="localhost" Port="30000" />
</Override>
</OrleansConfiguration>
When I use this config I get this error when running:
MembershipTableGrain cannot run without Seed node - please check your
silo configuration file and make sure it specifies a SeedNode element.
Alternatively, you may want to use AzureTable for LivenessType.
Parameter name: grain = MembershipTableGrain Exception =
System.ArgumentException: MembershipTableGrain cannot run without Seed
node - please check your silo configuration file and make sure it
specifies a SeedNode element. Alternatively, you may want to use
AzureTable for LivenessType.
and further up, the logs say that the Liveness is MembershipTableGrain (which is the default and requires a SeeNode). What am I missing here?
My silo config for SQLServer membership looks like this
<?xml version="1.0" encoding="utf-8"?>
<OrleansConfiguration xmlns="urn:orleans">
<Globals>
<SystemStore SystemStoreType="SqlServer" DeploymentId="YYYYY" DataConnectionString="Server=THESERVER;Database=Orleans;User ID=USER;password=PASSWORD;"/>
</Globals>
<Defaults>
<Networking Address="" Port="11111"/>
<ProxyingGateway Address="" Port="30000"/>
</Defaults>
</OrleansConfiguration>
No need to specify the liveness type. It figures it out by looking at the SystemStoreType.
The client config does need the gateway specified
<ClientConfiguration xmlns="urn:orleans">
<SystemStore SystemStoreType ="SqlServer"
DeploymentId="YYY"
DataConnectionString="Server=THESERVER;Database=Orleans;User ID=USER;password=PASSWORD;" />
<GatewayProvider ProviderType="SqlServer"/>
</ClientConfiguration>
You can also use programmable API for configuration, instead of XML.
I found the problem. That is not how to change the Liveness type. It should be like this:
<SystemStore SystemStoreType="SqlServer" DeploymentId="42783519-d64e-44c9-9c29-111111111133" DataConnectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Orleans;Integrated Security=True;" />
<Liveness LivenessType="SqlServer" />
Also, you must make sure to ref "Microsoft.Orleans.OrleansSqlUtils" NuGet package and run this SQL Create Script

Azure Diagnostics won't create WADLogsTable

I wanted to add logging to an existing azure cloud service using NLog and Azure Diagnostics, i went through all the steps described here: http://msdn.microsoft.com/en-us/library/azure/dn482131.aspx
But, unfortunately when testing the cloud service the WADLogsTable table storage does not created, and no information gets stored here. Not on local development storage, nor on azure.
diagnostics.wadcfg:
<?xml version="1.0" encoding="utf-8"?>
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT1M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration">
<DiagnosticInfrastructureLogs />
<Directories>
<IISLogs container="wad-iis-logfiles" directoryQuotaInMB="1024" />
<CrashDumps container="wad-crash-dumps" />
</Directories>
<Logs bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Verbose" />
<PerformanceCounters bufferQuotaInMB="512">
<PerformanceCounterConfiguration counterSpecifier="\Memory\Available MBytes" sampleRate="PT3M" />
</PerformanceCounters>
<WindowsEventLog bufferQuotaInMB="1024" scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Verbose">
<DataSource name="Application!*" />
</WindowsEventLog>
</DiagnosticMonitorConfiguration>
ServiceConfiguration.Local.csfg (the same at Cloud, just with the correct table storage account)
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="AAService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-01.2.3">
<Role name="Web.Services.AAService">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
ServiceDefinition.csdef
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="AAService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-01.2.3">
<WebRole name="Web.Services.AAService" vmsize="ExtraSmall">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<LocalResources>
<LocalStorage name="Web.Services.AAService.svclog" sizeInMB="1000" cleanOnRoleRecycle="false" />
</LocalResources>
</WebRole>
</ServiceDefinition>
WebRole entrypoint
public override bool OnStart()
{
// To enable the AzureLocalStorageTraceListner, uncomment relevent section in the web.config
DiagnosticMonitorConfiguration diagnosticConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
diagnosticConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfig);
// For information on handling configuration changes
// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
return base.OnStart();
}
cloud service web.config also has:
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
Does anyone have any ide why is this doesnt make any trace logs? I called Trace.WriteLine() many places where the application goes through for sure, but still no WADLogsTable.
Thanks for the help
Get rid of all the Diagnostic* code in OnStart. The <Import moduleName="Diagnostics" /> in your csdef will automatically start the diagnostics agent, and the diagnostics agent will read the settings from the .wadcfg. Your code in OnStart is unnecessary and is overriding the wadcfg settings due to the order of precedence of loading WAD configuration.
Also note that if you are trying to update an existing cloud service then you will need to first delete the XML file in blob storage. If a file already exists in blob storage then the diagnostics agent will ignore the .wadcfg settings. The file you are looking for is in wad-control-container and will be named with the deployment ID and role name.

Categories