<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dean De Maret on Medium]]></title>
        <description><![CDATA[Stories by Dean De Maret on Medium]]></description>
        <link>https://medium.com/@dean.de.maret?source=rss-b0b4ed8854e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hPSjVmqEQZbzspcn.</url>
            <title>Stories by Dean De Maret on Medium</title>
            <link>https://medium.com/@dean.de.maret?source=rss-b0b4ed8854e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 13:06:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dean.de.maret/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Azure, VSTS and terraform]]></title>
            <link>https://medium.com/@dean.de.maret/azure-vsts-and-terraform-14e07be95d82?source=rss-b0b4ed8854e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/14e07be95d82</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Dean De Maret]]></dc:creator>
            <pubDate>Wed, 05 Sep 2018 09:57:31 GMT</pubDate>
            <atom:updated>2018-09-05T09:57:31.484Z</atom:updated>
            <content:encoded><![CDATA[<p>Since the internet has been so lovely helping me with all my problems getting this to work, I thought it only fair that I also write about this adventure in the hopes that it can help the next person. Ideally after this blog post you know how to deploy infrastructure for microservices to a development, and production environment with Terraform and Azure.</p><p><strong>VSTS</strong></p><p>I am of the opinion that the code deploy and the infrastructure deploy should be separate build pipelines. Ideally you deploy code more than you make infrastructure changes so if you can save time in a build pipeline, you should. So this is how I do it in Visual Studio Team Services (VSTS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*y6WuSQKQ1XnCPZcJU28_ww.png" /><figcaption>How I organize the build pipelines in VSTS</figcaption></figure><p>This way has a couple advantages. Testing is made easier since we can see the output of the terraform plan build and visually inspect it. If we’re happy with it, we manually run the terraform apply build. I would imagine the workflow could be something like</p><ul><li>Make changes and make a PR to master</li><li>Someone approves PR and merges</li><li>QA kicks of the plan build and tests</li><li>If pass, someone kicks off the apply build and if fail, fix master :)</li></ul><p>Let’s take a deeper dive into these builds.</p><p>Our build pipeline is essentially 2 steps. First create a file locally (I use bash) that populates it with all the secret variables that you want. I use a variable group that <a href="https://docs.microsoft.com/en-us/vsts/pipelines/library/variable-groups?view=vsts#link-secrets-from-an-azure-key-vault-as-variables">links with an Azure Key Vault</a> that just populates these variables for you. The script itself is quite easy</p><pre>echo ‘secret_key = “$(secret_key)”‘ &gt; $(terraform-path)/secrets.tfvars</pre><p>This way you keep your secrets out of your build/code repository.</p><p>The next build step just uses a T<a href="https://marketplace.visualstudio.com/items?itemName=petergroenewegen.PeterGroenewegen-Xpirit-Vsts-Release-Terraform">erraform package on the marketplace</a> where you just fill out your variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*qcjhgZMbgcQx818Xy1r3BQ.png" /><figcaption>Terraform build step</figcaption></figure><p>Boom! VSTS done.</p><p><strong>Terraform</strong></p><p>I wrote an internal post of why I prefer Terraform over Azure Resource Manager (ARM) but the general gist was, writing Terraform is nicer and the documentation is better. Yes we’d be running behind on the API but that’s a small price to pay for my sanity.</p><p>Here’s the Terraform that we use for a service. I added comments in the Terraform that explain some of the extra hoops we have to jump through.</p><pre>terraform {<br>  backend &quot;azurerm&quot; {}<br>}</pre><pre>resource &quot;azurerm_resource_group&quot; &quot;default&quot; {<br>  name     = &quot;${var.service_name}-${var.env}-default&quot;<br>  location = &quot;${var.region}&quot;<br>}</pre><pre>resource &quot;azurerm_app_service&quot; &quot;default&quot; {<br>  name                = &quot;web-api&quot;<br>  location            = &quot;${azurerm_resource_group.default.location}&quot;<br>  resource_group_name = &quot;${azurerm_resource_group.default.name}&quot;<br>  app_service_plan_id = &quot;${azurerm_app_service_plan.default.id}&quot;</pre><pre>site_config {<br>    dotnet_framework_version = &quot;v4.0&quot;<br>    remote_debugging_enabled = true<br>    remote_debugging_version = &quot;VS2015&quot;<br>    http2_enabled = true<br>    always_on = true<br>  }</pre><pre>app_settings {<br>    &quot;secret_key&quot; = &quot;${var.secret_key}&quot;<br>  }<br>}</pre><pre>resource &quot;azurerm_app_service_slot&quot; &quot;default&quot; {<br>  name                = &quot;staging&quot;<br>  location            = &quot;${azurerm_resource_group.default.location}&quot;<br>  resource_group_name = &quot;${azurerm_resource_group.default.name}&quot;<br>  app_service_plan_id = &quot;${azurerm_app_service_plan.default.id}&quot;<br>  app_service_name    = &quot;${azurerm_app_service.default.name}&quot;<br>}</pre><pre>/*<br>Here&#39;s the weirdness. SSL and app services in terraform aren&#39;t fully supported yet. So we have to manually put our cert into azure keyvault and then reference that cert here. Keep an eye on <a href="https://github.com/terraform-providers/terraform-provider-azurerm/issues/1136">https://github.com/terraform-providers/terraform-provider-azurerm/issues/1136</a> to see if they solve this in a nicer way. Also you have to give permissions to app services to talk to keyvault which you do with the following command: Set-AzureRmKeyVaultAccessPolicy -VaultName VAULTNAME -ServicePrincipalName abfa0a7c-a6b6-4736-8310-5855508787cd -PermissionsToSecrets get<br>Disgusting I know.<br>*/</pre><pre>resource &quot;azurerm_template_deployment&quot; &quot;ssl_certificate_default&quot; {<br>  name                = &quot;${format(&quot;%s-arm-certs&quot;, &quot;default&quot;)}&quot;<br>  resource_group_name = &quot;${azurerm_resource_group.default.name}&quot;<br>  deployment_mode     = &quot;Incremental&quot;</pre><pre>template_body = &lt;&lt;DEPLOY<br>{<br>    &quot;$schema&quot;: &quot;<a href="https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#">https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#</a>&quot;,<br>    &quot;contentVersion&quot;: &quot;1.0.0.0&quot;,<br>    &quot;parameters&quot;: {<br>        &quot;sslCertificateName&quot;: {<br>            &quot;type&quot;: &quot;string&quot;<br>        },<br>        &quot;keyVaultId&quot; :{<br>            &quot;type&quot;: &quot;string&quot;<br>        },<br>        &quot;servicePlanId&quot;: {<br>            &quot;type&quot;: &quot;string&quot;<br>        },<br>        &quot;appServiceName&quot;:{<br>            &quot;type&quot;: &quot;string&quot;<br>        },<br>        &quot;appServiceFQDN&quot;:{<br>            &quot;type&quot;: &quot;string&quot;<br>        },<br>        &quot;thumbprint&quot;:{<br>            &quot;type&quot;: &quot;string&quot;<br>        }<br>    },<br>    &quot;resources&quot;: [<br>        {<br>            &quot;type&quot;:&quot;Microsoft.Web/certificates&quot;,<br>            &quot;name&quot;:&quot;[parameters(&#39;sslCertificateName&#39;)]&quot;,<br>            &quot;apiVersion&quot;:&quot;2016-03-01&quot;,<br>            &quot;location&quot;:&quot;[resourceGroup().location]&quot;,<br>            &quot;properties&quot;:{<br>                &quot;keyVaultId&quot;:&quot;[parameters(&#39;keyVaultId&#39;)]&quot;,<br>                &quot;keyVaultSecretName&quot;:&quot;[parameters(&#39;sslCertificateName&#39;)]&quot;,<br>                &quot;serverFarmId&quot;: &quot;[parameters(&#39;servicePlanId&#39;)]&quot;<br>            }<br>        },<br>        {<br>            &quot;type&quot;:&quot;Microsoft.Web/sites/hostnameBindings&quot;,<br>            &quot;name&quot;:&quot;[concat(parameters(&#39;appServiceName&#39;), &#39;/&#39;, parameters(&#39;appServiceFQDN&#39;))]&quot;,<br>            &quot;apiVersion&quot;:&quot;2016-03-01&quot;,<br>            &quot;location&quot;:&quot;[resourceGroup().location]&quot;,<br>            &quot;properties&quot;:{<br>                &quot;sslState&quot;:&quot;SniEnabled&quot;,<br>                &quot;thumbprint&quot;:&quot;[parameters(&#39;thumbprint&#39;)]&quot;<br>            },<br>            &quot;dependsOn&quot;: [<br>                &quot;[concat(&#39;Microsoft.Web/certificates/&#39;,parameters(&#39;sslCertificateName&#39;))]&quot;<br>            ]<br>        }<br>    ]<br>}<br>DEPLOY</pre><pre>parameters {<br>    &quot;appServiceName&quot;     = &quot;${azurerm_app_service.default.name}&quot;<br>    &quot;appServiceFQDN&quot;     = &quot;*.mycoolurl.com&quot;<br>    &quot;servicePlanId&quot;      = &quot;${element(azurerm_app_service_plan.default.*.id, count.index)}&quot;<br>    &quot;sslCertificateName&quot; = &quot;mycoolurl-pfx-01&quot;<br>    &quot;keyVaultId&quot;         = &quot;/subscriptions/{ID}/resourceGroups/{name}/providers/Microsoft.KeyVault/vaults/{name}&quot;<br>    &quot;thumbprint&quot;         = &quot;${var.thumbprint}&quot;<br>  }</pre><pre>depends_on = [<br>    &quot;azurerm_app_service.default&quot;,<br>    &quot;azurerm_app_service_plan.default&quot;<br>  ]<br>}</pre><p>There’s also a variables.tf where you put all your variables and this is the dev.tfvars that I use.</p><pre>service_name = &quot;my-cool-api&quot;<br>env = &quot;dev&quot;<br>thumbprint = &quot;Some SLL thumbprint&quot;<br>...</pre><p>In the dev.tfvars (or prod or stage) you put all your non secret variables. And the secret variables get pulled in during the build pipeline.</p><p><strong>Gotchas and Tips</strong></p><ul><li>Sometimes creation fails with no error code or message. In that case go into the resource in the azure portal and look for failed deployments in the Activity log. If you’re lucky it has an error message there and if you’re not, it will have something like “Please try again later”</li><li>Creation of an application gateway can take up to 30 mins. Also mine got into a stuck state where there was some sort of internal deadlock so I had to manually delete it and fiddle with Terraform</li><li>Once in a while completely destroy all your infrastructure and rebuild it. That’s just good practice</li><li>Some things you’ll only need to create once, like a bucket where you store your state files. I do this manually instead of writing Terraform. Another way is to add a RunOnce folder in github and add some terraform there so you’ll at least have the history</li><li>Write your Terraform in Visual Studio Code, the support is quite good</li><li>While you are working on this, you’ll make a lot of changes and as soon as it is in a “working state” you’ll stop and maybe deploy infrastructure once a week. Keep this in mind when you are deciding on <a href="https://en.wikipedia.org/wiki/KISS_principle">process</a> and <a href="https://en.wikipedia.org/wiki/You_aren%27t_gonna_need_it">workflow </a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14e07be95d82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The job hunt]]></title>
            <link>https://medium.com/@dean.de.maret/the-job-hunt-81f8105e9807?source=rss-b0b4ed8854e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/81f8105e9807</guid>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[job-hunting]]></category>
            <dc:creator><![CDATA[Dean De Maret]]></dc:creator>
            <pubDate>Wed, 02 May 2018 12:55:26 GMT</pubDate>
            <atom:updated>2018-05-02T12:55:26.861Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xBD3U4pQl3kdVmLawdWTGQ.jpeg" /></figure><p>Job hunting can be pretty stressful, I know it was for me at least. So here’s my experience job hunting for a job overseas from home.</p><p>The first job I applied for was a while ago at <a href="https://monzo.com/">Monzo</a>. Jen and I had been toying about the idea of moving overseas and Monzo seemed like a cool company to work for. So I sent my CV and hoped for an email back. After 2 days I got an invite for an interview in which I talked about my work at Xero. Seeing as they worked in the same sphere as Xero and I was at that moment obsessed with data streams the interview went quite well. I then got an invite for the exercise which was to write a web crawler. Since Monzo was a golang shop and I’m an i̶d̶i̶o̶t̶ avid learner I decided to write this webcrawler in golang too. The crawler was pretty meh, like it worked but obviously it was 1 step up from “hello world” so it was definitely not my greatest work. I then had an interview to talk about my solution with the CTO which is where I failed. The guy was very smart and the questions went very deep. How do you store the list? What would be a <a href="https://en.wikipedia.org/wiki/Trie">better data structure</a>? How would you make it <a href="https://golangbot.com/goroutines/">faster</a>? How would you stop it running out of memory? The questions were honestly really good and showed that I didn’t know my data structures that well so I got a nice email saying that I they were not progressing with my application. Oh well. Golang seems awesome tho.</p><p>Then we fully decided to go to Amsterdam. So I asked some people about what places to apply for and I went a bit mental. Here they are in no particular order:</p><p>Flow Traders: Instant deny. Probably because I didn’t have <a href="https://www.flowtraders.com/careers/jobs/tech/amsterdam/core-java-developer">Java</a> on my CV. I think one of the bonus points was showing off chess tournament awards???</p><p>Tommy Hilfiger: Literally the worst website to apply for a job. Possibly ever. One of those “upload your CV but also retype everything in these text boxes on this website that we made in the 90s”. Didn’t bother to apply. But honourable mention for having the worst website for applying for jobs.</p><p>Bunq: Send my CV and got invited to take the first test. It was one of those psychological tests (you get 6 boxes and a ? and then “what would you put in there). I decided to do the test with the help of the QA of our team because those tests are hilarious and then we failed. lol. Also their website says “You work not for money, not for status but to <a href="https://www.bunq.com/jobs">get shit done</a>” and I 100% work for money actually.</p><p>Messagebird: Instant deny. Don’t know why. Looks like a cool company.</p><p>Booking.com: This one was weird. I got referred by a friend who signed me up for Full Stack developer and did the test. Then I saw that they had an opening for tech lead and asked if I could apply for that. Didn’t hear anything for a week, then when I followed up they said the technical lead role was not available. I asked to go ahead with the Full stack role but then didn’t hear back again. So I asked my friend who directly emailed someone in Amsterdam and they instantly emailed me to set up a call. We had a long chat about me and about booking.com which was nice. It seemed that they had a massive monolith written I think in Scala but they want to break out to microservices in other languages but it definitely seemed like they got weighed down by that monolith. By the time they finally got the ball rolling I already had a job. Seems like they are the experts at A/B testing tho.</p><p>Uber: Uber is weird for me because it seems like they have amazing tech, everyone I talked to was absolutely lovely and they definitely made an impact on the world. But then every-time you see Uber in the news it’s bad. So I applied and I asked about it during my interview (it seems like they were surprised I asked). The answer was good and obviously the people I was talking to were lovely but then … It’s weird to express this. Basically I was thinking “how much money are my morals worth” and as soon as I thought that I knew Uber wasn’t for me. So I pulled out before the technical interview. The advice was “Read cracking the code interview and you’ll pass”.</p><p>LobsterInk: I went with this company so obviously I’m gonna be a bit biased here. It seems like a small company that is growing, all .NET people, everyone I talked to was lovely and the application process was fast, organised and seemed to always be with humans instead of robots. I liked it and I hate interviewing so :+1:</p><p>I also think about 20 of my emails just did not get an answer or got an answer way too late. Slipping through the cracks is so frustrating and I get that it’s probably an innocent error but even worse than getting denied is just getting ignored.</p><p>Best advice I would give past Dean (or future Dean) would be learn more about data structures and algorithms beforehand, don’t take it personally and stop being so nervous for technical tests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81f8105e9807" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>