<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Azure &#8211; blog.boro2g .co.uk</title>
	<atom:link href="https://blog.boro2g.co.uk/category/azure/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.boro2g.co.uk</link>
	<description>Some ideas about coding, dev and all things online.</description>
	<lastBuildDate>Fri, 18 Oct 2019 11:15:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.8</generator>
	<item>
		<title>Automating a multi region deployment with Azure Devops</title>
		<link>https://blog.boro2g.co.uk/automating-a-multi-region-deployment-with-azure-devops/</link>
					<comments>https://blog.boro2g.co.uk/automating-a-multi-region-deployment-with-azure-devops/#comments</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Fri, 18 Oct 2019 11:12:24 +0000</pubDate>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Sitecore]]></category>
		<guid isPermaLink="false">https://blog.boro2g.co.uk/?p=1085</guid>

					<description><![CDATA[<p>For a recent project we&#8217;ve invested a lot of time into Azure Devops, and in the most part found it a very useful toolset for deploying our code to both Azure and AWS. When we started on this process, YAML pipelines weren&#8217;t available for our source code provider &#8211; this meant everything had to be [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/automating-a-multi-region-deployment-with-azure-devops/">Automating a multi region deployment with Azure Devops</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>For a recent project we&#8217;ve invested a lot of time into Azure Devops, and in the most part found it a very useful toolset for deploying our code to both Azure and AWS.</p>



<p>When we started on this process, YAML pipelines weren&#8217;t available for our source code provider &#8211; this meant everything had to be setup manually <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>However, recently this has changed <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /> This post will run through a few ways you can optimize your release process and automate the whole thing. </p>



<p>First a bit of background and then some actual code examples.</p>



<p><strong>Why YAML</strong>?</p>



<p>Setting up your pipelines via the UI is a really good way to quickly prototype things, however what if you need to change these pipelines to mimic deployment features alongside code features. Yaml allows you to keep the pipeline definition in the same codebase as the actual features. You deploy branch XXX and that can be configured differently to branch YYY.</p>



<p>Another benefit, the changes are then visible in your pull requests so validating changes is a lot easier.</p>



<p><strong>Async Jobs</strong></p>



<p>A big optimization we gained was to release to different regions in parallel. Yaml makes this very easy by using Jobs &#8211; each job can run on an agent and hence push to multiple regions in parallel.</p>



<p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&amp;tabs=yaml">https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&amp;tabs=yaml</a></p>



<p><strong>Yaml file templates</strong></p>



<p>If you have common functionality you want to duplicate, e.g. &#8216;Deploy to Eu-West-1&#8217;, templates are a good way to split your functionality. They allow you to group logical functionality you want to run multiple times.</p>



<p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops">https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops</a></p>



<p><strong>Azure Devops rest API</strong></p>



<p>All of your build/releases can be triggered via the UI portal, however if you want to automate that process I&#8217;d suggest looking into the rest API. Via this you can trigger, monitor and administer builds, releases and a whole load more. </p>



<p>We use powershell to orchestrate the process.</p>



<p><a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/queue?view=azure-devops-rest-5.1">https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/queue?view=azure-devops-rest-5.1</a></p>



<p><strong>Variables, and variable groups</strong></p>



<p>I have to confess, this syntax feels slightly cumbersome, but it&#8217;s very possible to reference variables passed into a specific pipeline along with global variables from groups you setup in the <strong>Library </strong>section of the portal.</p>



<p><strong>Now, some examples</strong></p>



<p>The root YAML file:</p>



<pre class="crayon-plain-tag">pr: none
trigger: none

variables:
- group: 'DataDog' # reference Variable groups if needed
- name : 'system.debug'
  value: true
- name : 'DynamicParameter' # these can be calculated off other variable values
  value: &quot;name-$(EnvironmentName)-$(ColourName)&quot;
- name: 'WebsiteFolder'
  value: 'Website/FolderName'

#- name: &quot;EnvironmentName&quot; # see the rest api example below for how to pass in variables
#  value: &quot;Set externally&quot;
#- name: &quot;ColourName&quot;
#  value: &quot;Set externally&quot;
#- name: &quot;AwsCredentials&quot;
#  value: &quot;Set externally&quot;

jobs:
- job: Build
  pool:
    vmImage: 'windows-2019' # vmImages: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent
  steps:  
 
  - task: NuGetToolInstaller@0
    displayName: 'Use NuGet 4.4.1'
    inputs:
      versionSpec: 4.4.1    

  - task: NuGetCommand@2 # if using secure artifacts, you can download them into a dotnetcore project this way
    displayName: 'NuGet restore'
    inputs:
      restoreSolution: 'Website/###.sln'
      feedsToUse: config
      nugetConfigPath: Website/nuget.config

  - task: Npm@1
    displayName: 'NPM install'
    inputs:
      workingDir: '$(WebsiteFolder)'     
      verbose: false

  - task: Npm@1
    displayName: 'NPM build scss'
    inputs:
      workingDir: '$(WebsiteFolder)'     
      command: custom
      verbose: false
      customCommand: 'run scss-build'

  - task: DotNetCoreCLI@2
    displayName: 'dotnet publish'
    inputs:
      command: publish
      publishWebProjects: false
      projects: '$(WebsiteFolder)/Website.csproj'
      arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)\Website'
      zipAfterPublish: false  

  - task: PublishPipelineArtifact@0 # in order to share the common build with multiple releases you need to publish the artifact
    inputs:
      artifactName: &quot;Website&quot;
      targetPath: '$(Build.ArtifactStagingDirectory)'

- job: ReleaseEU
  pool:
    vmImage: 'windows-2019'
  dependsOn: Build # these will only start when the 'Build' task above starts
  steps:
  - template: TaskGroups/DeployToRegion.yaml # this
    parameters:
      AwsCredentials: '$(AwsCredentials)'
      RegionName: 'eu-west-1'      
      EnvironmentName: '$(EnvironmentName)'
      ColourName: '$(ColourName)'
      DatadogApiKey: '$(DatadogApiKey)' # referenced from a variable group      

- job: ReleaseRegionN # Will run in parallel with ReleaseEU if you have enough build agents
  pool:
    vmImage: 'windows-2019'
  dependsOn: Build
  steps:
  - template: TaskGroups/DeployToRegion.yaml # this template file is shown below
    parameters:
      AwsCredentials: '$(AwsCredentials)'
      RegionName: 'ANother region'      
      EnvironmentName: '$(EnvironmentName)'
      ColourName: '$(ColourName)'
      DatadogApiKey: '$(DatadogApiKey)' # referenced from a variable group</pre>



<p>The &#8216;DeployToRegion&#8217; template:</p>



<pre class="crayon-plain-tag">parameters:
  AwsCredentials: ''
  RegionName: ''  
  EnvironmentName: ''
  ColourName: ''
  DatadogApiKey: ''  

steps:
- task: DownloadPipelineArtifact@1 # you can download artifacts from other builds if needed
  inputs:
      buildType: 'specific'
      project: 'Project Name'
      pipeline: '##'
      buildVersionToDownload: 'latest'
      artifactName: 'Devops'
      targetPath: '$(System.ArtifactsDirectory)/Devops'

- task: DownloadPipelineArtifact@1 # or download from the current one
  inputs:
      buildType: 'current'
      artifactName: 'Website'
      targetPath: '$(System.ArtifactsDirectory)'

- template: DeployToElasticBeanstalk.yaml # and can chain templates if needed
  parameters:
      AwsCredentials: '${{ parameters.AwsCredentials }}'
      RegionName: '${{ parameters.RegionName }}'      
      EnvironmentName: '${{ parameters.EnvironmentName }}'
      ColourName: '${{ parameters.ColourName }}'
      DatadogApiKey: '${{ parameters.DatadogApiKey }}'</pre>



<p>And finally some powershell to fire it all off:</p>



<pre class="crayon-plain-tag">### Example usage: .\TriggerBuild.ps1 -branch &quot;release/release-006&quot; -isReleaseCandidate $false -additionalReleaseParameters @{ &quot;EnvironmentName&quot; = &quot;qa&quot;; &quot;ColourName&quot; = &quot;blue&quot;; }

param (
    [Parameter(Mandatory = $true)][string]$branch,   
    [boolean]$isReleaseCandidate = $false,
    [HashTable]$additionalReleaseParameters = @{ }
)

$ErrorActionPreference = &quot;Stop&quot;

$authToken = Get-DevOpsAuthToken # see https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops for how to get a token
$accountName = &quot;AzureDevopsAccountName&quot; 
$projectName = &quot;AzureDevopsProjectName&quot;

$buildDefinitionIds = @(27) # the build pipeline id

Write-Host &quot;Building with settings:&quot;
Write-Host &quot;Branch: '$branch'&quot;
Write-Host &quot;Tag as 'release-candidate' and retain build: $isReleaseCandidate&quot;
Write-Host &quot;Build definition IDs: $buildDefinitionIds&quot;
Write-Host &quot;Additional parameters: $($additionalReleaseParameters | ConvertTo-Json) &quot;
Write-Host &quot;&quot;

$releaseIds = @()

$result = @{
    Success = $false;    
}

foreach ($definitionId in $buildDefinitionIds)
{
    $deploymentParams = @{
        &quot;definition&quot; = @{
            &quot;id&quot; = $definitionId;
        }
        &quot;sourceBranch&quot; = $branch;
    }

    if ($additionalReleaseParameters.GetEnumerator().length -gt 0)
    {
        $deploymentParams.parameters = $additionalReleaseParameters | ConvertTo-Json
    }

    $content = (Invoke-WebRequest -uri &quot;https://dev.azure.com/$accountName/$projectName/_apis/build/builds?api-version=4.1&quot; `
        -ContentType &quot;application/json&quot; -Headers (Get-DevOpsHeaders -AuthToken $authToken) -Method POST -Body ($deploymentParams | ConvertTo-Json)).Content | ConvertFrom-Json

    $releaseIds += $content.id  

    Write-Host &quot;Build $($content.id) queued: https://dev.azure.com/$accountName/$projectName/_build/results?buildId=$($content.id)&quot; -ForegroundColor Yellow
}

$aBuildFailed = $false

foreach ($releaseId in $releaseIds)
{
    $status = &quot;&quot;

    while ($status -ne &quot;completed&quot;)
    {
        try
        {
            $content = (Invoke-WebRequest -uri &quot;https://dev.azure.com/$accountName/$projectName/_apis/build/builds/$releaseId&quot; -Headers (Get-DevOpsHeaders -AuthToken $authToken)).Content | ConvertFrom-Json
        }
        catch
        {
            Write-Host &quot;  Error calling DevopsAPI. If this happens several times check the url: https://dev.azure.com/$accountName/$projectName/_apis/build/builds/$releaseId&quot; -ForegroundColor red
        }

        $status = $content.status

        Write-Host &quot; Build id $releaseId has status: $status&quot;

        if ($content.result -eq &quot;failed&quot; -or $content.result -eq &quot;canceled&quot;)
        {
            $aBuildFailed = $true

            Write-Host &quot;Build $releaseId failed - check https://dev.azure.com/$accountName/$projectName/_build/results?buildId=$releaseId for details&quot; -ForegroundColor Red
        }
        elseif ($content.result -eq &quot;completed&quot;)
        {
            Write-Host &quot;Build $releaseId completed successfully&quot; -ForegroundColor Green
        }

        Start-Sleep -s 5
    }

    if ($isReleaseCandidate -eq $true)
    {
        Write-Host &quot; Adding RC tags: release-candidate&quot;
        $tags = (Invoke-WebRequest -uri &quot;https://dev.azure.com/$accountName/$projectName/_apis/build/builds/$releaseId/tags/release-candidate?api-version=4.1&quot; -Headers (Get-DevOpsHeaders -AuthToken $authToken) -Method PUT).Content | ConvertFrom-Json

        Write-Host &quot; Adding retain build to $releaseId&quot;
        $updates = (Invoke-WebRequest -uri &quot;https://dev.azure.com/$accountName/$projectName/_apis/build/builds/$($releaseId)?api-version=4.1&quot; -ContentType &quot;application/json&quot; -Headers (Get-DevOpsHeaders -AuthToken $authToken) -Method PATCH -Body (@{&quot;retainedByRelease&quot; = $true } | ConvertTo-Json)).Content | ConvertFrom-Json
    }
}

$result.Success = !$aBuildFailed

return $result</pre>



<p>Happy deploying <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/automating-a-multi-region-deployment-with-azure-devops/">Automating a multi region deployment with Azure Devops</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/automating-a-multi-region-deployment-with-azure-devops/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Sitecore Azure web-role disk space</title>
		<link>https://blog.boro2g.co.uk/sitecore-azure-web-role-disk-space/</link>
					<comments>https://blog.boro2g.co.uk/sitecore-azure-web-role-disk-space/#respond</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Mon, 03 Aug 2015 10:53:10 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Sitecore]]></category>
		<guid isPermaLink="false">http://blog.boro2g.co.uk/?p=606</guid>

					<description><![CDATA[<p>If you need to deploy your app to Azure cloud-services you&#8217;ll notice the installation drive will yo-yo between E: and F: each time you deploy. These drives are always created with rather limited capacity &#8211; roughly 1.5GB. Certain Sitecore operations push a lot of data to disk, things like: logging, media caches, icons, installation history [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/sitecore-azure-web-role-disk-space/">Sitecore Azure web-role disk space</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If you need to deploy your app to Azure cloud-services you&#8217;ll notice the installation drive will yo-yo between E: and F: each time you deploy. These drives are always created with rather limited capacity &#8211; roughly 1.5GB.</p>
<p>Certain Sitecore operations push a lot of data to disk, things like: logging, media caches, icons, installation history and lots more. As part of your deployment I&#8217;d suggest you setup the following changes:</p>
<ul>
<li>Move the data folder to another location
<ul>
<li>This can be patched in with the <em>sc.variable <strong>dataFolder</strong></em></li>
</ul>
</li>
<li>Move the media cache
<ul>
<li>This can be patched in with <em>setting <strong>Media.CacheFolder</strong></em></li>
<li>Remember to also update the cleanup agents which look to delete old file based media entries. These are referenced in the <strong>CleanupAgent</strong>.</li>
</ul>
</li>
<li>Move the temp folder
<ul>
<li>Now, this isn&#8217;t quite so simple. The reason for noting this item is installing update files creates large <em>__UpgradeHistory</em> folders. Also, things like <em>icons</em> are cached in the <em>/temp</em> folder. For this reason /temp needs to live as /temp under the site root. With some help from support they concluded that rather than a virtual directory, a <a href="https://technet.microsoft.com/en-us/library/cc753194.aspx" target="_blank">symlink</a> was the best approach. For details on setting one up via powershell, see <a href="http://stackoverflow.com/questions/894430/powershell-hard-and-soft-links" target="_blank">http://stackoverflow.com/questions/894430/powershell-hard-and-soft-links</a>. As part of our startup scripts we included calling the script to shift things around.</li>
<li>The clue a folder is a symlink is the icon will change ala:<br /><a href="http://blog.boro2g.co.uk/wp-content/uploads/2015/08/symlink.jpg"><img decoding="async" class="alignnone size-full wp-image-608" src="http://blog.boro2g.co.uk/wp-content/uploads/2015/08/symlink.jpg" alt="symlink" width="129" height="63" /></a></li>
</ul>
</li>
</ul>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/sitecore-azure-web-role-disk-space/">Sitecore Azure web-role disk space</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/sitecore-azure-web-role-disk-space/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure WAD Diagnostics &#8211; Sitecore counters</title>
		<link>https://blog.boro2g.co.uk/azure-wad-diagnostics-sitecore-counters/</link>
					<comments>https://blog.boro2g.co.uk/azure-wad-diagnostics-sitecore-counters/#respond</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Fri, 17 Jul 2015 13:47:48 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Sitecore]]></category>
		<guid isPermaLink="false">http://blog.boro2g.co.uk/?p=592</guid>

					<description><![CDATA[<p>Azure allows you to pipe loads of stats and diagnostic information to blob and table storage. Google for &#8220;WAD Azure&#8221; and you&#8217;ll find a lot more information. Its great for logging things like the event queue, performance counters and loads more over time. If you want to push Sitecore counters through to this you are [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/azure-wad-diagnostics-sitecore-counters/">Azure WAD Diagnostics &#8211; Sitecore counters</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Azure allows you to pipe loads of stats and diagnostic information to blob and table storage. Google for &#8220;WAD Azure&#8221; and you&#8217;ll find a lot more information.<br />
Its great for logging things like the event queue, performance counters and loads more over time.</p>
<p>If you want to push Sitecore counters through to this you are in luck. Make sure the counters are installed on the box &#8211; for web-roles this can be done via a startup task.</p>
<p>Then update your &#8216;diagnostics.wadcfg&#8217; config to include the counters you want &#8211; make sure you include the (*)!</p>
<p></p><pre class="crayon-plain-tag">&lt;!-- updated as per https://sdn.sitecore.net/Articles/Administration/Sitecore%20Performance/Optimizing%20Sitecore%206%20and%20later/Optimizing%20Performance%20in%20Sitecore.aspx --&gt;
		&lt;PerformanceCounterConfiguration counterSpecifier=&quot;\Sitecore.Caching(*)\CacheClearings&quot; sampleRate=&quot;PT1M&quot; /&gt;
		&lt;PerformanceCounterConfiguration counterSpecifier=&quot;\Sitecore.Caching(*)\CacheHits&quot; sampleRate=&quot;PT1M&quot; /&gt;
		&lt;PerformanceCounterConfiguration counterSpecifier=&quot;\Sitecore.Caching(*)\CacheMisses&quot; sampleRate=&quot;PT1M&quot; /&gt;

		&lt;PerformanceCounterConfiguration counterSpecifier=&quot;\Sitecore.Data(*)\Data.ItemsAccessed&quot; sampleRate=&quot;PT1M&quot; /&gt;
		&lt;PerformanceCounterConfiguration counterSpecifier=&quot;\Sitecore.Data(*)\Data.PhysicalReads&quot; sampleRate=&quot;PT1M&quot; /&gt;
		&lt;PerformanceCounterConfiguration counterSpecifier=&quot;\Sitecore.Data(*)\Data.PhysicalWrites&quot; sampleRate=&quot;PT1M&quot; /&gt;

		&lt;PerformanceCounterConfiguration counterSpecifier=&quot;\Sitecore.System(*)\Exceptions.ExceptionsThrown&quot; sampleRate=&quot;PT1M&quot; /&gt;</pre><p></p>
<p>This caught me out for a while, I was missing the <strong>(*)</strong>. </p>
<p>There is a handy cmd you can run to see all the counters available:</p><pre class="crayon-plain-tag">typeperf -q -o &quot;C:\Temp\counters.txt&quot;</pre><p></p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/azure-wad-diagnostics-sitecore-counters/">Azure WAD Diagnostics &#8211; Sitecore counters</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/azure-wad-diagnostics-sitecore-counters/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Migrating a sitecore DB to PAAS SQL Azure</title>
		<link>https://blog.boro2g.co.uk/migrating-a-sitecore-db-to-paas-sql-azure/</link>
					<comments>https://blog.boro2g.co.uk/migrating-a-sitecore-db-to-paas-sql-azure/#respond</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Fri, 03 Jul 2015 14:08:43 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Sitecore]]></category>
		<guid isPermaLink="false">http://blog.boro2g.co.uk/?p=586</guid>

					<description><![CDATA[<p>Moving to the cloud offers many new opportunities for how you store and handle your data. One challenge we ran into was how to migrate a large Sitecore web db into a PAAS sql azure db. There are quite a few tools for doing this, even SQL management studio can help. The problem we faced [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/migrating-a-sitecore-db-to-paas-sql-azure/">Migrating a sitecore DB to PAAS SQL Azure</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Moving to the cloud offers many new opportunities for how you store and handle your data. One challenge we ran into was how to migrate a large Sitecore web db into a PAAS sql azure db.</p>
<p>There are quite a few tools for doing this, even SQL management studio can help. The problem we faced was the source db had several filegroups setup, SQL Azure doesn&#8217;t support this.</p>
<p>To get around it we first created the DB through the portal, then scripted in the db structure &#8211; follow the steps in this link: <a href="http://blog.sqlauthority.com/2010/06/04/sql-server-generate-database-script-for-sql-azure/" target="_blank">http://blog.sqlauthority.com/2010/06/04/sql-server-generate-database-script-for-sql-azure/</a></p>
<p>The second step was then the data. We used the Azure MW tool (<a href="https://sqlazuremw.codeplex.com/" target="_blank">https://sqlazuremw.codeplex.com/</a>) . When selecting what to migrate, select &#8216;data only&#8217;. This can take a while to run, several hours in our case, but at least got the data upto the cloud.</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/migrating-a-sitecore-db-to-paas-sql-azure/">Migrating a sitecore DB to PAAS SQL Azure</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/migrating-a-sitecore-db-to-paas-sql-azure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure diagnostics not writing to blob storage</title>
		<link>https://blog.boro2g.co.uk/azure-diagnostics-writing-blob-storage/</link>
					<comments>https://blog.boro2g.co.uk/azure-diagnostics-writing-blob-storage/#respond</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Fri, 17 Apr 2015 11:00:16 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<guid isPermaLink="false">http://blog.boro2g.co.uk/?p=573</guid>

					<description><![CDATA[<p>Azure offers some very useful out the box tools for pooling diagnostic information into blob and table storage. http://azure.microsoft.com/en-gb/documentation/articles/cloud-services-dotnet-diagnostics/ contains lots of information on this. In your solution you should end up with a file: diagnostics.wadcfg under the roles folder. One issue we ran into occurred when we changed the name of the counterpart project, the diagnostics [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/azure-diagnostics-writing-blob-storage/">Azure diagnostics not writing to blob storage</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Azure offers some very useful out the box tools for pooling diagnostic information into blob and table storage. <a href="http://azure.microsoft.com/en-gb/documentation/articles/cloud-services-dotnet-diagnostics/" target="_blank">http://azure.microsoft.com/en-gb/documentation/articles/cloud-services-dotnet-diagnostics/</a> contains lots of information on this.</p>
<p>In your solution you should end up with a file: <strong>diagnostics.wadcfg</strong> under the <strong>roles</strong> folder. One issue we ran into occurred when we changed the name of the counterpart project, the diagnostics file then sat in the wrong place. Ensure the structure is as follows:</p>
<p></p><pre class="crayon-plain-tag">- WebProject
-- files for your site
- CloudProject
-- Roles (default folder name)
--- WebProject (folder named the same as your webproject)
---- diagnostics.wadcfg</pre><p></p>
<p>You can verify this by checking the Azure project ccproj file. You should see:</p><pre class="crayon-plain-tag">&lt;ItemGroup&gt;
    &lt;ProjectReference Include=&quot;..\WebProject\WebProject.csproj&quot;&gt;
      &lt;Name&gt;CloudProject&lt;/Name&gt;
      ...      
      &lt;RoleName&gt;CloudProject&lt;/RoleName&gt;   
      ...   
    &lt;/ProjectReference&gt;
  &lt;/ItemGroup&gt;
  &lt;ItemGroup&gt;
    &lt;Folder Include=&quot;WebProjectContent\&quot; /&gt;    
  &lt;/ItemGroup&gt;
  &lt;ItemGroup&gt;
    &lt;Content Include=&quot;WebProjectContent\diagnostics.wadcfg&quot;&gt;
      &lt;SubType&gt;Content&lt;/SubType&gt;
    &lt;/Content&gt;
  &lt;/ItemGroup&gt;</pre><p></p>
<p>When the site fires up you should then see blob storage contain a folder called: <strong>wad-control-container</strong>. If you have a look in there it should contain a file that mimics the content of your diagnostics.wadcfg file.</p>
<p>I found it was useful to clear out this folder before testing new deployments.</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/azure-diagnostics-writing-blob-storage/">Azure diagnostics not writing to blob storage</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/azure-diagnostics-writing-blob-storage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Debugging Azure web-role startup tasks</title>
		<link>https://blog.boro2g.co.uk/debugging-azure-web-role-startup-tasks/</link>
					<comments>https://blog.boro2g.co.uk/debugging-azure-web-role-startup-tasks/#respond</comments>
		
		<dc:creator><![CDATA[boro]]></dc:creator>
		<pubDate>Mon, 23 Mar 2015 19:12:30 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[powershell]]></category>
		<guid isPermaLink="false">http://blog.boro2g.co.uk/?p=562</guid>

					<description><![CDATA[<p>One feature Azure offers for getting your  boxes configured is the notion of startup tasks &#8211; I won&#8217;t go into too much detail here as there is lots available online e.g. https://msdn.microsoft.com/en-us/library/azure/hh180155.aspx As part of setting these up I thought I&#8217;d share a few tips / gotchas that caught me out when running powershell from the [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/debugging-azure-web-role-startup-tasks/">Debugging Azure web-role startup tasks</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>One feature Azure offers for getting your  boxes configured is the notion of startup tasks &#8211; I won&#8217;t go into too much detail here as there is lots available online e.g. <a href="https://msdn.microsoft.com/en-us/library/azure/hh180155.aspx">https://msdn.microsoft.com/en-us/library/azure/hh180155.aspx</a></p>
<p>As part of setting these up I thought I&#8217;d share a few tips / gotchas that caught me out when running powershell from the cmd tasks.</p>
<p>My solution setup was:</p>
<ul>
<li>Site root
<ul>
<li>StartupScripts
<ul>
<li>Script.cmd</li>
<li>Script.ps1</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>So then I&#8217;d reference in the task:</p>
<p><em> &lt;Task commandLine=&#8221;StartupScripts\script.cmd&#8221; executionContext=&#8221;elevated&#8221; taskType=&#8221;simple&#8221; /&gt;</em></p>
<p>Nothing rocket science so far! So, why didn&#8217;t the script work? I could jump on the box and run the cmd and it would be fine.</p>
<p><strong>How to debug the process?</strong><br />
I found the most useful way was to add markers from the cmd and the ps1. The cmd file looked like:</p>
<p></p><pre class="crayon-plain-tag">md c:\test
echo &quot;Running&quot; &gt; &quot;c:\test\log.txt&quot;
powershell -command &quot;Set-ExecutionPolicy Unrestricted&quot; 2&gt;&gt; &quot;c:\test\log.txt&quot;
powershell .\startupScripts\script.ps1 %~dp0 2&gt;&gt; &quot;c:\test\log.txt&quot;
EXIT /B 0</pre><p>Note, the <strong>.\startupScripts</strong> part of the ps1 path is v important!</p>
<p>Then the powershell:</p><pre class="crayon-plain-tag">$tempFolder = &quot;c:\test&quot;
$logFile = &quot;ps_log.txt&quot;
$siterootFolder = &quot;\sitesroot\0\&quot;
If (!(Test-Path &quot;e:\&quot;))
{
    $siterootFolder = &quot;f:&quot; + $siterootFolder
}
else
{
    $siterootFolder = &quot;e:&quot; + $siterootFolder
}

function Write-Log
{
    param( [string] $text )
    Write-Host $text;	
    $path = [System.IO.Path]::Combine(&quot;$tempFolder\$logFile&quot;)

    $fs = New-Object IO.FileStream($path, [System.IO.FileMode]::Append, [System.IO.FileAccess]::Write, [IO.FileShare]::Read)
    $sw = New-Object System.IO.StreamWriter($fs)

    $sw.WriteLine($text)
    $sw.Dispose()
    $fs.Dispose()
}

Write-Log &quot;Output folder is $siterootFolder&quot;</pre><p>Note, if you try to write to log.txt you will get process locked exceptions as the cmd holds locks on the file.<br />
There are all sorts of techniques for writing to a file, this example uses a StreamWriter. Hit up google for different examples.</p>
<p>The post <a rel="nofollow" href="https://blog.boro2g.co.uk/debugging-azure-web-role-startup-tasks/">Debugging Azure web-role startup tasks</a> appeared first on <a rel="nofollow" href="https://blog.boro2g.co.uk">blog.boro2g .co.uk</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.boro2g.co.uk/debugging-azure-web-role-startup-tasks/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
