Search code examples
c#azureazure-diagnostics

Windows Azure WADPerformanceCounters for Specific Environment (not deployment)


In windows azure Cloud Services there is the concept of a Production environment and a staging environment. Unfortunately, you cannot (as far as I can tell) specify separate table storage accounts when uploading performance counters, so all environments (and deployments) are lumped together.

I tried to use the DeploymentId (RoleEnviroment.DeploymentId) to extract specific environment information but this changes with each deployment so it only returns the performance counter information since the last deployment.

When querying the TableStorage table (WADPerformanceCountersTable) for the performance counter data I am using TableQuery for example:

        TableQuery<PerformanceCountersEntity> query = new TableQuery<PerformanceCountersEntity>().Where(
            TableQuery.CombineFilters(
                TableQuery.GenerateFilterCondition("DeploymentId", QueryComparisons.Equal, RoleEnvironment.DeploymentId),
                TableOperators.And,
                TableQuery.CombineFilters(
                    TableQuery.GenerateFilterConditionForDate("Timestamp", QueryComparisons.GreaterThan, new DateTimeOffset(earliestDate)),
                    TableOperators.And,
                    TableQuery.GenerateFilterCondition("Role", QueryComparisons.Equal, "ROLENAMEHERE")
                    )
                )
            );

So, is there any way to get all the performance counters from the WADPerformanceCountersTable for production (or staging) without post-processing the data once the TableQuery has been performed?

Edit: So, apparently you can specify separate storage accounts in the Windows Azure Management portal which solves my problem. This setting is located in Storage Account -> Configure -> Staging -> Diagnostic Connection Strings


Solution

  • You can specify separate storage accounts for production/staging in the Windows Azure Management portal.

    This setting is located in Storage Account -> Configure -> Staging -> Diagnostic Connection Strings