private static void ConfigureDiagnosticsMonitor()
{
//... Omitted from example
// Trace Logs
diagnosticMonitorConfiguration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Undefined;
diagnosticMonitorConfiguration.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
//... Omitted from example
}
Blog focused on software development, configuration management, Amazon, Microsoft and related technologies
Wednesday, August 17, 2011
Windows Azure Accelerator for Web Roles Missing Trace Logging By Default
After upgrading our applications to Windows Azure Accelerator for Web Roles I found that the trace messages disappeared. Windows Azure Accelerator for Web Roles default project does not enable trace logging by default. To fix this simply add the following lines to the WebRole.cs of the Windows Azure Accelerator for Web Role project.
Labels:
Logging,
Tracing,
WAA,
Windows Azure
Tuesday, February 8, 2011
Using XDT with Worker Role App.configs
Recently I wrote a worker role in windows azure and was hoping the app.config would transform much like the web.config in the web roles. Sadly this is not the case. The configuration transforms are very useful when making a distinction between production, staging and development environments. After a little research, I did discover how to roll my own hopefully Microsoft will extend this feature to the rest of the azure project types.
Like the web roles this transform is only executed when a deploy is executed, here is how it was done:
- Un-load the project containing your worker role and app.config
- Edit the project file at the bottom add the following lines:
<usingtask taskname="TransformXml" assemblyfile="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll">
<target name="AfterCompile" condition="exists('app.$(Configuration).config')">
<transformxml source="app.config" destination="$(IntermediateOutputPath)$(TargetFileName).config" transform="app.$(Configuration).config">
</transformxml></target>
</usingtask> - Add the following Item Group:
<ItemGroup>
<Content Include="App.config" />
<Content Include="App.Debug.Config">
<DependentUpon>App.Config</DependentUpon>
<SubType>Designer</SubType>
</Content>
<Content Include="App.Release.Config">
<DependentUpon>App.Config</DependentUpon>
</Content>
</ItemGroup> - Now add the new configuration files to the project App.Debug.config, App.Release.config
- Reload the worker role project project
- Unload the cloud service project that references the worker role
- Open the file for edit and add the following line:
<Target Name="CopyWorkerRoleConfigurations" BeforeTargets="AfterPackageComputeService">
<Copy SourceFiles="..\{PROJECT PATH}\obj\$(Configuration)\{ASSEMBLY NAME}.dll.config" DestinationFolder="$(IntermediateOutputPath)\{PROJECT NAME}" OverwriteReadOnlyFiles="true"/>
</Target> - Reload the project file
Friday, September 17, 2010
PowerShell Yammer
Friday, September 3, 2010
PowerShell OpenAuthentication and Twitter
Twitter recently depreciated support of Basic Authentication which has made it a little more tricky to post updates via the API. I decided a Cmdlet seemed like the best route to take since the new method required storage of state for the oAuth token. I started a CodePlex site for those of you who might also need the functionality or would like to contribute.
Friday, August 20, 2010
Where Am I.cmd
After re-installing I have yet again found my static DHCP lease is no longer holding my IP address. I am at home and can't think of another way to find the IP, pinging my machine name continues to resolve to the static lease. If you find your self in the same boat and want to scan the network for IP to name resolution the following script should do the trick:
@ECHO OFF
FOR /L %%i IN (1,1,254) DO (
ECHO 10.1.1.%%i
nbtstat -A 10.1.1.%%i
)
Tuesday, August 17, 2010
VSTS 2010 MsBuild Extension Pack TfsSource and Win32Exception: The system cannot find the file specified
I came across this error while trying to check out a file using MsBuild under TFS2010. The error message is misleading because your first inclination is to check the ItemPath or WorkingDirectory in the task. Had I not come across this forum post I may have been stuck for a bit http://msbuildextensionpack.codeplex.com/Thread/View.aspx?ThreadId=74209. The current version of the Extension Pack has some hard coded paths in the task that tell it where to find the tf.exe file. After taking a look at the source code I found if you just add the following path to your Path environment variable the task will function properly.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\
Where's the Build Number, using MSBuild with VSTS 2010
I wanted to key the our assembly versions using the VSTS build number I quickly found the solution is not as simple as it seems. At first I thought this property would be a first class member of the IBuildDetail class making it easily accessible in the VSTS workflow but, it's not. After popping open the UpdateBuildNumberActivity I found the build number is actually extracted from the IBuildDetail.Uri. Use the format below in your MsBuild task to gain access to the BuildID and the SourceGetVersion. While the SourceGetVersion may return a sequential change set number (C123) it is not guaranteed to be numeric so it's probably not a good fit for the revision part of your version number. You may consider adding it to your AssemblyConfiguration attribute or AssemblyInformationalVersion attribute. Connecting the change set or source version to the assemblies generated may prove to be useful in troubleshooting version related issues later on.
String.Format("/p:SkipInvalidConfigurations=true /p:BuildID=""{1}"" /p:SourceGetVersion=""{2}"" {0}", MSBuildArguments, LinkingUtilities.DecodeUri(BuildDetail.Uri.ToString()).ToolSpecificId, BuildDetail.SourceGetVersion)
Subscribe to:
Posts (Atom)