<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>2019s on The Cloud Hub</title>
    <link>https://thecloudhub.com/2019/</link>
    <description>Recent content in 2019s on The Cloud Hub</description>
    <generator>Hugo -- 0.118.2</generator>
    <language>en-au</language>
    <lastBuildDate>Sat, 09 Nov 2019 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://thecloudhub.com/2019/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Azure Availability Zones vs Availability Sets</title>
      <link>https://thecloudhub.com/2019/11/09/azure-availability-zones-vs-availability-sets/</link>
      <pubDate>Sat, 09 Nov 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/11/09/azure-availability-zones-vs-availability-sets/</guid>
      <description>A common question for newcomers to Microsoft&amp;rsquo;s Azure platform is what&amp;rsquo;s the difference between an availability zone and an availability set?
An availability zone is a unique physical location within one Azure region, and provides high-availability for your application and infrastructure. Each zone is independent and has physically isolated power, cooling, and networking from other zones within the same region.
Different Azure services have varying levels of support for availability zones.</description>
      <content:encoded><![CDATA[<p>A common question for newcomers to Microsoft&rsquo;s Azure platform is what&rsquo;s the difference between an availability zone and an availability set?</p>
<p>An <strong>availability zone</strong> is a unique physical location within one Azure region, and provides high-availability for your application and infrastructure. Each zone is independent and has physically isolated power, cooling, and networking from other zones within the same region.</p>
<p>Different Azure services have varying levels of support for availability zones. Some will automatically replicate between zones, while others will require you to choose the zone to connect to.</p>
<p>Availability zones aren&rsquo;t available within all Azure regions - in fact, <a href="https://azure.microsoft.com/en-au/global-infrastructure/regions/">currently</a> there are only 10 regions across the United States, Asia and Europe that support availability zones:</p>
<ul>
<li>Central US</li>
<li>East US</li>
<li>East US 2</li>
<li>West US 2</li>
<li>North Europe</li>
<li>UK South</li>
<li>West Europe</li>
<li>France Central</li>
<li>Japan East</li>
<li>Southeast Asia</li>
</ul>
<p>On the other hand, an <strong>availability set</strong> is a concept that only applies to virtual machines. A set allows you to isolate virtual machine (VM) resources from one another when deployed, meaning your VMs will run across multiple machines and racks. This will help to avoid a hardware failure bringing down your entire application, and also means that outages from Microsoft updates won&rsquo;t cause your application issues.</p>
<p>Unlike an <strong>availability zone</strong> which applies at the data centre level, an <strong>availability set</strong> only applies within the same data centre.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to retry a failed stage in Azure DevOps</title>
      <link>https://thecloudhub.com/2019/10/03/how-to-retry-a-failed-stage-in-azure-devops/</link>
      <pubDate>Thu, 03 Oct 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/10/03/how-to-retry-a-failed-stage-in-azure-devops/</guid>
      <description>One of the biggest limitations of Azure DevOps has until now been the fact that you can&amp;rsquo;t retry an individual stage or step in a pipeline if it fails. Instead, you&amp;rsquo;d have to retry the entire pipeline again and hope that the failed stage passes.
As of September 2019, in most cases you can now retry a failed stage without the need to retry the whole pipeline - but there&amp;rsquo;s a catch.</description>
      <content:encoded><![CDATA[<p>One of the biggest limitations of Azure DevOps has until now been the fact that you can&rsquo;t retry an individual stage or step in a pipeline if it fails. Instead, you&rsquo;d have to retry the entire pipeline again and hope that the failed stage passes.</p>
<p>As of September 2019, in most cases you can now retry a failed stage without the need to retry the whole pipeline - but there&rsquo;s a catch. You&rsquo;ll need to enable the <strong>Multi-stage pipelines</strong> preview feature, if you haven&rsquo;t already. Note that this still doesn&rsquo;t allow you to retry failed <em>steps</em> within a stage - rather it relies on the new multi-stage support to allow you to retry a collection of steps within a stage.</p>
<p>You can check if this is enabled by clicking your avatar in the top-right corner of the Azure DevOps portal, and then &ldquo;Preview features&rdquo;. Select &ldquo;for this organisation [&lt;your organisation name]&rdquo; from the drop-down menu at the top of the screen, and scroll down until you see &ldquo;Multi-stage pipelines&rdquo;. If this is toggled off, you&rsquo;ll need to turn this on before you can retry failed stages - you will need administrator rights to change it though.</p>
<p>Once you&rsquo;ve enabled this, navigate back to your release pipelines and you should see the ability to re-rerun individual stages that fail throughout your pipeline.</p>
<p>Note that as this is still in beta, there are some limitations. Perhaps one of the biggest is that you can&rsquo;t retry stages that are explicitly cancelled - only those that fail as a result of the task being run having an error can be retried today.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Using Cloudflare with Azure Blob Storage</title>
      <link>https://thecloudhub.com/2019/09/24/using-cloudflare-with-azure-blob-storage/</link>
      <pubDate>Tue, 24 Sep 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/09/24/using-cloudflare-with-azure-blob-storage/</guid>
      <description>If you’re storing files in Azure Storage, you’ll likely soon find that the cost of bandwidth will soon become one of the more expensive items in your Azure bill. By using a content delivery network (CDN), you can improve performance for those accessing your files from around the world, while also reducing the bandwidth costs incurred on Azure.
Microsoft offers its own Azure CDN solution, or you can use Akamai or Verizon.</description>
      <content:encoded><![CDATA[<p>If you’re storing files in Azure Storage, you’ll likely soon find that the cost of bandwidth will soon become one of the more expensive items in your Azure bill. By using a content delivery network (CDN), you can improve performance for those accessing your files from around the world, while also reducing the bandwidth costs incurred on Azure.</p>
<p>Microsoft offers its own <a href="https://azure.microsoft.com/en-gb/services/cdn/">Azure CDN solution</a>, or you can use Akamai or Verizon. However, for the purposes of this tutorial we’ll be using Cloudflare - a third-party vendor who offers a free tier that should meet most people’s needs. Cloudflare can cache files based on the caching headers you apply when you upload files to blob storage, or you can apply default caching values. As a side note, Cloudflare also offers other services such as DDoS protection and edge workers.</p>
<p>Note that you’lll need to have your own domain name for this to work - you need to associate a custom domain name with the blob storage account. To use Cloudflare services, you also need to point your domain to Cloudflare’s name servers.</p>
<p><strong>Setup Cloudflare</strong><br>
If you have a Cloudflare account already, you can skip this section. Otherwise, create an account at <a href="https://cloudflare.com">Cloudflare</a>. The free account will be fine for this tutorial.</p>
<p>Once your account has been created, click “Add a site” and follow the instructions to verify and add your domain to Cloudflare. If you want to use a sub domain (eg. cdn.example.com) for the Blob Storage custom domain, this should be the root domain (eg. example.com).</p>
<p>This will also require changing your domain’s nameservers, so you’ll require admin permissions with your DNS registrar.</p>
<p><strong>Getting started</strong><br>
If you haven’t already done so, create an Azure Storage resource by clicking “Create a resource” in the Azure Portal. Search for “storage account”, and choose the Microsoft service by clicking “Create”. Fill in the settings as required for your storage account.</p>
<p>Once your account has been provisioned, head to the “Storage accounts” tab and choose the account you want to setup.</p>
<p><strong>Create a custom domain</strong><br>
The first step in setting up Cloudflare with Blob Storage is to map it to a custom domain name that you own (such as example.com). In the Azure Portal for your storage account, go to “Custom domain” under the “Blob service” tab.</p>
<p>You should see some Microsoft instructions about configuring a CNAME record with your DNS provider, which should now be Cloudflare. Follow these steps first, by logging into your Cloudflare account and adding the CNAME record to validate your ownership of the domain with Microsoft. Note that this will be the URL that people will see and use when accessing your content, so CNAMEs such as cdn.example.com or static.example.com are commonly used.</p>
<p>In Cloudflare, make sure the proxy status for your domain or subdomain is set to DNS only. If proxied is enabled, verification with Microsoft will fail.</p>
<p>Once you’ve added the required record to your domain name, enter the URL in the text field below in the Azure Portal. Click “Save”, and if the DNS changes have propogated (this can take up to 24-48 hours depending on your provider and configuration) then the custom domain should be added successfully. Otherwise, try again later once the changes have propegated.</p>
<p><strong>Enable the Cloudflare proxy</strong><br>
Once you’ve verified your domain, you can enable caching on Cloudflare. Go back to your domain or subdomain in the DNS tab, and click the cloud icon until it’s orange and “Proxied” shows.</p>
<p>Then go to “Caching” and set the “Caching level” to standard.</p>
<p>Finally, by default Cloudflare will only cache certain types of files. If you’re serving predominantly static HTML or CSS files, this might be OK but if you’re sending other content types such as JSON you’ll need to add a page rule so that the files are cached.</p>
<p>Go to the “Page Rules” tab, and choose “Create Page Rule”. Enter the domain/subdomain you’re using for blob storage (eg cdn.example.com) and then click “Add a setting”. Choose “Cache Level” and select “Cache Everything”. This will now cache everything served on this domain, using either the Cloudflare defaults or the cache-control headers applied to the individual files.</p>
<p><strong>Upload files to Blob Storage with cache-control headers set</strong><br>
Now, upload some files to your blob storage account in the Azure Portal. Depending on how you upload the files, you’ll need to set the cache-control headers. The .NET SDK has built-in support, or you can use <a href="https://azure.microsoft.com/en-au/resources/samples/storage-blobs-powershell-cache-control/">these instructions</a> to use PowerShell.</p>
<p><strong>Conclusion</strong><br>
By enabling Cloudflare for your domain, you’re now saving money each month on bandwidth costs (Cloudflare will only request resources once the cached copy expires) and protecting yourself from a variety of security attacks.</p>
]]></content:encoded>
    </item>
    <item>
      <title>What is Azure DevOps used for?</title>
      <link>https://thecloudhub.com/2019/09/18/what-is-azure-devops-used-for/</link>
      <pubDate>Wed, 18 Sep 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/09/18/what-is-azure-devops-used-for/</guid>
      <description>Azure DevOps is a Microsoft product that can be used as part of the software development lifecycle, to manage the delivery, development and release of software products.
DevOps is a paid product (although there is a free tier available) that many software development companies use - particularly those within the Microsoft ecosystem. It used to be called Visual Studio Team Studio (VSTS).
DevOps is made up of 5 core areas of functionality:</description>
      <content:encoded><![CDATA[<p>Azure DevOps is a Microsoft product that can be used as part of the software development lifecycle, to manage the delivery, development and release of software products.</p>
<p>DevOps is a paid product (although there is a free tier available) that many software development companies use - particularly those within the Microsoft ecosystem. It used to be called Visual Studio Team Studio (VSTS).</p>
<p>DevOps is made up of 5 core areas of functionality:</p>
<ul>
<li><strong>Boards:</strong> Boards are used to track your teams work, and work best for teams using Agile methodologies to deliver work. Cards (or issues) can be created and tracked on boards, and linked to work as it gets delivered and released. Think of this as an equivalent to the likes of <a href="jira.com">Atlassian Jira</a>.</li>
<li><strong>Repos:</strong> Employ version control for your code by creating a Git repository within DevOps. DevOps supports Git repositories in a similar manner to the likes of <a href="github.com">Github</a> and <a href="bitbucket.com">Bitbucket</a>.</li>
<li><strong>Pipelines:</strong> Create continuous delivery pipelines that allow you to build your app and then release it automatically. Run your tests, deploy your code and store your build artefacts using Pipelines - DevOps has <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/?view=azure-devops">a whole host of tasks</a> supported out of the box, or you can <a href="https://docs.microsoft.com/en-us/azure/devops/extend/develop/add-build-task">easily create your own</a>.</li>
<li><strong>Test Plans:</strong> Depending on your account level (paid or free) you can use test plans to track the progress of your test activities including both manual and automated tests, and easily analyse reports including passed/failed tests and defects raised.</li>
<li><strong>Artifacts:</strong> Finally, DevOps will store your artifacts that are generated as part of your pipelines. This allows you to easily rollback to a previous version of your app if required, or the ability to re-deploy to new servers if required. You can also create package feeds with public sharing now in preview for public projects.</li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>How to generate an Azure DevOps pipeline status badge for README files</title>
      <link>https://thecloudhub.com/2019/08/20/how-to-generate-an-azure-devops-pipeline-status-badge-for-readme-files/</link>
      <pubDate>Tue, 20 Aug 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/08/20/how-to-generate-an-azure-devops-pipeline-status-badge-for-readme-files/</guid>
      <description>Microsoft has made it very easy to generate badge icons that you can use wherever you&amp;rsquo;d like, showing the status of your build and release pipelines in Azure DevOps.
The icons - which are made available as images - can be generated for both build pipelines and release pipelines on the Azure DevOps website. They change based on the outcome of the latest run, allowing you to place them in places such as your project&amp;rsquo;s Readme files.</description>
      <content:encoded><![CDATA[<p>Microsoft has made it very easy to generate badge icons that you can use wherever you&rsquo;d like, showing the status of your build and release pipelines in Azure DevOps.</p>
<p>The icons - which are made available as images - can be generated for both build pipelines and release pipelines on the Azure DevOps website. They change based on the outcome of the latest run, allowing you to place them in places such as your project&rsquo;s Readme files.</p>
<p>They aren&rsquo;t particularly flexible, but you can choose the branch and scope of the success/fail status.</p>
<p><strong>How to generate a badge icon</strong></p>
<p>Login to the Azure DevOps portal. Navigate to Pipelines, and then choose the release or build pipeline that you would like to generate an icon for.</p>
<p>In the top right-hand corner, select the three dots and then choose &ldquo;Status badge&rdquo;.</p>
<p>This brings up a modal window that allows you to customise the badge, and choose a branch, scope for the status (pipeline or per job), and then a URL is generated for the image.</p>
<p>Microsoft also provides the markdown text which allows you to immediately copy and paste the badge into a markdown file such as your project&rsquo;s Readme file.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to link Azure DevOps with Jira</title>
      <link>https://thecloudhub.com/2019/07/28/how-to-link-azure-devops-with-jira/</link>
      <pubDate>Sun, 28 Jul 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/07/28/how-to-link-azure-devops-with-jira/</guid>
      <description>In this post, we&amp;rsquo;ll look at the official integration between Azure DevOps and Atlassian&amp;rsquo;s Jira software.
Love it or hate it, Jira is among other things one of the most widely used issue tracking tools, and in July 2019 Microsoft rolled out a new Jira app that can be used to sync issues between DevOps and Jira, enabling end to end traceability between both platforms from when an issue is reported to when a deployment is released fixing it.</description>
      <content:encoded><![CDATA[<p>In this post, we&rsquo;ll look at the official integration between <a href="https://dev.azure.com">Azure DevOps</a> and <a href="https://www.atlassian.com/software/jira">Atlassian&rsquo;s Jira software</a>.</p>
<p>Love it or hate it, Jira is among other things one of the most widely used issue tracking tools, and in July 2019 Microsoft <a href="https://marketplace.atlassian.com/apps/1220515/azure-pipelines-for-jira">rolled out a new Jira app</a> that can be used to sync issues between DevOps and Jira, enabling end to end traceability between both platforms from when an issue is reported to when a deployment is released fixing it.</p>
<p>There are a number of limitations. At present, the official plugin doesn&rsquo;t support DevOps repositories. Only GitHub repositories are supported, although Azure Repos support is planned soon. Build information also isn&rsquo;t available - the app will only show deployments made in the Jira issue.</p>
<p>The integration also doesn&rsquo;t change much from DevOps - there&rsquo;s no UI integrating with Jira reporting or issues, and you can&rsquo;t easily view a summary of Jira cards from pull requests commit messages.</p>
<p>That said, to get started, you&rsquo;ll need to:</p>
<ul>
<li>Be a Jira administrator, or have the ability to request a Jira app be installed within your organisation&rsquo;s Jira installation</li>
<li>Use Jira Cloud - on-premise installations aren&rsquo;t supported</li>
<li>Use GitHub for your source code</li>
</ul>
<p>It&rsquo;s also worth noting that for now this app only supports showing deployment traceability in Jira - other information such as build numbers or tasks will not show.</p>
<h2 id="getting-started">Getting started</h2>
<p>First you&rsquo;ll need to install the <a href="https://marketplace.atlassian.com/apps/1220515/azure-pipelines-for-jira">Azure Pipelines for Jira application</a>, available for free in the Atlassian marketplace.</p>
<p>Then, once you&rsquo;ve installed the app you&rsquo;ll be prompted to add your DevOps organisation. Click &ldquo;Add organisation&rdquo;, and you&rsquo;ll be prompted to enter your credentials. It should then list all your organisations in a table view.</p>
<h2 id="enabling-support-in-devops">Enabling support in DevOps</h2>
<p>Now we need to add the Jira integration to our DevOps release pipeline. Open <a href="https://dev.azure.com">the DevOps portal</a>, and navigate to your project and release pipeline.</p>
<p>Click &ldquo;Edit&rdquo; on the release pipeline you&rsquo;d like to integrate Jira with, and then click &ldquo;Options&rdquo;. Click &ldquo;Integrations&rdquo; and you&rsquo;ll see the option to &ldquo;Report deployment status to Jira&rdquo;.</p>
<p>Check the box, and you should see your Jira software cloud account listed from the previous step. If you don&rsquo;t see it, check your Jira account to make sure you&rsquo;ve added the organisation successfully in the DevOps app.</p>
<p>You&rsquo;ll also see the ability to map your stages to a set list of deployment types. These deployment types are set by Microsoft, and you&rsquo;ll have to pick from the list and match them as best you can to your stages. At present, there are 5 deployment types:</p>
<ul>
<li>Production</li>
<li>Staging</li>
<li>Testing</li>
<li>Development</li>
<li>Unmapped</li>
</ul>
<p>These deployment types then show in your Jira cards as commits which contain your story numbers move through your deployment process.</p>
<h2 id="referencing-jira-issues">Referencing Jira issues</h2>
<p>The app works by searching your commit history (both commit and pull request messages) for Jira issue keys. If you&rsquo;re not sure about how to find an issue key see <a href="https://confluence.atlassian.com/jirasoftwarecloud/working-with-issues-764478424.html#Workingwithissues-Projectandissuekeys">this article on Atlassian&rsquo;s website</a>.</p>
<p>To enable the linking, once you&rsquo;ve followed the above steps simply add the issue number into your commit messages when you write them. We tend to stick to the format &ldquo;[ISSUE-KEY] Fixed an issue with something&rdquo; as the short message title, but the exact format is up to you.</p>
<p>The app then searches your commit history and will automatically update the issue when you create and deploy a release in your pipelines. It&rsquo;s that simple.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to delete an Azure DevOps project</title>
      <link>https://thecloudhub.com/2019/07/20/how-to-delete-an-azure-devops-project/</link>
      <pubDate>Sat, 20 Jul 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/07/20/how-to-delete-an-azure-devops-project/</guid>
      <description>In this post we&amp;rsquo;ll look at how to delete an Azure DevOps project.
First, you&amp;rsquo;ll need to login with your account to the DevOps portal. Choose the organisation that contains the project you want to delete from the left-hand sidebar, and then select the project you want to delete.
Then, once you&amp;rsquo;re on the homepage for the project you wish to delete, click &amp;ldquo;Project Settings&amp;rdquo; in the bottom left-hand corner. If you don&amp;rsquo;t see this option you may not have the required permission to manage the project.</description>
      <content:encoded><![CDATA[<p>In this post we&rsquo;ll look at how to delete an Azure DevOps project.</p>
<p>First, you&rsquo;ll need to login with your account to the <a href="https://dev.azure.com">DevOps portal</a>. Choose the organisation that contains the project you want to delete from the left-hand sidebar, and then select the project you want to delete.</p>
<p>Then, once you&rsquo;re on the homepage for the project you wish to delete, click &ldquo;Project Settings&rdquo; in the bottom left-hand corner. If you don&rsquo;t see this option you may not have the required permission to manage the project.</p>
<p>Navigate to the General &gt; Overview screen in Project Settings and scroll to the very bottom. A big red &ldquo;Delete&rdquo; button should appear at the bottom.</p>
<p>Click &ldquo;Delete&rdquo; and you&rsquo;ll be asked to enter type your project name to confirm the deletion. Type the name of the project in the textfield, click &ldquo;Delete&rdquo; and your project removed.</p>
<p>Note that it won&rsquo;t actually be deleted immediately - it will be placed in a temporary recycling bin for 28 days before being permanently removed. This gives you time to change your mind about the deletion, for example if you removed the wrong project or need access to the information again. After the 28 days the information will be permanently erased.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Using Azure Functions with Rider</title>
      <link>https://thecloudhub.com/2019/06/18/using-azure-functions-with-rider/</link>
      <pubDate>Tue, 18 Jun 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/06/18/using-azure-functions-with-rider/</guid>
      <description>Previously we&amp;rsquo;ve written about how to get started with Azure Functions using JetBrains Rider - but that&amp;rsquo;s now an outdated article, as the Azure plugin now offers seamless integration with the Microsoft Functions tooling. Gone are the days of manually updating project configuration files.
What you&amp;rsquo;ll need In order to follow along, you&amp;rsquo;ll need to make sure you:
Install JetBrains Rider (free 30-day trial available here) 2019.1 or later Getting started First you&amp;rsquo;ll want to install the Azure Toolkit for Rider.</description>
      <content:encoded><![CDATA[<p>Previously we&rsquo;ve written about how to get started with Azure Functions using JetBrains Rider - but that&rsquo;s now an outdated article, as the Azure plugin now offers seamless integration with the Microsoft Functions tooling. Gone are the days of manually updating project configuration files.</p>
<h2 id="what-youll-need">What you&rsquo;ll need</h2>
<p>In order to follow along, you&rsquo;ll need to make sure you:</p>
<ul>
<li>Install JetBrains Rider (<a href="https://www.jetbrains.com/rider/">free 30-day trial available here</a>) 2019.1 or later</li>
</ul>
<h2 id="getting-started">Getting started</h2>
<p>First you&rsquo;ll want to install the <a href="https://plugins.jetbrains.com/plugin/11220-azure-toolkit-for-rider">Azure Toolkit for Rider</a>. Open Rider then navigate to Preferences (JetBrains Rider &gt; Preferences on a Mac) and Plugins.</p>
<p>In the Plugins screen, go to the Marketplace tab  and search for &ldquo;Azure Toolkit for Rider&rdquo;. Click install.</p>
<p>This will now allow you to manage and deploy a whole bunch of Azure services from within Rider, such as App Services and SQL databases.</p>
<p>Let&rsquo;s open a new Functions app. Now that you&rsquo;ve installed the Azure Toolkit, a new template for AzureFunctions has been added to your new project window. From within Rider, click File &gt; New and choose Azure Functions from underneath the .NET Core section.</p>
<p>Enter a solution name, project name and choose a directory and language, and then click Create. If you&rsquo;re using this as a test project, you can probably leave these values as is.</p>
<h2 id="running-the-functions-app">Running the Functions app</h2>
<p>And that&rsquo;s almost all there is to using Functions apps in Rider now! The toolkit will automatically detect that it&rsquo;s a function app, and provide the necessary scaffolding to allow you to run and debug the app.</p>
<p>Gone are the days of hacking the project settings and configuration to make it work - it&rsquo;s a seamless experience now.</p>
<p>To verify that the config is correct, click the run configuration in the top right-hand side of Rider, and edit the configurations. You should see a default Azure Functions host configuration, complete with all the settings required to run a functions app. You can see in this example that the function will run on port 7071, and pause on error.</p>
<p>Even better, is that if you don&rsquo;t have the required Functions command line tools to run the app (which Rider relies on behind the scenes) then you&rsquo;ll even get prompted to install them - which Rider will do automatically on your behalf. You&rsquo;ll also get prompted if your tools are out of date.</p>
<p>And that&rsquo;s how easy it is now to get started using Azure Functions in Rider!</p>
]]></content:encoded>
    </item>
    <item>
      <title>Building Azure Functions in the Rider IDE</title>
      <link>https://thecloudhub.com/2019/03/31/building-azure-functions-in-the-rider-ide/</link>
      <pubDate>Sun, 31 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/31/building-azure-functions-in-the-rider-ide/</guid>
      <description>Many people now use Rider as their integrated development environment editor for .NET. However, when it comes to using it for developing Azure Functions, the out-of-the-box experience is (currently) less than ideal.
I say currently, because in the next update to the Azure Toolkit plugin for Rider Functions support has been added. This&amp;rsquo;ll make running and debugging function apps a breeze.
Until then though, here&amp;rsquo;s how you can run a functions app from Rider.</description>
      <content:encoded><![CDATA[<p>Many people now use Rider as their integrated development environment editor for .NET. However, when it comes to using it for developing Azure Functions, the out-of-the-box experience is (currently) less than ideal.</p>
<p>I say currently, because in the next update to the <a href="https://plugins.jetbrains.com/plugin/11220-azure-toolkit-for-rider">Azure Toolkit plugin</a> for Rider Functions support <a href="https://github.com/JetBrains/azure-tools-for-intellij/pull/162">has been added</a>. This&rsquo;ll make running and debugging function apps a breeze.</p>
<p>Until then though, here&rsquo;s how you can run a functions app from Rider.</p>
<h2 id="how-to-run-azure-functions-in-rider">How to run Azure functions in Rider</h2>
<p>First, you&rsquo;ll need to install the function CLI (see creating an Azure function for the Mac).</p>
<p>Then, open your functions app in Rider by selecting the project or solution.</p>
<p>Create a Properties folder in the root directory if you don&rsquo;t have one already, and then inside of that create a new JSON file called <code>launchSettings.json</code>.</p>
<p>Inside the JSON file, place the following object:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">8
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">9
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    &#34;profiles&#34;: {
</span></span><span style="display:flex;"><span>        &#34;functions&#34;: {
</span></span><span style="display:flex;"><span>            &#34;commandName&#34;: &#34;Executable&#34;,
</span></span><span style="display:flex;"><span>            &#34;executablePath&#34;: &#34;func&#34;,
</span></span><span style="display:flex;"><span>            &#34;commandLineArgs&#34;: &#34;start --port 7071 --pause-on-error&#34;
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></td></tr></table>
</div>
</div><p>You should see Rider now refresh, and add the configuration profile to your configurations with a little rocket icon. Click run, and your function app should start running within Rider.</p>
<p>Note that debugging is a little tricker for now. On Windows, once your function app is running you can go &ldquo;Run&rdquo; &gt; &ldquo;Attach to process&rdquo; and choose your function app to listen to. But on a Mac, this has had mixed results.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Azure App Configuration vs App Settings</title>
      <link>https://thecloudhub.com/2019/03/28/azure-app-configuration-vs-app-settings/</link>
      <pubDate>Thu, 28 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/28/azure-app-configuration-vs-app-settings/</guid>
      <description>For a long time now, App Settings have been the way to configure your app&amp;rsquo;s settings such as environment variables and connection strings for Azure App Services.
In February 2019, Microsoft announced a new service called App Configuration - which, currently in preview - allows you to easily centralise your app settings across multiple resources.
Why is App Settings a problem? App Settings are great - if you only need those settings for one resource (eg.</description>
      <content:encoded><![CDATA[<p>For a long time now, App Settings have been the way to configure your app&rsquo;s settings such as environment variables and connection strings for Azure App Services.</p>
<p>In February 2019, Microsoft announced a new service called App Configuration - which, currently in preview - allows you to easily centralise your app settings across multiple resources.</p>
<h2 id="why-is-app-settings-a-problem">Why is App Settings a problem?</h2>
<p>App Settings are great - if you only need those settings for one resource (eg. an app service). But if you&rsquo;re working with, say, a microservice that might be made up of many resources including an app service and maybe a functions app that all share similar configurations, keeping track of what settings were made where can quickly become problematic.</p>
<p>Amongst other things, there&rsquo;s no easy way to do things like point-in-time replays of settings, so you can see what changed or keep the settings the same if you need to rebuild or deploy a specific version of your app.</p>
<h2 id="what-does-app-configuration-offer-that-app-settings-doesnt">What does App Configuration offer that App Settings doesn&rsquo;t?</h2>
<p>App Configuration is a fully managed service that offers the ability to store all your app configuration values in one location, with the ability to compare settings at specific times and with specific labels.</p>
<p>Operating in a similar fashion to Key Vault, it&rsquo;s a separate resource from your app service (although you can configure it immediately by going to the new preview tab in your app services), and there are a number of SDKs available to integrate with it for .NET core,  .NET and Java.</p>
<p>You can think of App Configuration as a counterpart to Key Vault for properties that don&rsquo;t need to be stored as secrets. Connection strings would likely still go in Key Vault, but properties that aren&rsquo;t secrets should be stored in App Configuration.</p>
<p>First you&rsquo;ll need to setup a connection string which you can find under the &ldquo;Settings&rdquo; → &ldquo;Access Keys&rdquo; section of your App Configuration resource. Then, within App Configuration, you set a number of key value pairs, which you can then access in a similar fashion to the way you get environment variables in App Settings:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#66d9ef">var</span> configBuilder = <span style="color:#66d9ef">new</span> ConfigurationBuilder();
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> config = Environment.GetEnvironmentVariable(<span style="color:#e6db74">&#34;YourKeyNameFromAppConfiguration&#34;</span>)
</span></span><span style="display:flex;"><span>configBuilder.AddAzureAppConfiguration(config);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> config = configBuilder.Build();
</span></span></code></pre></td></tr></table>
</div>
</div><p>You can also import and export settings easily, and can use JSON, YAML or a Properties file. You can also export the settings for a specific time and date.</p>
<p>At present, because the service is in preview there are no additional charges. Microsoft hasn&rsquo;t yet stated its intentions for charging for this service, but given the similarities with Key Vault (which is a paid service) it&rsquo;s easy to see how a similar model <em>could</em> apply if they decided.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Understanding the Newtonsoft JSON Token</title>
      <link>https://thecloudhub.com/2019/03/26/understanding-the-newtonsoft-json-token/</link>
      <pubDate>Tue, 26 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/26/understanding-the-newtonsoft-json-token/</guid>
      <description>One of the concepts worth understanding when writing a custom converter for the popular Newtonsoft JSON framework is that of the JsonToken, and the role it plays in helping you understand the JSON being read.
The JsonToken documentation for Newtonsoft is relatively sparse - in part because once you understand it, it&amp;rsquo;s a relatively simple concept.
Effectively, when you&amp;rsquo;re attempting to deserialise a string representation of a JSON object, such as in the ReadJson method of a custom JsonConverter, the JsonToken represents each element or component (token if you prefer) of the object as it&amp;rsquo;s deserialised.</description>
      <content:encoded><![CDATA[<p>One of the concepts worth understanding when writing a custom converter for <a href="https://github.com/JamesNK/Newtonsoft.Json">the popular Newtonsoft JSON framework</a> is that of the <code>JsonToken</code>, and the role it plays in helping you understand the JSON being read.</p>
<p>The <code>JsonToken</code> documentation for Newtonsoft is relatively sparse - in part because once you understand it, it&rsquo;s a relatively simple concept.</p>
<p>Effectively, when you&rsquo;re attempting to deserialise a string representation of a JSON object, such as in the <code>ReadJson</code> method of a custom <code>JsonConverter</code>, the <code>JsonToken</code> represents each element or component (token if you prefer) of the object as it&rsquo;s deserialised.</p>
<p>So for example, if you have the following JSON and implement the <code>ReadJson</code> method:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>{	&#34;message&#34;: &#34;Hello world&#34;}
</span></span></code></pre></td></tr></table>
</div>
</div><p>When you first get the <code>reader.TokenType</code> value you&rsquo;ll get <code>JsonToken.StartObject</code> back - this represents that the <code>{</code> implies that you&rsquo;re first reading an object element.</p>
<p>If you were to then call <code>reader.ReadAsync()</code>, and then subsequently request the <code>reader.TokenType</code> again now you&rsquo;ll get <code>JsonToken.PropertyName</code> in response. This is because the next element within the JSON string is the property name (in other words, the &ldquo;message&rdquo; key).</p>
<p>Lastly, if you were to call <code>reader.ReadAsync()</code> for a third time, you&rsquo;d get back <code>JsonToken.String</code> as the value of the property is a string (&ldquo;Hello world&rdquo;). NewtonSoft will try and parse the value into a representation of a type - so for example, if that was a number, you&rsquo;d get back <code>Integer</code> of <code>Float</code>, and if it was a Boolean you&rsquo;d get back <code>Boolean</code>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Which Azure Functions runtime am I using?</title>
      <link>https://thecloudhub.com/2019/03/25/which-azure-functions-runtime-am-i-using/</link>
      <pubDate>Mon, 25 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/25/which-azure-functions-runtime-am-i-using/</guid>
      <description>Microsoft currently support two versions of the Azure Functions runtime - version 1 and version 2. This post will look at the main changes between the two versions, and show you how you can check which runtime you&amp;rsquo;re using.
What are the key differences between versions? Version 1 of the runtime was introduced back in 2016, when functions were first announced. At launch it supported JavaScript, C#, Python and PHP.</description>
      <content:encoded><![CDATA[<p>Microsoft currently support two versions of the Azure Functions runtime - version 1 and version 2. This post will look at the main changes between the two versions, and show you how you can check which runtime you&rsquo;re using.</p>
<h2 id="what-are-the-key-differences-between-versions">What are the key differences between versions?</h2>
<p>Version 1 of the runtime was introduced back in 2016, when functions were first announced. At launch it supported JavaScript, C#, Python and PHP.</p>
<p>In late September 2018 Microsoft made <a href="https://azure.microsoft.com/en-au/blog/introducing-azure-functions-2-0/">the Functions 2 runtime generally available</a> and with it bought a number of significant development, deployment and performance improvements including the ability to use the runtime anywhere - on a Mac or Linux machine too! It&rsquo;s worth noting that as of March 2019, Python support for Functions 2 is still in preview.</p>
<p>There were significant under the hood changes made to improve performance - and .NET Core 2.1 support was added, alongside a move to .NET Core powering the functions host process instead of .NET.</p>
<p>Big changes were made to the way that bindings work - as part of 2.0 they became extensions instead of being bundled into the runtime itself (aside from HTTP and timer support which are deemed core to the experience). This means that some bindings didn&rsquo;t make it over yet to the new 2.0 runtime - your mileage may vary, but the <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings#supported-bindings">Microsoft bindings docs</a> have a clearer comparison between the two.</p>
<p>There are also a bunch of new integrations with Functions 2 - for instance, Application Insights is supported with minimal configuration required, while you can easily use deployment centre to add code from other sources such as Github repos into your functions app.</p>
<h2 id="how-can-i-tell-what-runtime-im-using">How can I tell what runtime I&rsquo;m using?</h2>
<p>If you&rsquo;re running a functions app on a Mac or Linux machine - there&rsquo;s a fair chance you&rsquo;re using the 2.0 runtime, as that&rsquo;s what the functions command line tools support. You can verify this by opening the <code>host.json file</code> within the root directory of your app, which should look something like this:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>{    &#34;version&#34;: &#34;2.0&#34;,    &#34;extensions&#34;: {      &#34;http&#34;: {        &#34;routePrefix&#34;: &#34;&#34;      }    } }
</span></span></code></pre></td></tr></table>
</div>
</div><p>The <code>version</code> field directly references the version of the functions runtime you&rsquo;re using. If it says 2.0, you&rsquo;re using version 2 - if it&rsquo;s 1 or missing completely, you&rsquo;re on the first version of the runtime.</p>
<p>Similarly, you can also view the runtime for your app through the Azure Portal - open your app in the portal, then navigate to &ldquo;Function app settings&rdquo; where you&rsquo;ll see the below &ldquo;Runtime version&rdquo; setting.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Azure Functions App vs Functions</title>
      <link>https://thecloudhub.com/2019/03/24/azure-functions-app-vs-function/</link>
      <pubDate>Sun, 24 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/24/azure-functions-app-vs-function/</guid>
      <description>A common question asked by newcomers to the world of Azure Functions, is what&amp;rsquo;s the difference between an Azure functions app vs a function? Are they the same thing?
In short, there is a difference. You can think of the f_unctions app_ as if it refers to a workspace that contains one or more functions. It&amp;rsquo;s essentially a wrapper (or in .NET terms, project), holding all your Azure functions in one place and allowing for easy deployment and management of them as one.</description>
      <content:encoded><![CDATA[<p>A common question asked by newcomers to the world of Azure Functions, is what&rsquo;s the difference between an Azure functions app vs a function? Are they the same thing?</p>
<p>In short, there is a difference. You can think of the f_unctions app_ as if it refers to a workspace that contains one or more functions. It&rsquo;s essentially a wrapper (or in .NET terms, project), holding all your Azure functions in one place and allowing for easy deployment and management of them as one.</p>
<p>On the other hand, a function refers to a single, isolated piece of functionality. Typically in .NET this results in a class that performs one discrete piece of behaviour.</p>
<p>There are a number of ramifications for function apps that don&rsquo;t apply to individual functions. For instance, it&rsquo;s at the function app level that the pricing plan, runtime version and more are set in Azure. Microsoft refers to this as providing the <em>execution context</em> for your functions.</p>
<p>So keep in mind that when you first create a function resource in the Azure Portal, you&rsquo;re creating a functions app. Once you navigate inside that resource, you can then start to add individual functions.</p>
]]></content:encoded>
    </item>
    <item>
      <title>What&#39;s an Azure Service Principal and Managed Identity?</title>
      <link>https://thecloudhub.com/2019/03/22/whats-an-azure-service-principal-and-managed-identity/</link>
      <pubDate>Fri, 22 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/22/whats-an-azure-service-principal-and-managed-identity/</guid>
      <description>In this post, we&amp;rsquo;ll take a brief look at the difference between an Azure service principal and a managed identity (formerly referred to as a Managed Service Identity or MSI).
Dive deeper into Azure AD service principals and managed identities in our new detailed ebook about Azure AD
What is a service principal or managed service identity? Lets get the basics out of the way first. In short, a service principal can be defined as:</description>
      <content:encoded><![CDATA[<p>In this post, we&rsquo;ll take a brief look at the difference between an Azure service principal and a managed identity (formerly referred to as a Managed Service Identity or MSI).</p>
<p><a href="https://thecloudhub.com/books/azure-ad-apps/">Dive deeper into Azure AD service principals and managed identities in our new detailed ebook about Azure AD</a></p>
<h2 id="what-is-a-service-principal-or-managed-service-identity">What is a service principal or managed service identity?</h2>
<p>Lets get the basics out of the way first. In short, a service principal can be defined as:</p>
<blockquote>
<p>An application whose tokens can be used to authenticate and grant access to specific Azure resources from a user-app, service or automation tool, when an organisation is using Azure Active Directory.</p>
</blockquote>
<p>In essence, service principals help us avoid having to create fake users in Active Directory in order to manage authentication when we need to access Azure resources.</p>
<p>Stepping back a bit, and its important to remember that service principals are defined on a per-tenant basis. This is different to the application in which principals are created - the application sits across every tenant.</p>
<p>Managed identities are often spoken about when talking about service principals, and that&rsquo;s because its now the preferred approach to managing identities for apps and automation access. In effect, a managed identity is a layer on top of a service principal, removing the need for you to manually create and manage service principals directly.</p>
<p>There are two types of managed identities:</p>
<ul>
<li>
<p>System-assigned: These identities are tied directly to a resource, and abide by that resources&rsquo; lifecycle. For instance, if that resource is deleted then the identity too will be removed</p>
</li>
<li>
<p>User-assigned: These identities are created independent of a resource, and as such can be used between different resources. Removing them is a manual process whenever you see fit</p>
</li>
</ul>
<p>One of the problems with managed identities is that for now only a <a href="https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/services-support-msi">limited subset of Azure services support using them</a> as an authentication mechanism. If the service you use doesn&rsquo;t support MI, then you&rsquo;ll need to either continue to manually create your service/security principals.</p>
<h2 id="so-whats-the-difference">So what&rsquo;s the difference?</h2>
<p>Put simply, the difference between a managed identity and a service principal is that a managed identity <em>manages</em> the creation and automatic renewal of a service principal on your behalf.</p>
<p><strong>Update 31/1/20:</strong> If you&rsquo;re using Azure Web Apps, check out our <a href="https://thecloudhub.com/2020/01/managed-identities-and-azure-app-service-staging-slots/">new post on using managed identities with deployment slots</a></p>
]]></content:encoded>
    </item>
    <item>
      <title>Using key vault values from variable groups in Azure DevOps pipeline tasks</title>
      <link>https://thecloudhub.com/2019/03/21/using-key-vault-values-from-variable-groups-in-azure-devops-pipeline-tasks/</link>
      <pubDate>Thu, 21 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/21/using-key-vault-values-from-variable-groups-in-azure-devops-pipeline-tasks/</guid>
      <description>Earlier this week we had a post about how you can easily access secrets stored within Azure Key Vault in an Azure DevOps pipeline task, using the Key Vault Task. One other way you can achieve this same functionality is by using a variable group, and in this post we&amp;rsquo;re going to show you how.
Why would you use a variable group instead of the key vault task? If you know you require access to the secrets from across multiple stages within a pipeline using a group allows you to easily manage access without having to include the task in every single stage by scoping the group to the release or specific stages.</description>
      <content:encoded><![CDATA[<p>Earlier this week we had a post about how you can easily access secrets stored within Azure Key Vault in an Azure DevOps pipeline task, using the Key Vault Task. One other way you can achieve this same functionality is by using a variable group, and in this post we&rsquo;re going to show you how.</p>
<p>Why would you use a variable group instead of the key vault task? If you know you require access to the secrets from across multiple stages within a pipeline using a group allows you to easily manage access without having to include the task in every single stage by scoping the group to the release or specific stages.</p>
<p>However, if only one stage requires access to the secrets it might be easier to just include the task in that particular stage and follow our previous post.</p>
<h2 id="getting-started">Getting started</h2>
<p>First you&rsquo;ll need to setup your key vault so that your service principal or managed identity has GET access to your vault. Then, follow our previous post on creating a variable group with a key vault to setup DevOps for this integration.</p>
<p>Once you&rsquo;ve done the above, it&rsquo;s time to get started. Navigate to your release pipeline in Azure DevOps.</p>
<h2 id="connecting-the-variable-group">Connecting the variable group</h2>
<p>From your release pipeline, click &ldquo;Edit&rdquo;. Go to the &ldquo;Variables&rdquo; tab at the top of the screen, and choose &ldquo;Variable groups&rdquo;.</p>
<p>Select the variable group you created in the above section, scope it to either the entire release or a stage of your pipeline (depending on where you need to have access to the secrets, keeping in mind the more restricted you can make it the better from a security perspective) and click &ldquo;Save&rdquo;.</p>
<p>Now from within your tasks, if you need to reference the secrets you can use the <code>$(your-variable-name)</code> syntax. For instance, in the Azure Function App Deploy task, if we wanted to specify an app setting under &ldquo;Application and Configuration Settings&rdquo; we could use the following syntax:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>-NOTIFICATIONHUB_CONNECTIONSTRING $(your-connection-string-secret-identifier)
</span></span></code></pre></td></tr></table>
</div>
</div><p>The benefit of this is that the syntax is identical to that used with the key vault task (they both set the secrets as task variables) so if you need to, you can swap between using a variable group or key vault task with ease.</p>
<h2 id="summary">Summary</h2>
<p>In summary, this is an alternative approach to using the key vault task in a pipeline. Depending on your needs, this may be a <em>better</em> approach than the other lesson, but mileage may vary.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Throw or throw ex in C#?</title>
      <link>https://thecloudhub.com/2019/03/20/throw-or-throw-ex-in-c/</link>
      <pubDate>Wed, 20 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/20/throw-or-throw-ex-in-c/</guid>
      <description>One common question that comes up when working with exceptions in C#, is whether or not you should re-throw an existing exception by specifying the exception, or just using the throw keyword where an error occurs.
In most cases, it&amp;rsquo;s best to rethrow the existing exception, such as below:
1 try {	var networkResponse = await someNetworkService.GetAllPosts();}catch (Exception ex){	Log.Warning(&amp;#34;An exception occurred&amp;#34;, ex);	//Now lets rethrow this same exception	throw;} By doing so, you ensure that the original stack trace for the exception is maintained.</description>
      <content:encoded><![CDATA[<p>One <a href="https://stackoverflow.com/questions/178456/what-is-the-proper-way-to-re-throw-an-exception-in-c">common question</a> that comes up when working with exceptions in C#, is whether or not you should re-throw an existing exception by specifying the exception, or just using the <code>throw</code> keyword where an error occurs.</p>
<p>In most cases, it&rsquo;s best to rethrow the existing exception, such as below:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>try {	var networkResponse = await someNetworkService.GetAllPosts();}catch (Exception ex){	Log.Warning(&#34;An exception occurred&#34;, ex);	//Now lets rethrow this same exception	throw;}
</span></span></code></pre></td></tr></table>
</div>
</div><p>By doing so, you ensure that the original stack trace for the exception is maintained. If you were to instead do something like this:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>try {	var networkResponse = await someNetworkService.GetAllPosts();}catch (Exception ex){	Log.Warning(&#34;An exception occurred&#34;, ex);	//Now lets throw ex again	throw ex;}
</span></span></code></pre></td></tr></table>
</div>
</div><p>You&rsquo;ll now see that the exception stack trace only goes as far back as this line of code - not to the raw source of the exception.</p>
<p>In short, that&rsquo;s why its normally better to just throw again, instead of specifying the exception when re-throwing.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Accessing Key Vault secrets in an Azure DevOps pipeline task</title>
      <link>https://thecloudhub.com/2019/03/19/accessing-key-vault-secrets-in-an-azure-devops-pipeline-task/</link>
      <pubDate>Tue, 19 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/19/accessing-key-vault-secrets-in-an-azure-devops-pipeline-task/</guid>
      <description>In the post, we&amp;rsquo;ll take a look at one option for accessing Azure Key Vault secrets from within an Azure DevOps release pipeline.
Want to secure your Azure DevOps application secrets in Key Vault? Find out how in our short e-book guide on Amazon
Setting up your Azure Key Vault Before you can add the secret to your pipeline, you first need to make sure that there&amp;rsquo;s a key vault setup in Azure, and that you have given either your pipeline managed service identity or account GET access to the secrets within the vault.</description>
      <content:encoded><![CDATA[<p>In the post, we&rsquo;ll take a look at one option for accessing Azure Key Vault secrets from within an Azure DevOps release pipeline.</p>
<p><a href="https://www.amazon.com/Securing-Secrets-DevOps-Brenton-Currie-ebook/dp/B07VR82RN9">Want to secure your Azure DevOps application secrets in Key Vault? Find out how in  our short e-book guide on Amazon</a></p>
<h2 id="setting-up-your-azure-key-vault">Setting up your Azure Key Vault</h2>
<p>Before you can add the secret to your pipeline, you first need to make sure that there&rsquo;s a key vault setup in Azure, and that you have given either your pipeline managed service identity or account GET access to the secrets within the vault. Note that you need to ensure this is set under your key vault&rsquo;s &ldquo;Settings&rdquo; → &ldquo;Access Policies&rdquo; section.</p>
<p>If you haven&rsquo;t already, add your secrets into the &ldquo;Secrets&rdquo; section, and take note of the names used for the secrets - you&rsquo;ll need these a bit later on.</p>
<h2 id="adding-the-azure-key-vault-pipeline-task">Adding the Azure Key Vault pipeline task</h2>
<p>Now that you&rsquo;ve got your secrets stored and accessible from key vault, it&rsquo;s time to configure the Dev Ops pipeline. Open the visual pipeline editor for your pipeline by clicking &ldquo;Edit&rdquo;, and choose the stage in which you need access to the secrets.</p>
<p>Then, click the &ldquo;+&rdquo; button next to &ldquo;Run on agent&rdquo; (or whatever the first step of your pipeline may be) and search for &ldquo;Azure Key Vault&rdquo;. Note that you&rsquo;ll want to add the &ldquo;Download Key Vault Secrets&rdquo; task that appears first - this is the official task from Microsoft.</p>
<p>Then, click on the new &ldquo;Azure Key Vault&rdquo; task you just added to your pipeline, and set a display name. Choose the Azure subscription in which you created your key vault, and then select from the &ldquo;Key vault&rdquo; dropdown list the name of the key vault you stored your secrets in.</p>
<p>If you can&rsquo;t see it listed, it&rsquo;s possible you managed service identity doesn&rsquo;t have the correct permission, so be sure to check it&rsquo;s been added to your key vault with GET permission.</p>
<p>Now drag the key vault task up your pipeline task list (if applicable) so that it runs <em>before</em> any other task that requires a secret stored within your key vault.</p>
<p>And that&rsquo;s it!</p>
<h2 id="accessing-a-key-vault-secret-from-other-tasks">Accessing a Key Vault secret from other tasks</h2>
<p>Now other tasks can access the secrets, by using a task variable. The key vault task will make all your secrets available using the <code>$(&lt;your secret name here&gt;)</code> syntax, such as $(<code>api-secret</code>).</p>
<h2 id="summary">Summary</h2>
<p>This is just one of the various ways that you can access key vault secrets from a Dev Ops pipeline task. Stay tuned for more posts where we explore other ways of accessing the secrets in tasks.</p>
<p>If you want a more in-depth guide and comparison between alternative approaches to storing secrets in DevOps, you can also <a href="https://www.amazon.com/Securing-Secrets-DevOps-Brenton-Currie-ebook/dp/B07VR82RN9">get our book on Amazon today</a>.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to add Application Insights to an Azure function</title>
      <link>https://thecloudhub.com/2019/03/18/how-to-add-application-insights-to-an-azure-function/</link>
      <pubDate>Mon, 18 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/18/how-to-add-application-insights-to-an-azure-function/</guid>
      <description>Today we&amp;rsquo;re going to look at how easy it is to add Azure Application Insights (part of Azure Monitor) to an Azure Function.
What is Application Insights? In short, Application Insights is a performance and monitoring tool that forms part of the Azure Monitor suite. It allows you to access detailed telemetry on requests made to your function, while observing real-time performance and failures. It works across App Service apps, Azure Functions and more - practically anywhere you can install the available App Insights SDKs.</description>
      <content:encoded><![CDATA[<p>Today we&rsquo;re going to look at how easy it is to add Azure Application Insights (part of Azure Monitor) to an Azure Function.</p>
<h2 id="what-is-application-insights">What is Application Insights?</h2>
<p>In short, Application Insights is a performance and monitoring tool that forms part of the Azure Monitor suite. It allows you to access detailed telemetry on requests made to your function, while observing real-time performance and failures. It works across App Service apps, Azure Functions and more - practically anywhere you can install the available <a href="https://github.com/Microsoft/ApplicationInsights-Home">App Insights SDKs</a>.</p>
<p>You can find the full pricing information <a href="https://azure.microsoft.com/en-us/pricing/details/monitor/">here</a>, but you effectively get charged per GB of ingested data (5GB included free per month).</p>
<h2 id="how-can-i-enable-this-for-my-azure-function-app">How can I enable this for my Azure Function App?</h2>
<p>For Azure Functions, it&rsquo;s super simple to enable App Insights. You don&rsquo;t even need to add the SDKs - Microsoft handles that for you.</p>
<p>First, you&rsquo;ll need to create an Application Insights instance. Open the Azure Portal, click &ldquo;Create a resource&rdquo; and search for &ldquo;Application Insights&rdquo;.</p>
<p>Enter a friendly and unique name for your instance, and depending on the language you write your functions in, choose General or Node.js for the &ldquo;Application Type&rdquo;.</p>
<p>Choose a subscription and resource group (ideally matching those of your Azure Function app) and a location. Note that App Insights is only supported in a limited number of regions worldwide, so you might need to choose a different region to that of your functions app.</p>
<p>Once that&rsquo;s been created, open the App Insights resource. On the &ldquo;Overview&rdquo; page, you&rsquo;ll see in the top section an &ldquo;Instrumentation Key&rdquo;. Copy this - it&rsquo;s essentially the identifier that will allow you function app to report data back into this App Insights resource.</p>
<p>Now navigate to your function app in the Azure Portal. Select the app name in the sidebar, and choose &ldquo;Platform Features&rdquo; on the right-hand side of the screen.</p>
<p>Next, open &ldquo;Application settings&rdquo;. Scroll down until you see the &ldquo;Application settings&rdquo; header. At the bottom of this section, you&rsquo;ll see a &ldquo;Add new setting&rdquo; button - click this to add a new row.</p>
<p>Now in the &ldquo;App Setting Name&rdquo; column, type &ldquo;APPINSIGHTS_INSTRUMENTATIONKEY&rdquo;. In the &ldquo;Value&rdquo; column, paste the &ldquo;Instrumentation Key&rdquo; that we copied in the earlier step from your App Insights resource. Scroll back to the top of the page, and click &ldquo;Save&rdquo;.</p>
<h2 id="summary">Summary</h2>
<p>And that&rsquo;s it! That&rsquo;s how easy it is to enable App Insights for Azure Functions. If you want to see metrics coming through straight away, navigate to your App Insights resource and click &ldquo;Live Metrics&rdquo;. Make an API request to your function (assuming it&rsquo;s HTTP based - otherwise trigger it however you can) and you should see the request come through instantly.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Create an Azure Function App using a Mac</title>
      <link>https://thecloudhub.com/2019/03/14/create-an-azure-function-app-using-a-mac/</link>
      <pubDate>Thu, 14 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/14/create-an-azure-function-app-using-a-mac/</guid>
      <description>In this post, we&amp;rsquo;ll take a look at how you can quickly create an Azure Function when using a Mac. In particular, we&amp;rsquo;ll be using the Azure Functions command line tools to create our functions app.
Getting started Before you can create a function, you&amp;rsquo;ll need to install the Azure Function command line tools. But before you can continue, you need to make sure that you have installed Brew. If you&amp;rsquo;re not familiar with it, Brew is a package manager for the Mac - similar to NPM for Node.</description>
      <content:encoded><![CDATA[<p>In this post, we&rsquo;ll take a look at how you can quickly create an Azure Function when using a Mac. In particular, we&rsquo;ll be using the Azure Functions command line tools to create our functions app.</p>
<h2 id="getting-started">Getting started</h2>
<p>Before you can create a function, you&rsquo;ll need to install the Azure Function command line tools. But before you can continue, you need to make sure that you have <a href="https://brew.sh/">installed Brew</a>. If you&rsquo;re not familiar with it, Brew is a package manager for the Mac - similar to NPM for Node.Js projects.</p>
<p>Once you&rsquo;ve installed Brew, make sure you have the latest .NET Core SDK installed. If you&rsquo;re not sure, open Terminal and run:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>dotnet --version
</span></span></code></pre></td></tr></table>
</div>
</div><p>If you do get a version back, make sure it&rsquo;s at least 2.0.0 or above. If you get an error, you&rsquo;ll need to install it using the following Brew commands:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>brew tap caskroom/caskbrew cask install dotnet
</span></span></code></pre></td></tr></table>
</div>
</div><p>Run the same <code>dotnet version</code> command again to ensure the install was successful.</p>
<p>Now we need to install the Azure Function Core Tools:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>brew tap azure/functionsbrew install azure-functions-core-tools
</span></span></code></pre></td></tr></table>
</div>
</div><p>Once the install has finished, you&rsquo;re now ready to go creating your first function!</p>
<h2 id="creating-the-function-app">Creating the function app</h2>
<p>Now that we&rsquo;ve got all the dependencies installed, it&rsquo;s time to create our function app. Open Terminal, and navigate to a directory where you&rsquo;d like your app to be created (in our case, we&rsquo;re going to create it from the root Documents folder).</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>cd ~/Documents
</span></span></code></pre></td></tr></table>
</div>
</div><p>Now let&rsquo;s get started creating the app! First lets initialise the project:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>func init MyFirstFunctionApp --source-control true --worker-runtime dotnet
</span></span></code></pre></td></tr></table>
</div>
</div><p>This will create a folder called <code>MyFirstFunctionApp</code> inside your <code>Documents</code> folder. It will be initialised as a git repository (the source-control parameter) and have a dotnet runtime. If you&rsquo;d prefer a Node.Js function or a Python function, you can replace dotnet with either <code>node</code> or <code>python</code> respectively.</p>
<p>You&rsquo;ll now have your project - but at this point, it&rsquo;ll be empty with no functions. To add your first function, we need to run the following command to generate a function called MyFirstFunction:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span> func new --name MyFirstFunction
</span></span></code></pre></td></tr></table>
</div>
</div><p>It&rsquo;ll then ask you what type of template you&rsquo;d like to use. A template is effectively a trigger - what will cause your function to start running? We&rsquo;ll choose #2 (HttpTrigger) for now, as this will enable you to easily run your function via Curl, Postman or by visiting a page in your web browser. You can provide this in the previous command as <code>—template</code>, or select from the list.</p>
<p>You&rsquo;ll now have your first function and function app created! You can run it by entering:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>func start
</span></span></code></pre></td></tr></table>
</div>
</div><p>Once it&rsquo;s started, you should see the a message with the function URL, like this:</p>
<p>The sample function expects a name parameter to be provided, so open up your web browser and go to <a href="http://localhost:7071/api/MyFirstFunction?name=Bob">http://localhost:7071/api/MyFirstFunction?name=Bob</a>. You should get a response like:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>Hello, Bob
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="summary">Summary</h2>
<p>So that&rsquo;s how easy it is to get started with an Azure Function app on a Mac. Microsoft has done a lot of work around the tooling to make it as straightforward as possible.</p>
]]></content:encoded>
    </item>
    <item>
      <title>What&#39;s the difference between an Azure Service Bus queue and topic?</title>
      <link>https://thecloudhub.com/2019/03/13/whats-the-difference-between-an-azure-service-bus-queue-and-topic/</link>
      <pubDate>Wed, 13 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/13/whats-the-difference-between-an-azure-service-bus-queue-and-topic/</guid>
      <description>Starting out with an Azure Service Bus? It can be confusing trying to work out whether you should use a queue or a topic. In this post, we&amp;rsquo;ll try to break down the difference between the two and which one you should use when.
What is a service bus queue or topic? When configuring a service bus, you have two options for configuring how messages are processed - a queue, or a topic.</description>
      <content:encoded><![CDATA[<p>Starting out with an Azure Service Bus? It can be confusing trying to work out whether you should use a queue or a topic. In this post, we&rsquo;ll try to break down the difference between the two and which one you should use when.</p>
<h2 id="what-is-a-service-bus-queue-or-topic">What is a service bus queue or topic?</h2>
<p>When configuring a service bus, you have two options for configuring how messages are processed - a queue, or a topic.</p>
<p>Lets start with a queue. A queue has a one-to-one relationship between each message and its consumer, and is a way to ensure reliable first-in-first-out (FIFO) delivery to <em>one</em> processor from many sources. For example, you might have one WebJob that processes requests that get placed in the queue from many different sources. In most cases, the processor (or receiver) receives the messages in the same order that they were placed on the queue. The key to a queue is that each message from the queue is only ever processed by a single consumer.</p>
<p>In contrast, a topic follows the publish/subscribe pattern and can have many consumers who can each subscribe to receive notifications when a message is sent to the topic. In effect, this means you can have a one-to-many relationship between messages and consumers although this does depend on how you configure your filter rules (you can opt to have each message delivered to only 1 subscriber if you wish).</p>
<h2 id="whats-the-difference">What&rsquo;s the difference?</h2>
<p>In effect, the difference between a queue and topic can be described as follows:</p>
<ul>
<li>A queue can only be listened to by one consumer, whereas a topic can have multiple subscribers.</li>
<li>Topic subscriptions can <a href="https://github.com/Azure/azure-service-bus/tree/master/samples/DotNet/GettingStarted/Microsoft.Azure.ServiceBus/TopicSubscriptionWithRuleOperationsSample">enable powerful filtering capabilities</a>, such that you can define certain parameters that messages must meet in order to be copied into a subscriptions virtual queue. This can be handy if you need to handle different types of messages, or messages with variable data structures in the same topic.</li>
<li>Topics can be more scalable than queues, as more than one consumer can listen for messages. If you need to scale a queue, you&rsquo;re still limited to having the one consumer listening, so aside from horizontal scaling you&rsquo;re out of luck.</li>
<li>Both queue and topic subscriptions support <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.receivemode">PeekLock</a> and <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.receivemode">ReceiveAndDelete</a> modes, so you can ensure a message is processed before being dismissed if required.</li>
</ul>
<h2 id="when-should-i-use-a-topic-or-queue">When should I use a topic or queue?</h2>
<p>This is a trickier question to answer, and ultimately depends on how much you&rsquo;re <a href="https://azure.microsoft.com/en-us/pricing/details/service-bus/">willing to spend</a> on your service bus. If you&rsquo;re using the basic tier, then you only have the one option - queues. Topics are only supported in the standard and premium tier.</p>
<p>By moving to the standard or premium tier, you incur an hourly base charge as well as the per million operations fee which is charged in the basic tier.</p>
<p>Pricing aside, it also depends on the type of data that you&rsquo;re ingesting into your service bus. If its time-sensitive and high volume, topics would be the ideal approach as you can more easily scale your downstream consumer to handle the larger volume of messages.</p>
<p>If on the other hand you receive a relatively stable or low volume of messages which aren&rsquo;t necessarily time-critical (ie. they may sit on a queue for some time until the processor reaches them if the load is higher than anticipated) then you can probably get away with using a queue.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to use variable groups in Azure DevOps</title>
      <link>https://thecloudhub.com/2019/03/12/how-to-use-variable-groups-in-azure-devops/</link>
      <pubDate>Tue, 12 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/12/how-to-use-variable-groups-in-azure-devops/</guid>
      <description>In a previous post looking at how to use Azure Key Vault to store secrets for a DevOps pipeline, we touched on variable groups and how they can be used. In this post, we&amp;rsquo;re going to dive a bit deeper into what a variable group is, how you can create one and how you can link variable groups into your build pipeline.
Want to secure your Azure DevOps application secrets in Key Vault?</description>
      <content:encoded><![CDATA[<p>In a <a href="http://54.252.253.175/how-to-store-azure-devops-secrets-in-key-vault">previous post looking at how to use Azure Key Vault to store secrets for a DevOps pipeline</a>, we touched on variable groups and how they can be used. In this post, we&rsquo;re going to dive a bit deeper into what a variable group is, how you can create one and how you can link variable groups into your build pipeline.</p>
<p><a href="https://www.amazon.com/Securing-Secrets-DevOps-Brenton-Currie-ebook/dp/B07VR82RN9">Want to secure your Azure DevOps application secrets in Key Vault? Find out how in  our short e-book guide on Amazon</a></p>
<h2 id="what-is-a-variable-group">What is a variable group?</h2>
<p>A variable group is a logical collection of environment variables (or properties) used throughout your build and/or deployment pipelines. They are essentially key value pairs, that can include things like API keys, database connection strings or configuration items such as downstream API endpoint URLs.</p>
<p>Variable groups can store both plain text variables and secrets, which should never be committed into your source code repository. Note that if you want to use DevOps&rsquo; Azure Key Vault integration, you&rsquo;ll need to <a href="http://54.252.253.175/how-to-store-azure-devops-secrets-in-key-vault">create a separate variable group</a> as you can&rsquo;t mix and match Key Vault and DevOps variables in the same group.</p>
<h2 id="how-do-i-create-one">How do I create one?</h2>
<p>Creating a variable group is simple. Login to <a href="https://visualstudio.com">Azure DevOps</a> and navigate to &ldquo;Pipelines&rdquo; &gt; &ldquo;Library&rdquo;. You&rsquo;ll see in the top navigation bar the option to &ldquo;+ Variable Group&rdquo;. Clicking that will take you to a &ldquo;New variable group&rdquo; screen, that asks for a number of properties:</p>
<ul>
<li><strong>Variable group name</strong>: A friendly name used to refer to your new variable group. Use something that has meaning to you and the types of properties that will be stored within the group (ie. My App - Production)</li>
<li><strong>Description</strong>: Provide a short description that describes a bit more about the types of variables that should be placed within this group (eg. This group contains build settings and environment variables for production builds only)</li>
<li><strong>Allow access to all pipelines</strong>: Enable this toggle to ensure that you can access all the variables from all of your pipelines. If you don&rsquo;t enable it, you&rsquo;ll need to authorise pipelines defined in YAML manually in order to let them access your properties.</li>
<li><strong>Link secrets from an Azure key vault as variables:</strong> Enable this toggle if you want to use Azure Key Vault to store your secrets instead of DevOps. Note that by enabling this, you&rsquo;ll need to then provide key vault connection details, and enter your secrets via the Azure Portal instead.</li>
</ul>
<p>If you left the key vault integration disabled, you&rsquo;ll now be able to click &ldquo;Add&rdquo; below the &ldquo;Variables&rdquo; section to begin creating new properties. Each property can have a name and a value, and can be marked as clear text or secret by clicking the padlock icon at the end of each row.</p>
<p>If you need to customise security permissions, click &ldquo;Security&rdquo; at the top of the screen. This will bring up a modal window where you can add or remove user groups from being able to access this variable group.</p>
<p>Once you&rsquo;re done, hit &ldquo;Save&rdquo; and your variable group will be persisted.</p>
<h2 id="how-do-i-use-it">How do I use it?</h2>
<p>If you selected &ldquo;Allow access to all pipelines&rdquo; when creating the variable group, linking it with your build pipeline through the DevOps website is simple. Navigate to the pipeline you want to link the group with, click &ldquo;Edit&rdquo; in the top-left corner and then click &ldquo;Variables&rdquo; underneath your pipeline name.</p>
<p>You should see on the left-hand side &ldquo;Pipeline variables&rdquo; and &ldquo;Variable groups&rdquo;. Navigate to the latter, and click &ldquo;Link variable group&rdquo;. This brings up a modal that lists all the variable groups that your role has access to - if you can&rsquo;t see a group that you know exists, check to make sure you have set the right permissions in the &ldquo;Security&rdquo; window for that group.</p>
<p>Choose the group you want to link with the pipeline, and then the scope that the group applies to. If the variables are used throughout the pipeline, then you can choose to make it visible to the entire release, or if you know only a few scopes require access you can also choose specific scopes.</p>
<p>Click &ldquo;Link&rdquo; and you&rsquo;ve now made the variable group be accessible from your pipeline!</p>
<p>Alternatively, if you&rsquo;re using a YAML file to describe your pipelines and builds, you can also add a variable group by adding the following section in your YAML file:</p>
<div class="highlight"><div style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>variables:- group: your-new-variable-group-name
</span></span></code></pre></td></tr></table>
</div>
</div><p>One thing worth noting is that when you run a pipeline, DevOps will create an immutable snapshot with the values of the variables within your group so that your release remains in the same state. This ensures that it isn&rsquo;t influenced by future changes or modifications that you might make to the values, and means you can redeploy a release later if needed.</p>
<h2 id="summary">Summary</h2>
<p>Variable groups can be powerful tools for logically grouping properties and secrets that you need for build pipelines, and are simple to configure and use.</p>
]]></content:encoded>
    </item>
    <item>
      <title>How to store Azure DevOps secrets in Azure Key Vault</title>
      <link>https://thecloudhub.com/2019/03/08/how-to-store-azure-devops-secrets-in-key-vault/</link>
      <pubDate>Fri, 08 Mar 2019 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2019/03/08/how-to-store-azure-devops-secrets-in-key-vault/</guid>
      <description>Often when creating an Azure DevOps continuous integration/deployment pipeline there&amp;rsquo;s a need to store and use app secrets, such as client keys. While you can store secrets within Azure DevOps variable groups, an alternative approach is to use Azure Key Vault instead.
Want to secure your Azure DevOps application secrets in Key Vault? Find out how in our short e-book guide on Amazon
By using Azure Key Vault you get the same enhanced data protection that your other cloud apps can enjoy including activation and expiration dates, and the DevOps integration allows for the centralised management of keys used across apps or pipelines.</description>
      <content:encoded><![CDATA[<p>Often when creating an Azure DevOps continuous integration/deployment pipeline there&rsquo;s a need to store and use app secrets, such as client keys. While you <em>can</em> store secrets within Azure DevOps variable groups, an alternative approach is to use <a href="https://azure.microsoft.com/en-us/services/key-vault/">Azure Key Vault</a> instead.</p>
<p><a href="https://www.amazon.com/Securing-Secrets-DevOps-Brenton-Currie-ebook/dp/B07VR82RN9">Want to secure your Azure DevOps application secrets in Key Vault? Find out how in  our short e-book guide on Amazon</a></p>
<p>By using Azure Key Vault you get the same enhanced data protection that your other cloud apps can enjoy including activation and expiration dates, and the DevOps integration allows for the centralised management of keys used across apps or pipelines. Keep in mind if you decide to use key vault, you will be charged according to the <a href="https://azure.microsoft.com/en-us/pricing/details/key-vault/">Azure Key Vault pricing</a> for storing your secrets.</p>
<h2 id="setting-up-key-vault-access-in-azure-devops">Setting up Key Vault access in Azure DevOps</h2>
<p>Getting started is easy. Open Azure DevOps, and navigate to the project you wish to integrate with. Open the Pipelines section, and then go to Library.</p>
<p>If you already have secrets and values stored in an existing library, the easiest way to integrate with key vault is to create a separate variable group. If you don&rsquo;t, you&rsquo;ll get a message warning you that when you enable key vault in your existing group, it&rsquo;ll <strong>blow away</strong> all your existing variables saved within the group. This is because you can&rsquo;t use key vault variables side by side with Dev Ops variables within one group.</p>
<p>Open the new variable group, and you should see a toggle to link secrets from an Azure key vault as variables. Turn that on, and you&rsquo;ll see the option to set the Azure subscription to be used, and a field to specify a key vault name.</p>
<p>You&rsquo;ll need to ensure that you&rsquo;ve previously setup a connection to your Azure subscription within Azure DevOps, and added an Azure Resource Manager service connection using an Azure Service Principal to the resource group where your key vault is located. If you haven&rsquo;t, the management links next to each field will help you to setup these connections.</p>
<p>Once connected, pointing DevOps to your key vault is as easy as choosing the correct subscription from the drop down list and then selecting your key vault by name in the second drop down. If your service principal doesn&rsquo;t have get and list secret management permissions, you&rsquo;ll be prompted to automatically authorise it or manually do so in the Azure Portal.</p>
<p>If successfully connected, you&rsquo;ll be able to then see a list of secrets from your key vault by clicking the add button. Choose the secrets you want to make available to your pipeline and click OK.</p>
<p>Add your new variable group to your pipeline, and that&rsquo;s all there is to adding key vault secrets to an Azure DevOps pipeline.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
