<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Ivan Milano]]></title><description><![CDATA[Hi, I'm Ivan, the creator and writter of this blog. I write about code, photography, and slightly about cycling.]]></description><link>https://ivanmilano.com/</link><image><url>https://ivanmilano.com/favicon.png</url><title>Ivan Milano</title><link>https://ivanmilano.com/</link></image><generator>Ghost 2.21</generator><lastBuildDate>Thu, 16 Apr 2026 15:43:13 GMT</lastBuildDate><atom:link href="https://ivanmilano.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Microsoft Build 2020 takeaway]]></title><description><![CDATA[Here are some takeaway from the anuall Microsoft Build 2020 event.]]></description><link>https://ivanmilano.com/microsoft-build-2020-takeaway/</link><guid isPermaLink="false">5ec6186a8590f810d0efa7ab</guid><category><![CDATA[microsoft]]></category><category><![CDATA[build]]></category><category><![CDATA[azure]]></category><category><![CDATA[blazor]]></category><category><![CDATA[cmd]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Thu, 21 May 2020 08:14:30 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2020/05/Mosaic-1000x563.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://ivanmilano.com/content/images/2020/05/Mosaic-1000x563.jpg" alt="Microsoft Build 2020 takeaway"><p>The annual go-to conference for developers (and everybody else) that just loves Microsoft developer eco system has been carried out. This time it was 48-hour only digital experience, at no cost. As previously, and despite being a full-blown virtual conference, a lot of new and interesting stuff has been presented. But what are the actual take-aways.</p><p>As tech people it is easy to be overwhelmed since many things looks cool. The excitement is big and to-do list of trying out all the new stuff suddenly grows even bigger, and boom suddenly the list covers all the topics presented. So, with this let try to pull out some interesting stuff without flooding the list. Of course you should also have a look at this <a href="https://devblogs.microsoft.com/dotnet/">official dotnet blog</a>, the <a href="https://channel9.msdn.com/Events/Build">channel 9 Build videos</a> and <a href="https://ivanmilano.com/microsoft-build-2020-takeaway/%20for%20visual%20studio%20and%20visual%20studio%20code%20comming">Microsoft news page</a></p><p><a href="https://devblogs.microsoft.com/commandline/windows-terminal-1-0/"><strong>Windows Terminal</strong></a>: This one you should definitely give a try; a lot of features and settings possibilities. It can be download from the <a href="https://aka.ms/terminal">Microsoft Store</a> or from the <a href="https://github.com/microsoft/terminal/releases">GitHub releases page</a>. Also make sure to <a href="https://blogs.endjin.com/2020/05/5-tips-for-an-awesome-windows-terminal-experience/?utm_content=bufferf22d1&amp;utm_medium=social&amp;utm_source=twitter.com&amp;utm_campaign=buffer">check out this page</a> for some cool modifications of the terminal</p><p><strong><a href="https://devblogs.microsoft.com/commandline/windows-package-manager-preview/">Winget</a></strong>: The first official (I think) Windows Package Manager for Windows, though in preview</p><p><strong><a href="https://devblogs.microsoft.com/aspnet/blazor-webassembly-3-2-0-now-available/">Blazor WebAssembly</a>:</strong> An open sourced and cross-platform web UI framework for building single-page apps using .NET and C# instead of JavaScript. Even though I prefer using JavaScript and frameworks like <a href="https://vuejs.org/">VueJS</a> this one looks promising. It is also worth mentioning that now it is fully released and production ready</p><p><strong><a href="https://devblogs.microsoft.com/dotnet/welcome-to-c-9-0/">C# 9</a>: </strong>Improved pattern matching, immutability with Init-only properties, with-expressions, top-levels program are just some of the upcoming <a href="https://github.com/dotnet/roslyn/blob/master/docs/Language%20Feature%20Status.md">features</a></p><p><strong><a href="https://mybuild.microsoft.com/sessions/a49759ae-4de4-4d00-8b41-cfc96c3891bf">Application Insights &amp; Azure Monitor</a>: </strong>Extended support for containers, Azure Monitor for Storage &amp; Cosmos DB</p><p><strong><a href="https://developer.microsoft.com/en-us/office/blogs/whats-new-in-the-microsoft-teams-platform-microsoft-build-2020/">Teams</a></strong>: Integrations with Power Platform and extensions for visual studio and visual studio code are coming.</p><p><a href="https://techcommunity.microsoft.com/t5/microsoft-365-blog/announcing-microsoft-lists-your-smart-information-tracking-app/ba-p/1372233"><strong>Microsoft Lists</strong></a>: A to-do app to rule them all. To-do apps never gets boring.</p>]]></content:encoded></item><item><title><![CDATA[Azure DevOps pipelines with YAML and GitVersion]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h4 id="background">Background</h4>
<p>In Azure DevOps there are kind of two ways of setting up pipelines (previously also called builds). One can use the classic editor or the yaml approach. The classic editor is more visual where tasks can be added and modified. A typical setup can look something like this (non</p>]]></description><link>https://ivanmilano.com/azure-devops-build-with/</link><guid isPermaLink="false">5cfd5f299a228415a074bdb1</guid><category><![CDATA[azure]]></category><category><![CDATA[devops]]></category><category><![CDATA[ci]]></category><category><![CDATA[cd]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Sun, 09 Jun 2019 20:34:10 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2019/06/azure-devops.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h4 id="background">Background</h4>
<img src="https://ivanmilano.com/content/images/2019/06/azure-devops.jpg" alt="Azure DevOps pipelines with YAML and GitVersion"><p>In Azure DevOps there are kind of two ways of setting up pipelines (previously also called builds). One can use the classic editor or the yaml approach. The classic editor is more visual where tasks can be added and modified. A typical setup can look something like this (non dotnet core):</p>
<p><img src="https://ivanmilano.com/content/images/2019/06/azure-devops-classic-1.png" alt="Azure DevOps pipelines with YAML and GitVersion"></p>
<p>By clicking in the right top corner &quot;View YAML&quot; one can see the content of this setup in a yaml format. So basically this &quot;classic&quot; setup is also yaml based behind the scenes.</p>
<p>Instead of using the classical way, one can use yaml all the way. By this I mean that the yaml file will be part of the source checked in. By using one of the YAML variants below a pretty default azure-pipelines.yml is generated:</p>
<p><img src="https://ivanmilano.com/content/images/2019/06/azure-devops-yaml-wizzard.png" alt="Azure DevOps pipelines with YAML and GitVersion"></p>
<p>In most of my projects the auto generated yaml file is not sufficent. I usually need more tasks where gitversion is one of them. My azure-pipelines.yml often looks like this one. Behind the scenes I'm also using <a href="https://datasift.github.io/gitflow/IntroducingGitFlow.html">GitFlow</a></p>
<pre><code>trigger:
- develop
- release/*
- feature/*
- bugfix/*
- hotfix/*
 -refs/tags/*

pool:
  name: Default

variables:
  buildConfiguration: 'Release'

steps:
- task: GitVersion@4
  displayName: 'GitVersion'
  inputs:
    updateAssemblyInfo: true
    preferBundledVersion: false

- script: echo %Action%%BuildVersion%
  displayName: 'Set build version'
  env:
    Action: '##vso[build.updatebuildnumber]'
    BuildVersion: $(GitVersion.SemVer)

- task: DotNetCoreCLI@2
  displayName: 'dotnet restore'
  inputs:
    command: 'restore'
    projects: '**/*.csproj'

- task: DotNetCoreCLI@2
  displayName: 'dotnet build $(buildConfiguration)'
  inputs:
    command: 'build'
    projects: '**/*.csproj'
    arguments: '--configuration $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'dotnet test $(buildConfiguration)'
  inputs:
    command: 'test'
    projects: '**/*Tests/*.csproj'
    arguments: '--configuration $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: 'dotnet publish $(buildConfiguration)'
  inputs:
    command: 'publish'
    publishWebProjects: false
    arguments: '--configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)'
    zipAfterPublish: True

- task: CopyPublishBuildArtifacts@1
  inputs:
    Contents: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    ArtifactType: Container

</code></pre>
<p>A successful build that is nicely versioned looks like the one below.</p>
<p><img src="https://ivanmilano.com/content/images/2019/06/azure-pipeline-successfull.png" alt="Azure DevOps pipelines with YAML and GitVersion"></p>
<p>One small note about the pool agent used. The Default one is Windows based build agent, and that is because using an Ubuntu Hosted agent results in <strong>System.BadImageFormatException: Method has no body</strong>. A related issue can also be found on <a href="https://github.com/GitTools/GitVersion/issues/1483">github</a></p>
<h4 id="resources">Resources</h4>
<ul>
<li><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&amp;tabs=example">https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&amp;tabs=example</a></li>
<li><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=azure-devops">https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=azure-devops</a></li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Using MongoDB Transactions with EventSourcing in C# and dotnet core]]></title><description><![CDATA[A walk thorugh on how to use MongoDB replica set as eventstore along with CQRSLIte to update the eventstore and one or many readmodels.]]></description><link>https://ivanmilano.com/using-mongodb-transactions-with-eventsourcing-in-c/</link><guid isPermaLink="false">5cc9c1e76bd154000173bba0</guid><category><![CDATA[mongodb]]></category><category><![CDATA[transactions]]></category><category><![CDATA[dotnet core]]></category><category><![CDATA[cqrslite]]></category><category><![CDATA[eventsourcing]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Tue, 30 Apr 2019 22:03:45 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2019/05/mongodb.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h2 id="transactionsupportinmongodb">Transaction support in MongoDB</h2>
<img src="https://ivanmilano.com/content/images/2019/05/mongodb.jpg" alt="Using MongoDB Transactions with EventSourcing in C# and dotnet core"><p>First things first; a <a href="https://en.wikipedia.org/wiki/Database_transaction">transaction</a> is a unit of work that should be treated as &quot;a whole.&quot; It has to either happen in full or not at all. Transaction support in relational databases likes MSSQL or Oracle Databases have been around for a while. The case for NoSql databases though, is not the exactly same, well until now. As the first NoSql database, MongoDB (and you may correct me if I'm wrong) has as of version 4.0 implemented support for multi-document ACID <a href="https://www.mongodb.com/blog/post/mongodb-multi-document-acid-transactions-general-availability">transactions</a>. Just to make clear, MongoDB has always supported ACID transactions in a single document, and you may also read about early days of <a href="https://blog.yugabyte.com/nosql-databases-becoming-transactional-mongodb-dynamodb-faunadb-cosmosdb/">DynamoDB</a> and its introduction to transactions with some limitations. For most of the cases and for big number of applications single document ACID has proven to be sufficient. For those cases that needed some kind of transaction control, it was implemented manually.</p>
<p>Usage of transactions are in many cases related to the finance domain and are often seen in examples with money being transferred between accounts. If withdrawing one account fails, then other operations involving other accounts should be aborted as well. For the money transfer one can argue that by putting everything in one document, the case can easily be solved without transactions. So, when do we need transactions?</p>
<p>Well, let’s have a look into CQRS and EventSourcing sphere. If you are not familiar with CQRS or EventSourcing you can have a look at <a href="https://martinfowler.com/bliki/CQRS.html">Martin Fowlers</a> official definition. If you find CQRS interesting you also may want to look into this <a href="https://github.com/IvanMilano/awesome-ddd">collection</a> of different resources related to the subject. Practicing CQRS usually means that commands and queries are treated separately, which in order implies different databases; one for persisting the outcome of commands(events), and one for persisting an optimized read model (current snapshot). Reasons for having two different storages could be optimizations, separation of concerns,  etc.</p>
<p>With great choice comes also great responsibilities, and one of them is consistency. If no attention is paid to this subject, one may end up having stale data in the read model, also referred to <a href="https://en.wikipedia.org/wiki/Eventual_consistency">eventual consistency</a>. As a side note; many NoSQL databases embraced an eventual consistency approach, while MongoDB supported a strong consistency model for single document.</p>
<p>If dealing with eventual consistency is not an option, one must make sure that any operation made on the event storage happens in sync with operation made on the read storage. In other words, the operations must occur in a single transaction.</p>
<h2 id="thesetup">The setup</h2>
<p>For this scenario I'm going to use <a href="https://github.com/gautema/CQRSlite">CQRSLite</a>, which is a small library that helps creating CQRS and Eventsourcing applications in C#. I'll implement a MongoEventStore that handles events and updates the readmodel in one transaction. The business case for the purpose is a simple user registration api, which supports user registration and activation of the user account.</p>
<p>First of all, I need to setup the mongo replica set, because transasctions can only run replica set. Trying to run transactions on a standalone mongod instance will throw the following exception: <strong>MongoError: Transaction numbers are only allowed on a replica set member or mongos.</strong> As I already have monodb installed on my computer, I'll just add a replica set to it. For my setup I'm using mongodb <a href="https://www.mongodb.com/download-center/community">v.4.0.9</a>. To avoid tampering with some of the default mongo port that is 27017, I just choose another ranmdom ports</p>
<pre><code>  mongod --replSet rs0 --dbpath c:\data\rs1 --port 37017
  mongod --replSet rs0 --dbpath c:\data\rs2 --port 37018 
  mongod --replSet rs0 --dbpath c:\data\rs3 --port 37019
</code></pre>
<p>Then I log into the mongod process on port 37017, which will be the primary, and configure the replica set. More about replica set configuration and usage here <a href="https://docs.mongodb.com/manual/tutorial/deploy-replica-set/">here</a>:</p>
<pre><code>mongo --port 37017
config = {
	_id: &quot;rs0&quot;,
	members: [
	{_id: 0, host: &quot;localhost:37017&quot;},
	{_id: 1, host: &quot;localhost:37018&quot;},
	{_id: 2, host: &quot;localhost:37019&quot;}
	]
}
rs.initiate(config)
</code></pre>
<p>If you instead want to use docker for running the replica set there are plenty of <a href="http://www.tugberkugurlu.com/archive/setting-up-a-mongodb-replica-set-with-docker-and-connecting-to-it-with-a--net-core-app">tutorials on how to do that</a>.</p>
<p>When working with one mongod instance, creation of the database and the collections can be done on runtime. On the other hand, working with transactions this is not allowed and the following exception will be thrown. So, make sure this is done in a script or similar up front. In a production environment this should even be part of a CI/CD process.</p>
<p><img src="https://ivanmilano.com/content/images/2019/04/mongo-transactions-fail-without-db-1.png" alt="Using MongoDB Transactions with EventSourcing in C# and dotnet core">.</p>
<p>For now, I'll just run the following command to set up my database and collections:</p>
<pre><code>use usersystem
db.createCollection(&quot;events&quot;)
db.createCollection(&quot;userreadmodel&quot;)
</code></pre>
<p>To be able to use transactions I need an IClientSessionHandle object, and this is the object I need to use for the collections I want to make sure are part of the transaction. To achieve that I create my own interface; <strong>IMongoContext</strong> holding the necessary interfaces.</p>
<pre><code>public interface IMongoDbContext
{
  IMongoDatabase Database { get; }
  IClientSessionHandle Session { get; }
  Task&lt;IClientSessionHandle&gt; StartSession(CancellationToken cancellactionToken = default);
}
</code></pre>
<p>Then I register IMongoContext as singleton and can make use of the same session accross different handler classes that are part of the flow.</p>
<pre><code>public static IServiceCollection RegisterServices(this IServiceCollection services)
{
   services.AddSingleton&lt;IMongoDbContext&gt;(x =&gt; new MongoDbContext());
.....
}
</code></pre>
<p>In the MongoDbEventStore I make sure I have injected IMongoDbContext so I can start a session and a transaction. For the transactionoptions I use <strong>ReadConcern.Snapshot</strong>, <strong>ReadPreference.Primary</strong> and <strong>WriteConcern.WMarjority</strong>. More about <a href="https://docs.mongodb.com/manual/reference/read-concern/">read concerns here</a> and <a href="https://docs.mongodb.com/manual/reference/write-concern/">write concerns here</a></p>
<pre><code>public MongoDbEventStore(IEventPublisher publisher, IMongoDbContext mongoDbContext)
{
  _publisher = publisher;
  _mongoDbContext = mongoDbContext;
  _events = _mongoDbContext.Database.GetCollection&lt;EventData&gt;(EventsCollection);
}

public async Task Save(IEnumerable&lt;IEvent&gt; events, CancellationToken cancellationToken = default)
{
   using (var session = await _mongoDbContext.StartSession(cancellationToken))
   {
      var options = new TransactionOptions(ReadConcern.Snapshot, ReadPreference.Primary, WriteConcern.WMajority);
      session.StartTransaction(options);
      try
      {
          var bulkOps = new List&lt;WriteModel&lt;EventData&gt;&gt;();
          foreach (var @event in events)
          { 
             var eventData = new EventData
             {
                 Id = Guid.NewGuid(),
                 StreamId = @event.Id,
                 TimeStamp = @event.TimeStamp,
                 AssemblyQualifiedName = @event.GetType().AssemblyQualifiedName,
                 PayLoad = @event
             };
             bulkOps.Add(new InsertOneModel&lt;EventData&gt;(eventData));
             await _publisher.Publish(@event, cancellationToken);
          }
          await _events.BulkWriteAsync(session, bulkOps).ConfigureAwait(false);
          await session.CommitTransactionAsync(cancellationToken).ConfigureAwait(false);
        }
        catch (Exception exp)
        {
           session.AbortTransaction(cancellationToken);
           throw exp;
        }
    }
}
</code></pre>
<p>By publishing events from MongoDbEventStore, we can have any numbers of listeners to grab the events and handle them the best way needed. One of the handlers that we need in order to update the readmodel, is a <strong>UserReadModelEventHandler</strong>. This class handles only the readmodel and by injecting <strong>IMongoContext</strong> to its ctor, we are able to get the session that is needed when invoking the <strong>InsertOneAsync()</strong> to make sure both collections are updated within the same transaction. The transaction is completed when writing to events collection and readmodel collection has succeeded.</p>
<p>By looking back into the user registration api, the flow should be as follow:</p>
<ul>
<li>User is registered by posting a request to <strong>&quot;/user&quot;</strong> endpoint. The response is the user id</li>
<li>By using the user id and doing a put request to <strong>&quot;user/{userid}/activate&quot;</strong> the user is activated</li>
</ul>
<p>If we then take a look into the database, using <a href="https://www.mongodb.com/products/compass">MongoDb Compass</a>, we'll find two events, one for registrating the user and one for activating the account. By looking at the <strong>version</strong> property we can see that they have occurred in proper order.</p>
<p><img src="https://ivanmilano.com/content/images/2019/04/events-mongodb.png" alt="Using MongoDB Transactions with EventSourcing in C# and dotnet core"></p>
<p>Also looking into the <strong>userreadmodel</strong> we can see that there is one document with the current state of the user.</p>
<p><img src="https://ivanmilano.com/content/images/2019/04/userreadmodel.png" alt="Using MongoDB Transactions with EventSourcing in C# and dotnet core"></p>
<p>The entire solution is available on my <a href="https://github.com/IvanMilano/MongoDbTransactionsDemo">github</a></p>
<h3 id="considerations">Considerations</h3>
<p>For this demo I have used a naive approach to implement a mongodbeventstore. By this, I mean that one event occurred on the aggregate results in one document in the eventstore. With many events on the aggregate this could potentially slow down the loading of the aggregate. Another approach to consider when there potentially could be many events per commit, is to store the events as a collection within the same commit. This way you will end up having less documents for the same aggregate, which in turn will speed up the event replay time.</p>
<h3 id="beawareof">Be aware of</h3>
<ul>
<li>Database and collections must be created upfront, otherwise an error message is thrown.</li>
<li>Transactions are not supported with shards in version 4.0. Support is scheduled for version 4.2</li>
<li>Transactuins cannot run on standalone instances of mondodb.</li>
<li>There is a an additional cost in using transactions, so carefully carry out your transactions</li>
<li>As a best practice, no more than 1,000 documents should be modified within a transaction.</li>
</ul>
<h3 id="resourcesused">Resources used</h3>
<ul>
<li><a href="https://en.wikipedia.org/wiki/Database_transaction">https://en.wikipedia.org/wiki/Database_transaction</a></li>
<li><a href="https://www.infoq.com/articles/MarkLogic-NoSQL-with-Transactions">https://www.infoq.com/articles/MarkLogic-NoSQL-with-Transactions</a></li>
<li><a href="https://martinfowler.com/bliki/CQRS.html">https://martinfowler.com/bliki/CQRS.html</a></li>
<li><a href="https://github.com/gautema/CQRSlite">https://github.com/gautema/CQRSlite</a></li>
<li><a href="https://www.mongodb.com/transactions">https://www.mongodb.com/transactions</a></li>
<li><a href="https://www.mongodb.com/blog/post/working-with-mongodb-transactions-with-c-and-the-net-framework">https://www.mongodb.com/blog/post/working-with-mongodb-transactions-with-c-and-the-net-framework</a></li>
<li><a href="https://blog.yugabyte.com/nosql-databases-becoming-transactional-mongodb-dynamodb-faunadb-cosmosdb/">https://blog.yugabyte.com/nosql-databases-becoming-transactional-mongodb-dynamodb-faunadb-cosmosdb/</a></li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Authenticating with Azure AD interactively and non-interactively]]></title><description><![CDATA[Using azure ad to authenticate an application without actively providing username and password]]></description><link>https://ivanmilano.com/protecting-website-and-api-with-azure-ad/</link><guid isPermaLink="false">5cc9c1e76bd154000173bb9f</guid><category><![CDATA[azure]]></category><category><![CDATA[azure ad]]></category><category><![CDATA[authentication]]></category><category><![CDATA[authorization]]></category><category><![CDATA[web api]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Fri, 05 Apr 2019 09:23:56 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2019/03/azure-ad-connect.jpg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h5 id="protectingasiteusingmicrosoftaccount">Protecting a site using Microsoft account</h5>
<img src="https://ivanmilano.com/content/images/2019/03/azure-ad-connect.jpg" alt="Authenticating with Azure AD interactively and non-interactively"><p>Using your Microsoft account to protect a website or a web api in Azure has become quite a breeze. By following these few steps, your site is protected in minutes:</p>
<ul>
<li>Create a free <a href="https://azure.microsoft.com/en-us/free/">azure account</a></li>
<li>Create and deploy your web/api site in <a href="https://azure.microsoft.com/en-gb/get-started/web-app/">Azure portal</a></li>
<li>Navigate to your <strong>Site</strong> -&gt; <strong>Authentication / Authorization</strong> in Azure portal and enable App Service Authentication, select <strong>Log in with Microsoft Account</strong>, save and off you go. Your newly site is authenticated and protected.</li>
</ul>
<h5 id="potectingasiteusingazuread">Potecting a site using Azure Ad</h5>
<p>Now your site is protected and you are happy, but then new requirements starts to rise. E.g. you want to enable your site to other users with minimum amount of effort. You fool around a bit in Azure portal, StackOverflow and Google, and figure our that Azure Active Directory is a suitable way to go. You follow <a href="https://docs.microsoft.com/en-us/azure/active-directory-domain-services/active-directory-ds-getting-started">these steps</a> and you have an Azure Ad.</p>
<p><img src="https://ivanmilano.com/content/images/2019/03/azure-ad-authentication-1.png" alt="Authenticating with Azure AD interactively and non-interactively"></p>
<p>To be able to use credentials to log in on the site, the app also needs to be registered in the Azure AD -&gt; App registrations.</p>
<p><img src="https://ivanmilano.com/content/images/2019/03/azure-ad-app-rgistration-1.png" alt="Authenticating with Azure AD interactively and non-interactively"></p>
<p>All new users that are supposed to have access to the website/app must be granted access. This can be done from the app it self, using one of the approaches listed below:</p>
<ol>
<li><strong>Azure Active Directory</strong> -&gt; <strong>App registrations</strong> -&gt; select the app -&gt; <strong>Settings</strong> -&gt; <strong>Required permissions</strong> and finally click <strong>Grant permissions</strong> -&gt; <strong>Enterprise applications</strong></li>
<li><strong>Azure Active Directory</strong> -&gt; select the app -&gt; <strong>Users and groups</strong> -&gt; <strong>Add users</strong> -&gt; find the user and click select</li>
</ol>
<p>My experience is that approach #1 does not always work as intended, so I just prefer to use the second approach.</p>
<p>The applications is now protected, and new users can be added on the go. By selecting the free tier for <a href="https://azure.microsoft.com/en-us/pricing/details/active-directory/">Azure AD</a>, quite a few users(500K objects as MS calls them) can be added.</p>
<p>If the application is all off type <a href="https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/intro?view=aspnetcore-2.2">ASP.Net MVC</a>, you have at this moment achieved to protect your site and can live happily ever after. But if it is not, and it is more off the new modern kind, say a <a href="https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/">microservice</a>-ish, and uses a web api to get som additional data, then the entire chain is not secured. E.g. there is an app and a web api. The app could be MVC or any may a more modern SPA app, created with Vue or React or whatever floats your boat and it interacts with the web api to get data. More or less de-facto way of building apps today.</p>
<p>The current setup with just protecting the app is illustrated below. The user interacts with app, and if it is the first time the user hits the url for the app, the Azure AD protection mechanism wakens up and the user is redirected to Azure AD log on page. The user provides credentials, and if all good, the user is then redirected back to the app uri. The app in turns uses the api to get data, which in turns uses some kind of storage.</p>
<p><img src="https://ivanmilano.com/content/images/2019/03/AzureAdAuthenticationNotPrefered-1.svg" alt="Authenticating with Azure AD interactively and non-interactively"></p>
<p>Since the api is not protected the user, as smart as he or she is, can also get the data directly from the api. This also means that anybody else can fetch the data directly, and this is a scenario that we don't want to happen. To prevent the api from being exposed to the entire world, we start by protecting it using the same approach as we did for the app. The preferred scenario is as illustrated below:</p>
<p><img src="https://ivanmilano.com/content/images/2019/03/AzureAdAuthenticationPrefered.png" alt="Authenticating with Azure AD interactively and non-interactively"></p>
<p>Shortly described, the entire flow starts as previously by authenticating before using the app, and then in turn for the app to use the api, the app must authenticate against api to get the data. This can be achieved with two different approaches:</p>
<h6 id="usingclientcredential">Using ClientCredential</h6>
<p>As always the first thing I do when I want to use something I haven't used before, I google it; and for sure there was <a href="https://github.com/Azure-Samples/active-directory-dotnet-daemon">github repo</a> example using clientCredentials. I cloned the repo, replaced settings in the App.Config, with my settings and it all worked as expected.</p>
<p>The key method to use to get the token from Azure Ad is the AcquireTokenAsync(string resource, ClientCredential clientCredential). So, I start off by providing the resource param. The resource could either be the api endpoint or the ApplicationID. I prefer to use the Application ID.</p>
<p>The second param is ClientCredential. By using the <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.clients.activedirectory.clientcredential?view=azure-dotnet">ClientCredential</a> I have to provide the clientId, and appKey for the Web app accessing the Api. The clientId, also known as <strong>Appplication ID</strong> can be found be navigating to <strong>Azure Active Directory</strong> -&gt; <strong>App registrations</strong> -&gt; select your app -&gt; <strong>Application ID</strong>. The AppKey must be generated for the first usage. When still on the <strong>Registered App</strong> window, navigate to <strong>Settings</strong> -&gt; <strong>Keys</strong> -&gt; add new key name in the description and click save. Remember to store the value, as it will remain hidden for ever. If you forget your key value, just generate new secret.<br>
<img src="https://ivanmilano.com/content/images/2019/03/AzureWebAppKeyAndApplicationId.png" alt="Authenticating with Azure AD interactively and non-interactively"></p>
<p>To sum it up this is the code snippet that retrieves the token:</p>
<pre><code>private static async Task&lt;string&gt; GetTokenWithClientCredential()
{
    var authority = string.Format(CultureInfo.InvariantCulture, aadInstance, tenant);
    var authContext = new AuthenticationContext(authority);
    var clientCredential = new ClientCredential(clientId, appKey);

    var result = await authContext.AcquireTokenAsync(todoListResourceId, clientCredential);
    return result.AccessToken;
}
</code></pre>
<h6 id="usinguserpasswordcredential">Using UserPasswordCredential</h6>
<p>So, again, I do the magic with google, and woop, there is another <a href="https://github.com/Azure-Samples/active-directory-dotnet-native-headless">github repo</a> demostrating the usage of authenticating with Azure Ad credentials using the <strong>UserPasswordCredential</strong>. I clone the repo, run it and get the following:</p>
<p><img src="https://ivanmilano.com/content/images/2019/04/NativeClient-Headless-DotNet.png" alt="Authenticating with Azure AD interactively and non-interactively"></p>
<p>Doing some research, I figure out that I'm running AzureAD V2, while this example is based on AzureAD V1. So I get curious whether it is possibile to obtain the token with user credentials also with AAD V2. Reading the exception message it clearly states that one of the following parameters are missing; <strong>client assertion</strong> or <strong>client secret</strong> and some more <a href="https://www.google.com/search?q=the+following+parameters+are+missing+client_assertion+or+client_secret&amp;oq=the+following+parameters+are+missing+client_assertion+or+client_secret&amp;aqs=chrome..69i57j69i64l2.15807j0j7&amp;sourceid=chrome&amp;ie=UTF-8">googling</a> also gives indication that the client secret is missing. So how am I suppose to provide the client secret along with user credential? Well maybe just do a regular post. Before I do that I choose to inspect the request done with <strong>AcquireTokenAsync()</strong> using fiddler, and correctly client_secret is not provided:</p>
<p><img src="https://ivanmilano.com/content/images/2019/04/fiddler-aquireaccesstoken.png" alt="Authenticating with Azure AD interactively and non-interactively"></p>
<p>Since I could not find a way of providing client secret to the AcquireTokenAsync() method I'll just manually created the url and do a regular <strong>PostAsync()</strong> using the <strong>HttpClient()</strong> class:</p>
<pre><code>var azureAdEndpoint = new Uri(authority + &quot;/oauth2/token&quot;);
var urlEncodedContent = new FormUrlEncodedContent(new[]
{
   new KeyValuePair&lt;string, string&gt;(&quot;grant_type&quot;, &quot;password&quot;),
   new KeyValuePair&lt;string, string&gt;(&quot;scope&quot;, &quot;openid&quot;),
   new KeyValuePair&lt;string, string&gt;(&quot;resource&quot;, todoListResourceId),
   new KeyValuePair&lt;string, string&gt;(&quot;client_id&quot;, todoListResourceId), //using the api client id
   new KeyValuePair&lt;string, string&gt;(&quot;username&quot;, _user),
   new KeyValuePair&lt;string, string&gt;(&quot;password&quot;, _password),
   new KeyValuePair&lt;string, string&gt;(&quot;client_secret&quot;, _clientSecret),
});

var result = await httpClient.PostAsync(azureAdEndpoint, urlEncodedContent);
{
   var content = await result.Content.ReadAsStringAsync();
   var authResult = JsonConvert.DeserializeObject&lt;dynamic&gt;(content);
   return authResult.access_token;
}
</code></pre>
<p>As expected this provides me the correct token, that I can use from my web app to get data from my api.</p>
<p><img src="https://ivanmilano.com/content/images/2019/04/fiddler-postasync-with-clientsecret.png" alt="Authenticating with Azure AD interactively and non-interactively"></p>
<p>The source code can be found <a href="https://github.com/IvanMilano/ad-dotnet-deamon">here</a></p>
<h6 id="summary">Summary</h6>
<p>In this post I have looked into how to protect a web app and api hosted in Azure, using Azure AD v2. The web app is protected using the regular AAD Authentication mechanism that interactively asks the user for the credential, while the web app silently or non-interactively authenticates against the api using the provided clientcredentials or userpasswordcredentials. Protecting a webapplication using this approach is not very dyanmic, and is maybe more suitable for existing web applications the needs to be migrated to Azure with little effort. If you on the other side need a more dynamic and flexible authentication, you should consider solutions like <a href="https://identityserver4.readthedocs.io/en/latest/">identityserver</a> or implementing your own identity management using <a href="https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity?view=aspnetcore-2.2&amp;tabs=visual-studio">ASP.Net core identity</a></p>
<h6 id="note">Note</h6>
<p>At the moment writting this post, April. 4th, Microsoft has updated there git repo example with a newer version supporting <a href="https://github.com/azure-samples/active-directory-dotnetcore-console-up-v2">Azure AD v2.0, and using Graph API</a></p>
<h6 id="resourcesusedinthispost">Resources used in this post:</h6>
<p><a href="https://github.com/Azure-Samples/active-directory-dotnet-native-headless">https://github.com/Azure-Samples/active-directory-dotnet-native-headless</a><br>
<a href="https://github.com/Azure-Samples/active-directory-dotnet-daemon">https://github.com/Azure-Samples/active-directory-dotnet-daemon</a><br>
<a href="https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d54c668f-d8e3-4662-b124-d9abc3176c8c/http-post-body-parameters-to-get-oauth2-token?forum=azurelogicapps">https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d54c668f-d8e3-4662-b124-d9abc3176c8c/http-post-body-parameters-to-get-oauth2-token?forum=azurelogicapps</a><br>
<a href="https://carldesouza.com/httpclient-getasync-postasync-sendasync-c/">https://carldesouza.com/httpclient-getasync-postasync-sendasync-c/</a><br>
<a href="https://github.com/AzureAD/azure-activedirectory-library-for-ruby/issues/57">https://github.com/AzureAD/azure-activedirectory-library-for-ruby/issues/57</a></p>
<!--kg-card-end: markdown--><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Fun in Kristiansand Zoo and Amusement Park]]></title><description><![CDATA[Travelling to Kristiandsand Zoo and Amusment Park for one day, to explore the famous Norwegian Cardamom Town, Captain Saberthoot and wild animals.]]></description><link>https://ivanmilano.com/fun-in-kristiansand-zoo-and-amusement-park/</link><guid isPermaLink="false">5cc9c1e76bd154000173bb9d</guid><category><![CDATA[travel]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Mon, 02 Oct 2017 21:00:12 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2017/09/KristiansandDyrepark_03092017_00065-2.JPG" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><img src="https://ivanmilano.com/content/images/2017/09/KristiansandDyrepark_03092017_00065-2.JPG" alt="Fun in Kristiansand Zoo and Amusement Park"><p>Having small kids also means that I can do all the things I missed in my childhood; like going to a wildlife park. This time, my family and I have decided take the trip to <a href="https://www.dyreparken.no/">Kristiansand Zoo and amusement park</a>. The park is located in the southern part of Norway, and living in Oslo, this means a <a href="https://www.google.no/maps/dir/Oslo/Kristiansand+Zoo+and+Amusement+Park,+Kardemomme+By+4609,+4636+Kristiansand/@59.0467863,8.3301332,8z/data=!3m1!4b1!4m13!4m12!1m5!1m1!1s0x46416e61f267f039:0x7e92605fd3231e9a!2m2!1d10.7522454!2d59.9138688!1m5!1m1!1s0x4638029e9f9bba95:0xd89efa725df76744!2m2!1d8.144123!2d58.1856575?hl=en">road trip</a> for 4 - 5 hours. Well, in theory, yes, but in real life, no. After 2 - 3 hours of driving different kind of noises start to appear from the back seat, and suddenly all kind of nagging started; need for toilet, not fun to just drive and drive, hungry, thirsty and so on. And no, I don’t have any back-seat entertainment set up, but will for sure consider one after this journey.</p>
<h4 id="accommodation">Accommodation</h4>
<p>After about 6 hours we arrived in Kristiansand, and within some minutes with great help from google maps we found the hotel for the night. This hotel is probably the most convenient way to <a href="https://www.dyreparken.no/overnatting/dyreparken-hotell/">stay</a> when visiting the park, as it is literally situated beside the entrance.</p>
<p><img src="https://ivanmilano.com/content/images/2017/09/KristiansandDyrepark_03092017_00017.JPG" alt="Fun in Kristiansand Zoo and Amusement Park"></p>
<p>The hotel is named and shaped like the famous vessel <a href="https://en.wikipedia.org/wiki/Noah%27s_Ark">Noah's Ark</a>. When booking tickets online, one can also book accommodation in this hotel, which is highly advice. The theme in the hotel is all about animals which seems to be quite appreciated by the kids. But despite this being a god stay, there are also other different god hotels or motels just a search away. Take a look on sites like <a href="https://ivanmilano.com/fun-in-kristiansand-zoo-and-amusement-park/booking.com">booking.com</a>.</p>
<div class="alignleft">
<img src="https://ivanmilano.com/content/images/2017/09/KristiansandDyrepark_03092017_00016.JPG" width="500" alt="Fun in Kristiansand Zoo and Amusement Park">
</div>
<div class="alignright">
<img src="https://ivanmilano.com/content/images/2017/09/KristiansandDyrepark_03092017_00012-3.JPG" width="500" alt="Fun in Kristiansand Zoo and Amusement Park">
</div>
<p>Inside the hotel there are different facilities like a workout room, a playroom for the kids, a big restaurant on the ground floor, as well as a big lounge on the same floor. And probably something more that I missed.</p>
<p>The dinner for the evening was a buffet, containing seafood, different kind of meat, vegetables and desserts. Overall, well prepared and good variations in the food.</p>
<p>Despite having a great meal in front of you, the most important thing for the evening was of course the playroom, speaking from a kid's point of view. So, after consuming big amount of delicious pudding and cookies nothing else was more logical than running away and play. Since the playroom was across the lounge it was no biggie for us adults, just sitting down and relaxing while kids was exploring all the fun.</p>
<p><img src="https://ivanmilano.com/content/images/2017/09/KristiansandDyrepark_03092017_00019-2.JPG" alt="Fun in Kristiansand Zoo and Amusement Park"></p>
<h4 id="theexploration">The exploration</h4>
<p>Moving on to the next day, after a god night sleep, followed up by a great breakfast, what first caught our sight from the room, was the enormous queue of people waiting to get inside the park. Obviously, we were not the only ones to explore the park that day.</p>
<p><img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00023-2.JPG" alt="Fun in Kristiansand Zoo and Amusement Park"></p>
<p>Luckily, there were many entrances and a very efficient staff, so after some short amount of time we were inside. The entire park is organized by themes or attractions. E.g. the animals are situated on one side of the park, while the aqua land and &quot;Kardemomme by&quot; is situated on the other side. You can read more about this on the sites official <a href="https://www.dyreparken.no/kart">map</a>. We started the journey in the <a href="https://en.wikipedia.org/wiki/Captain_Sabertooth">Captain Sabertooth World</a> moving on to the <a href="https://en.wikipedia.org/wiki/Cardamom_Town_(theme_park)">&quot;Kardemomme by&quot;</a>.</p>
<p><img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00034-4.JPG" alt="Fun in Kristiansand Zoo and Amusement Park"></p>
<p>And honestly speaking, the world of Captain Sabertooth wasn't much to see, nor do. Neither did our kids found it especially interesting. Probably here as well, one should follow the scheduled activities.</p>
<div class="alignleft">
<img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00072-2.JPG" width="500" alt="Fun in Kristiansand Zoo and Amusement Park">
</div>
<div class="alignright">
<img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00095-2.JPG" width="500" alt="Fun in Kristiansand Zoo and Amusement Park">
</div>
Moving towards the "Kardemomme by" or Cardamom Town we were lucky to see this squirrel (picture on the left side), and I also got a fairly enough close shoot. It was running and playing around for several minutes before it vanished between the trees. 
<p>Then some steps away there it was, The Cardmoom Town. Approaching it from &quot;hill&quot; side, it opened up for some great shoots as well. The fun thing about the Cardamom Town is actually to be there, because almost every child in Norway has heard about it through the book <a href="https://en.wikipedia.org/wiki/When_the_Robbers_Came_to_Cardamom_Town">When the Robbers Came to Cardamom Town</a>. Being able to experience everything in miniature, was a huge success among the kids. Maybe this was also the biggest highlight of the exploration.</p>
<p><img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00112-2.JPG" alt="Fun in Kristiansand Zoo and Amusement Park"></p>
<h4 id="theanimals">The animals</h4>
<p>According to the website there are 135 different species in the zoo, and if you are a quick explorer you will probably be able to see them all. Slightly hurrying from one booth to the other we noticed that many of the animals seems to be quite lazy, most of the time just sitting or lying around. However, if you are looking for a bit more action, you should try to follow the <a href="https://www.dyreparken.no/aktivitetskalender/?date=2017-10-03">scheduled</a> activities set up by the staff in the park.</p>
<p><img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00199-2.JPG" alt="Fun in Kristiansand Zoo and Amusement Park"></p>
<div class="alignleft" style="margin-left:0">
<img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00226-2.JPG" width="340" alt="Fun in Kristiansand Zoo and Amusement Park">
</div>
<div class="alignright" style="margin-right:0">
<img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00274-4.JPG" width="340" alt="Fun in Kristiansand Zoo and Amusement Park">
</div>
<p><img src="https://ivanmilano.com/content/images/2017/10/KristiansandDyrepark_03092017_00256-2.JPG" alt="Fun in Kristiansand Zoo and Amusement Park"></p>
<p>So, to sum it all up; the excursion was great, and it is highly recommended to visit the park, especially if you have small kids. If you want to get must out if it, you should plan your trip slightly more than what we did. And, it is also an option to get to <a href="https://avinor.no/flyplass/kristiansand/">Kristiansand Airport, Kjevik</a> by plane from probably all of the bigger cities in Norway.</p>
<p>Have fun!</p>
<p><em><strong>Note:</strong></em> <em>All pictures in this post are taken by me, and thereby copyrighted by me. As long as you keep the copyright information, and keep the reference to this blog you are free to use the pictures in any way. If you would like to get any of these pictures in native, high resolution, please contact me.</em></p>
<!--kg-card-end: markdown--><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Building and deploying with TeamCity and Octopus Deploy – part 5 of 5]]></title><description><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="configuringoctopusdeploy"><strong>Configuring Octopus Deploy</strong></h3>
<p><strong>1.</strong> Start by adding an new external feed. Navigate to** Library -&gt; External feeds -&gt; Add feed**. I’m naming the feed for** “TeamCity Package feed”<strong>, and the url is</strong> <a href="http://localhost:84/guestAuth/app/nuget/v1/FeedService.svc**">http://localhost:84/guestAuth/app/nuget/v1/FeedService.svc**</a>. As you maybe have noticed this</p>]]></description><link>https://ivanmilano.com/building-and-deploying-with-teamcity-and-octopus-deploy-part-5-of-5/</link><guid isPermaLink="false">5cc9c1e76bd154000173bba5</guid><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Sun, 28 Feb 2016 21:04:33 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2019/05/teamcity_octopus_deploy-3.svg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="configuringoctopusdeploy"><strong>Configuring Octopus Deploy</strong></h3>
<img src="https://ivanmilano.com/content/images/2019/05/teamcity_octopus_deploy-3.svg" alt="Building and deploying with TeamCity and Octopus Deploy – part 5 of 5"><p><strong>1.</strong> Start by adding an new external feed. Navigate to** Library -&gt; External feeds -&gt; Add feed**. I’m naming the feed for** “TeamCity Package feed”<strong>, and the url is</strong> <a href="http://localhost:84/guestAuth/app/nuget/v1/FeedService.svc**">http://localhost:84/guestAuth/app/nuget/v1/FeedService.svc**</a>. As you maybe have noticed this is the feed we enabled earlier in TeamCity, and this is the feed we are going to use to fetch artifacts from TeamCity and the Octo project. For the sake of simplicity I’m using the guest login, but you could also have used an authenticated user, provided with Username and Password in the input fields below.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config1.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config1.png" alt="Building and deploying with TeamCity and Octopus Deploy – part 5 of 5"></a></p>
<p><strong>2.</strong> Add a new default <strong>lifecycle</strong>; <strong>Library</strong> -&gt; <strong>Add lifecycle.</strong></p>
<p><strong>3.</strong> Now move on to Environments and add two environments; <strong>Test</strong> and **Prod. **In Octopus, an <a href="http://docs.octopusdeploy.com/display/OD/Environments"><em>environment</em></a>is a group of machines that you will deploy to at the same time; common examples of environments are <strong>Test</strong>, <strong>Acceptance</strong>, <strong>Staging</strong> or <strong>Production.</strong> In bigger developer environments it is normal to let one machine represent one environment. In this example we are using both environments on the same machine.</p>
<p><strong>4.</strong> Add one <strong>Deployment target</strong> for the <strong>Test</strong> environment and one for the <strong>Prod</strong> environment. For the <strong>Test</strong> environment add the following:</p>
<ul>
<li>Display name: <strong>web-test-01</strong></li>
<li>Environments: <strong>Test</strong></li>
<li>Roles: <strong>db-server, web-server</strong></li>
<li>Style: <strong>Listeting Tentacle</strong></li>
<li>Thumbprint: <strong>You can find the thumbprint in the Tentacle Manger</strong></li>
<li>Tentacle URL:** <a href="https://localhost:10933">https://localhost:10933</a> (this is the default suggestion I’m using, but this could be something else in your installation)**</li>
</ul>
<p>For the Dev environment add the following Deployment Target:</p>
<ul>
<li>Display name: <strong>web-prod-01</strong></li>
<li>Environments: <strong>Prod</strong></li>
<li>Roles: <strong>db-server, web-server</strong></li>
<li>Style: <strong>Listeting Tentacle</strong></li>
<li>Thumbprint: <strong>You can find the thumbprint in the Tentacle Manger</strong></li>
<li>Tentacle URL:** <a href="https://localhost:10933">https://localhost:10933</a> (this is the default suggestion I’m using, but this could be something else in your installation)**</li>
</ul>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config2.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config2.png" alt="Building and deploying with TeamCity and Octopus Deploy – part 5 of 5"></a></p>
<p><strong>5.</strong> Go to the <strong>Projects</strong> menu and add new <strong>Project</strong>. I’m calling my project for <strong>Octo</strong>. Add the following variables to the project:</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config3.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config3.png" alt="Building and deploying with TeamCity and Octopus Deploy – part 5 of 5"></a></p>
<p><strong>6.</strong> Navigate to <strong>Process</strong> and add the step <strong>“Deploy a Nuget package”</strong> and call it for <strong>“Deploy Web site”</strong>. Than add the following parameters:</p>
<ul>
<li>Runs on target roles: <strong>web-server</strong> and** db-server**.</li>
<li>Nuget feed: <strong>TeamCity Package feed</strong></li>
<li>NuGet package ID: <strong>Octo</strong></li>
<li>Download options: <strong>The first option</strong></li>
<li>Install to: <strong>#{CustomInstallationDir}</strong></li>
<li>Purge: <strong>Checked</strong></li>
<li>Configuration Variables: <strong>Checked</strong></li>
<li>XML transforms: <strong>Checked</strong></li>
<li>Web Site: <strong>Checked</strong></li>
<li>Web Site name: <strong>#{CustomWebSiteName}</strong></li>
<li>Relative home directory: Leave empty</li>
<li>Application pool name: <strong>#{CustomWebSiteName}</strong></li>
<li>.NET CLR version: <strong>v4.0</strong></li>
<li>Identity: <strong>Application Pool Identity</strong></li>
<li>Bindings: - Protocol: <strong>Http</strong></li>
<li>Port: <strong>#{CustomWebSitePort}</strong></li>
<li>IP Address: <strong>127.0.0.1</strong></li>
<li>Host name: <strong>#{CustomWebSiteName}</strong></li>
<li>Authentication modes:<strong>Cheked</strong> (Enable Anonymous authentication)</li>
<li>Environments: <strong>Test, Prod</strong></li>
</ul>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config4.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config4.png" alt="Building and deploying with TeamCity and Octopus Deploy – part 5 of 5"></a></p>
<p><strong>7.</strong> At this moment the configuration part is finished. You can make some changes to the code and push the commits to the remote repo. The build should automatically start in TeamCity and the deployment should be processed in the Octopus. If everything goes green the deployment is working as expected. Another way to verify the deployment, is by opening the <strong>wwwroot</strong> directory. There you should find two new folders; <strong>octo-prod</strong> and <strong>octo-test</strong>.** **The folders should contain a mvc webapp which also include web.config file. In the config files there is a connection string with environmentname in the database name. The assemblies should also have been versioned.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config5.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config5.png" alt="Building and deploying with TeamCity and Octopus Deploy – part 5 of 5"></a></p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config6.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octo_config6.png" alt="Building and deploying with TeamCity and Octopus Deploy – part 5 of 5"></a></p>
<!--kg-card-end: markdown--><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5]]></title><description><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="configuringteamcity"><strong>Configuring TeamCity</strong></h3>
<p><strong>1.</strong> Enable Nuget Feed in TeamCity: <strong>Administration -&gt; Nuget</strong>. Enable both the <strong>Authenticated feed</strong> and the <strong>Public feed</strong>. To enable the public feed the <strong>Guest user login</strong> must be allowed. Also get the lates Nuget version.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config.png" alt="TC_config"></a></p>
<p><strong>2.</strong> Download and install Octopus <a href="https://download.octopusdeploy.com/octopus-teamcity/3.2.0.51/Octopus.TeamCity.zip">TeamCity plugin</a>. Stop TeamCity services, and</p>]]></description><link>https://ivanmilano.com/building-and-deploying-with-teamcity-and-octopus-deploy-part-4-of-4/</link><guid isPermaLink="false">5cc9c1e76bd154000173bba4</guid><category><![CDATA[ci]]></category><category><![CDATA[configuration]]></category><category><![CDATA[tc]]></category><category><![CDATA[teamcity]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Fri, 26 Feb 2016 21:48:47 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2019/05/teamcity_octopus_deploy-2.svg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="configuringteamcity"><strong>Configuring TeamCity</strong></h3>
<img src="https://ivanmilano.com/content/images/2019/05/teamcity_octopus_deploy-2.svg" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"><p><strong>1.</strong> Enable Nuget Feed in TeamCity: <strong>Administration -&gt; Nuget</strong>. Enable both the <strong>Authenticated feed</strong> and the <strong>Public feed</strong>. To enable the public feed the <strong>Guest user login</strong> must be allowed. Also get the lates Nuget version.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a></p>
<p><strong>2.</strong> Download and install Octopus <a href="https://download.octopusdeploy.com/octopus-teamcity/3.2.0.51/Octopus.TeamCity.zip">TeamCity plugin</a>. Stop TeamCity services, and move your Octopus plugin to the following directory:** “D:\TeamCity\plugins”. **Now start your TeamCity services again, and the plugin will be installed automatic.</p>
<p><strong>3.</strong> Now create a user on <a href="https://bitbucket.org">Bitbucket</a> and create a Git repository. We are naming it for Octo.</p>
<p><strong>4.</strong> Create a Web Application (I’,m using MVC) in Visual Studio based on .NET Framework 4.6 and map it with your Bitbucket repo. Add the unit test project to it as well. Following the instructions provided in Bitbucket should make this a quite easy process.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/bitbucketSetup.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/bitbucketSetup.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>bitbucket setup</p>
<p><strong>5.</strong> In this example we will be using one git branch, master, that will be build and deployed once, but promoted to different environments. This is where Octopus Deploy have it strengths.</p>
<p><strong>6.</strong> Start by creating a new project in TeamCity, called Octo.  Now add VCS root to that project. Surprisingly enough we will be using the newly created repo from Bitbucket; <strong>octo.git</strong></p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config2.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config2.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>teamcity config</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config3.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config3.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>teamcity config</p>
<p><strong>7.</strong> Add <strong>two</strong> build configurations to your TeamCity Octo project, one for building the project and creating artifacts, and one for deploying the artifacts to Octopus. I’m naming my builds for <strong>“100 – Master CI”</strong> and** “110 – Master Deploy website”**. The naming convention is inspired by <a href="http://courses.osherove.com/courses/beautifulbuilds">Roy Osherove talk about beautiful builds</a></p>
<p><strong>8.</strong> Move to your <strong>“100 – Master CI”</strong> build configuration and three parameters: <strong>system.MajorVersion.Master</strong>, <strong>system.MinorVersion.Master</strong> and **system.PathVersion.Master. **These parameters will be used to create a buildnumber.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config4.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config4.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>teamcity config</p>
<p><strong>9</strong>. Under Build Features add a new build feature: “<strong>Assembly Info patcher”</strong>. Use the parameters created in prevous step. Use the same format in all three input fields:** %system.MajorVersion.Master%.%system.MinorVersion.Master%.%system.PatchVersion.Master%.%build.counter%. <strong>Add this inputstring in the <strong>“Build number format”</strong> field underneath</strong> “General Settings”** menu as well.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config5.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config5.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>teamcity config</p>
<p><strong>10.</strong> Create** VCS trigger** underneath <strong>“Triggers”</strong> menu. Whenever a push is performed on the git repo this is the trigger that starts the build process.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config6.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config6.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>teamcity config</p>
<p><strong>11.</strong> Attach the created VCS Root to the configuration.</p>
<p><strong>12.</strong> Now add three build steps to the configuration; <strong>“01 – Package restore”</strong>, <strong>“02 – Build solution”</strong> and** “03 – Create Nuget Package”.** Use the options provided in the screen dump below. In the build step 3 there is section for Octopus. This is actually the plugin we installed earlier.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config7.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config7.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>teamcity config</p>
<p><strong>13.</strong> Open the Visual Studio project directory and add a new empty file called <strong>Octo.nuspec</strong>. <a href="https://docs.nuget.org/create/nuspec-reference">A .nuspec file is a manifest that uses XML to describe a package</a> and must exist, otherwise no artifacts will be created. Open the file and add lines as proposed:</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config8.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config8.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>teamcity config</p>
<p><strong>14.</strong> Open your Visual Studio project, navigate to <strong>“Manage NuGet Packages”</strong> and add <strong>OctoPack</strong> to your solution. Push all your solution changes to remote.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/OctoSlnConfig.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/OctoSlnConfig.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>visual studio octo nuget pack</p>
<p><strong>15.</strong> At this moment You should have a valid build setup. You can now try to run, and hopefully you will see that some artifacts are generated.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config9.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config9.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a></p>
<p><strong>16.</strong> Now open  <strong>“110 – Master Deploy website”</strong> configuration and navigate to <strong>“General Settings”</strong>.  In** “Build number format”** field add the following input: <strong>%dep.Octo_100MasterCI.build.number%</strong></p>
<p><strong>17.</strong> Underneath <strong>“Triggers”</strong> menu add <strong>“Finish Build Trigger”</strong> trigger and use build configuration <strong>“Octo :: 100 – Master – CI”</strong>. This is the previous build configuration that will start this one.</p>
<p><strong>18.</strong> Underneath <strong>“Dependencies”</strong> add one <strong>Snapshot Dependency</strong> and one <strong>Artifact Dependency</strong> where both depends  on **100 – Master – CI”. ** In the Artifacts rules field for Artifact Dependency add the following *<strong>.%build.number%.nupkg</strong></p>
<p><strong>19.</strong> For this build configuration there is only one build step. Add** “OctopusDeploy: Create release”** as Runner type. In the <strong>Octopus URL</strong> add url to the Octopus Web installed in previous step (should be <strong>localhost:82</strong>). When asked for the <strong>API key</strong>, it can be generated in the Octopus web portal; <strong>admin -&gt; profile -&gt; API Keys</strong>. In the <strong>“Deploy to”</strong> field add <strong>Test</strong>, as we will create test environment in Octopus that this deploy will use. As additional command line arguments add the following:** –packageversion=%build.number%**</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config10.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/TC_config10.png" alt="Building and deploying with TeamCity and Octopus Deploy – Part 4 of 5"></a>teamcity config</p>
<p><strong>20.</strong> At this moment TeamCity should be properly configured. You can now try to add some changes to your code, push the changes to Bitbucket. The build should automatically start after some time. Both build configuration will run, but the last one, <strong>“110 – Master Deploy website”</strong> will not do much since the Octopus Server is not set up. <a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-5-of-5/">So go ahead and start configuring the Octopus Server</a>.</p>
<!--kg-card-end: markdown--><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Building and deploying with TeamCity and Octopus Deploy - Part 3 of 5]]></title><description><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="installingandsettingupoctopusdeploy"><strong>Installing and setting up Octopus Deploy</strong></h3>
<p>This is the 3. part of Building and deploying with TeamCity and Octopus Deploy. <a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-2-of-4/">In the previous part we installed TeamCity</a>. Now we are going to install Octopus Deploy. Octopus Deploy consist of two install files; one for server and one for tentacles</p>
<p><strong>1</strong></p>]]></description><link>https://ivanmilano.com/building-and-deploying-with-teamcity-and-octopus-deploy-part-3-of-4/</link><guid isPermaLink="false">5cc9c1e76bd154000173bba3</guid><category><![CDATA[configuration]]></category><category><![CDATA[deploy]]></category><category><![CDATA[octopus]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Fri, 26 Feb 2016 21:46:06 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2019/05/teamcity_octopus_deploy-1.svg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="installingandsettingupoctopusdeploy"><strong>Installing and setting up Octopus Deploy</strong></h3>
<img src="https://ivanmilano.com/content/images/2019/05/teamcity_octopus_deploy-1.svg" alt="Building and deploying with TeamCity and Octopus Deploy - Part 3 of 5"><p>This is the 3. part of Building and deploying with TeamCity and Octopus Deploy. <a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-2-of-4/">In the previous part we installed TeamCity</a>. Now we are going to install Octopus Deploy. Octopus Deploy consist of two install files; one for server and one for tentacles</p>
<p><strong>1</strong>. Start by creating a new Octopus database and associate the login we previously created with the Octopus database (in the same way we did with TeamCity). Download <a href="https://download.octopusdeploy.com/octopus/Octopus.3.2.24-x64.msi">Octopus Server</a> and run the file. The proposed settings are just fine. Check for “Start a free trial” when You approach the license step. As with TeamCity use a separate path for storing configuration files. I’m using drive D here as well. <strong>D:\Octopus.</strong></p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup1.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup1.png" alt="Building and deploying with TeamCity and Octopus Deploy - Part 3 of 5"></a>octopus setup</p>
<p><strong>2</strong>. Choose the newly created database, and use the same login to access the database.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup2.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup2.png" alt="Building and deploying with TeamCity and Octopus Deploy - Part 3 of 5"></a>octopus setup</p>
<p><strong>3.</strong> Define the port and a virtual directory. Here I’m using <strong>/octopus</strong> as virtual directory but it is not necessary</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup3.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup3.png" alt="Building and deploying with TeamCity and Octopus Deploy - Part 3 of 5"></a>octopus setup</p>
<p><strong>4.</strong> Choose your preferred authentication mode. I’m using <strong>“Username/password stored in Octopus”</strong>. Create an admin user and finish the installation. Hopefully everything was OK. Octopus have now installed a desktop app: “Octopus Manger” where you can find some status information about your server. Now you can login to the server web app.</p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup4.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup4.png" alt="Building and deploying with TeamCity and Octopus Deploy - Part 3 of 5"></a>octopus setup</p>
<p><strong>Octopus Tentacle</strong></p>
<p><strong>1.</strong> Start by downloading the <a href="https://download.octopusdeploy.com/octopus/Octopus.Tentacle.3.2.24-x64.msi">setup file</a> for the tentacle, and run the .msi. Here as well we will be using own directory for the tentacle configuration: <strong>“D:\OctopusTentacle”</strong></p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup5.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup5.png" alt="Building and deploying with TeamCity and Octopus Deploy - Part 3 of 5"></a>tentacle setup</p>
<p>**2. **Choose “<a href="http://docs.octopusdeploy.com/display/OD/Listening+Tentacles">Listening Tentacle</a>” as communication style, and add the certificate key. The certificate key can be found in Octopus Server web application under <strong>Configuration -&gt; Certificates</strong></p>
<p><a href="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup6.png"><img src="http://thefatcoder.com/wp-content/uploads/2016/02/octopus_setup6.png" alt="Building and deploying with TeamCity and Octopus Deploy - Part 3 of 5"></a>tentacle setup</p>
<p><strong>3.</strong> Finish your installation. <a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-4-of-4/">The next step is to configure TeamCity and Octopus to build and deploy when checking in code</a></p>
<!--kg-card-end: markdown--><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Building and deploying with TeamCity and Octopus Deploy -  Part 2 of 5]]></title><description><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="installingandsettingupteamcity"><strong>Installing and setting up TeamCity</strong></h3>
<p><strong>1</strong>. Start by downloading <a href="https://www.jetbrains.com/teamcity/download/#section=windows-version">TeamCity</a> and start the installation. The proposed suggestions in the setup wizard are just fine:</p>
<p><img src="https://ivanmilano.com/content/images/2019/05/teamcity_setup1-1.png" alt="teamcity_setup1-1"></p>
<p><strong>2</strong>. Choose your path for Data Directory. Data Directory is used for storing configuration settings. I prefer to use a different path than the one where</p>]]></description><link>https://ivanmilano.com/building-and-deploying-with-teamcity-and-octopus-deploy-part-2-of-4/</link><guid isPermaLink="false">5cc9c1e76bd154000173bba2</guid><category><![CDATA[ci]]></category><category><![CDATA[configuration]]></category><category><![CDATA[database]]></category><category><![CDATA[teamcity]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Fri, 26 Feb 2016 21:44:44 GMT</pubDate><media:content url="https://ivanmilano.com/content/images/2019/05/teamcity_octopus_deploy.svg" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="installingandsettingupteamcity"><strong>Installing and setting up TeamCity</strong></h3>
<img src="https://ivanmilano.com/content/images/2019/05/teamcity_octopus_deploy.svg" alt="Building and deploying with TeamCity and Octopus Deploy -  Part 2 of 5"><p><strong>1</strong>. Start by downloading <a href="https://www.jetbrains.com/teamcity/download/#section=windows-version">TeamCity</a> and start the installation. The proposed suggestions in the setup wizard are just fine:</p>
<p><img src="https://ivanmilano.com/content/images/2019/05/teamcity_setup1-1.png" alt="Building and deploying with TeamCity and Octopus Deploy -  Part 2 of 5"></p>
<p><strong>2</strong>. Choose your path for Data Directory. Data Directory is used for storing configuration settings. I prefer to use a different path than the one where the program files are installed. In my case I’m using folder on D disk: <strong>D:\TeamCity</strong>.</p>
<p><img src="https://ivanmilano.com/content/images/2019/05/teamcity_setup2.png" alt="Building and deploying with TeamCity and Octopus Deploy -  Part 2 of 5"></p>
<p><strong>3.</strong> Select preferred database type. If you want to get up and running fast, You can select the built in database **HSQLDB. **The built in internal database is <a href="https://confluence.jetbrains.com/display/TCD9/Setting+up+an+External+Database">not recommended</a> for production use. In my setup I’m using Microsoft SQL Server 2014. Initially I tried to use SQL Express, but faced some issues and I didn’t bother spending time on solving them as I already had the full version of MsSql installed. Though I came across a <a href="http://michaelsync.net/2013/09/21/tips-for-setting-up-teamcity-with-sqlexpress">blog</a> that handles that issue, if SQL Express is your only option.</p>
<p>No create a database, call it TeamCity, and create a Sql login. Associate the newly crated login with TeamCity database. We will be using this login to talk with the database:</p>
<p><img src="https://ivanmilano.com/content/images/2019/05/teamcity_setup3.png" alt="Building and deploying with TeamCity and Octopus Deploy -  Part 2 of 5"></p>
<p><strong>4</strong>. Now proceed with your TeamCity wizzard. At this moment TC is asking for a MS SQL Server JDBC Driver. Download the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=11774">file</a> from Microsoft and place it in <strong>D:\TeamCity\lib\jdbc</strong> directory, and click the refresh button.</p>
<p><img src="https://ivanmilano.com/content/images/2019/05/teamcity_setup5.png" alt="Building and deploying with TeamCity and Octopus Deploy -  Part 2 of 5"></p>
<p><strong>5.</strong> If everything is ok, You have reached the final step which are to accept the license agreement and create a new user. Do that and You have finished the TeamCity installation. <a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-3-of-4/">The next step is to install Octopus Deploy.</a></p>
<!--kg-card-end: markdown--><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Building and deploying with TeamCity and Octopus Deploy - Part 1 of 5]]></title><description><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="teamcityandoctopusdeploy">TeamCity and Octopus Deploy</h3>
<p>There have been a lot of writings about continuous integration and  automated deploy and why “doing it”. This post is not about that, but rather about what does it take to set up the entire automated flow from the step when the code is checked into</p>]]></description><link>https://ivanmilano.com/teamcity-and-octopus-deploy/</link><guid isPermaLink="false">5cc9c1e76bd154000173bba1</guid><category><![CDATA[automate]]></category><category><![CDATA[ci]]></category><category><![CDATA[deploy]]></category><category><![CDATA[octopus]]></category><category><![CDATA[teamcity]]></category><dc:creator><![CDATA[Ivan Milano]]></dc:creator><pubDate>Tue, 17 Mar 2015 13:39:16 GMT</pubDate><media:content url="http://thefatcoder.com/wp-content/uploads/2015/03/tcOctoHeader.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><!--kg-card-begin: markdown--><h3 id="teamcityandoctopusdeploy">TeamCity and Octopus Deploy</h3>
<img src="http://thefatcoder.com/wp-content/uploads/2015/03/tcOctoHeader.png" alt="Building and deploying with TeamCity and Octopus Deploy - Part 1 of 5"><p>There have been a lot of writings about continuous integration and  automated deploy and why “doing it”. This post is not about that, but rather about what does it take to set up the entire automated flow from the step when the code is checked into the SC to the final step when the software is deployed. The tools I will be using are TeamCity and Octopus Deploy, and the application is a web application written in C# with Visual Studio. The code will be stored in a git repo hosted in BitBucket. The entire set up will be done on one machine and the OS used is windows 10.</p>
<p>Reasons for choosing TeamCity, Octo, and BitBucket are quite simple; all of them provide free use for single users or small teams, they have great documentation and are pretty easy to start working with. Now let’s get started:</p>
<p><a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-2-of-4/">Installing and setting up TeamCity</a> (part 2)</p>
<p><a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-3-of-4/">Installing and setting up Octopus Deploy</a> (part 3)</p>
<p><a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-4-of-4/">Configuring TeamCity</a> (part 4)</p>
<p><a href="http://thefatcoder.com/uncategorized/building-and-deploying-with-teamcity-and-octopus-deploy-part-5-of-5/">Configuring Octopus Deploy</a> (part 5)</p>
<h3 id="toolsused">Tools used:</h3>
<ul>
<li><a href="https://www.jetbrains.com/teamcity/download/download-thanks.html?platform=windows">TeamCity 9.1.5</a></li>
<li><a href="https://download.octopusdeploy.com/octopus/Octopus.3.2.22-x64.msi">Octopus Server 3.2.22</a></li>
<li><a href="https://download.octopusdeploy.com/octopus/Octopus.Tentacle.3.2.22-x64.msi">Octopus Tentacle 3.2.22</a></li>
<li><a href="https://download.octopusdeploy.com/octopus-teamcity/3.2.0.51/Octopus.TeamCity.zip">TeamCity plugin 3.2.0.51</a></li>
<li><a href="https://www.microsoft.com/en/server-cloud/products/sql-server/">Microsoft SQL Server 2014</a><a href="https://www.visualstudio.com/">Visual Studio 2013 Premium</a></li>
</ul>
<!--kg-card-end: markdown--><!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>