<?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>azure-bicep on The Cloud Hub</title>
    <link>https://thecloudhub.com/tag/azure-bicep/</link>
    <description>Recent content in azure-bicep on The Cloud Hub</description>
    <generator>Hugo -- 0.118.2</generator>
    <language>en-au</language>
    <lastBuildDate>Wed, 24 Mar 2021 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://thecloudhub.com/tag/azure-bicep/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Getting started with Azure Bicep</title>
      <link>https://thecloudhub.com/2021/03/24/getting-started-with-bicep-for-azure/</link>
      <pubDate>Wed, 24 Mar 2021 00:00:00 +0000</pubDate>
      <guid>https://thecloudhub.com/2021/03/24/getting-started-with-bicep-for-azure/</guid>
      <description>Bicep is a new language from Microsoft that allows you to easily specify your Azure infrastructure as code.
It&amp;rsquo;s an improvement on writing Azure Resource Manager (ARM) templates directly by better supporting features such as type safety and code modularity and reuse.
That said, Bicep still has a very close relationship with ARM templates. In fact, it&amp;rsquo;s an abstraction over ARM templates with templates written using Bicep able to be transpiled back to ARM templates.</description>
      <content:encoded><![CDATA[<p>Bicep is a new language from Microsoft that allows you to easily specify your Azure infrastructure as code.</p>
<p>It&rsquo;s an improvement on writing Azure Resource Manager (ARM) templates directly by better supporting features such as type safety and code modularity and reuse.</p>
<p>That said, <a href="https://github.com/azure/bicep">Bicep</a> still has a very close relationship with ARM templates. In fact, it&rsquo;s an abstraction over ARM templates with templates written using Bicep able to be transpiled <em>back</em> to ARM templates. And if you have a bunch of existing ARM templates, they can be transpiled and converted <em>into</em> Bicep files.</p>
<p>Let&rsquo;s now take a look at how you can get started using Bicep.</p>
<h2 id="preparing-your-environment">Preparing your environment</h2>
<p>There&rsquo;s a few things you&rsquo;ll want to install in order to start using Bicep.</p>
<p>First you&rsquo;ll want to download <a href="https://code.visualstudio.com">Visual Studio Code</a> (free) and install the Bicep extension (also free). This will give you an editor in which to write your Bicep files, and the extension adds handy features such as Intellisense code suggestions and template validation to ensure the correct syntax.</p>
<p>You&rsquo;ll also need to install the Bicep command line interface (CLI). The easiest, cross-platform way to do this is by installing the <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli">Azure command line interface</a>. But if you&rsquo;re after an alternative, see <a href="https://github.com/Azure/bicep/blob/main/docs/installing.md">this list</a>.</p>
<h2 id="become-a-bicep-guru">Become a Bicep guru</h2>
<p>Dive deeper into Bicep with our getting started with Bicep course on Udemy today!</p>
<p><a href="https://www.udemy.com/course/azure-bicep/?referralCode=C607A504E006C9FB1B32">Start learning</a></p>
<h2 id="writing-your-first-bicep-file">Writing your first Bicep file</h2>
<p>Open Visual Studio Code, and create a new file called <code>HelloWorld.bicep</code>. In it, paste the following code:</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></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>resource appConfig &#39;Microsoft.AppConfiguration/configurationStores@2020-06-01&#39; = {
</span></span><span style="display:flex;"><span>  name: &#39;bicepDemoAppConfig&#39;
</span></span><span style="display:flex;"><span>  location: &#39;westus2&#39;
</span></span><span style="display:flex;"><span>  sku: {
</span></span><span style="display:flex;"><span>    name: &#39;standard&#39;
</span></span><span style="display:flex;"><span>  }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></td></tr></table>
</div>
</div><p>In this template, we&rsquo;re creating an <a href="https://azure.microsoft.com/en-us/services/app-configuration/">App Configuration service</a> in Azure. Lets breakdown the template:</p>
<p><code>appConfig</code> provides a local resource name for use within the template if you need to refer to this resource as a dependency, or from within another resource.</p>
<p><code>Microsoft.AppConfiguration/configurationStores@2020-06-01</code> refers to the resource type and the values that can be configured. See <a href="https://docs.microsoft.com/en-us/azure/templates/">this Microsoft documentation</a> for a full list of resource types.</p>
<p>As such, <code>name</code>, <code>location</code> and <code>sku</code> are all values that can be set for the resource type.</p>
<h2 id="next-steps">Next steps</h2>
<p>To learn how to deploy this template, or to find out about more advanced Bicep topics including for loops, conditional statements and modularised templates <a href="https://www.udemy.com/course/azure-bicep/?referralCode=C607A504E006C9FB1B32">check out our Udemy course on getting started with Bicep</a>.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
