Showing posts with label dotnetcore. Show all posts
Showing posts with label dotnetcore. Show all posts

Reading Notes #389

Cloud


Programming


Miscellaneous

Reading Notes #388


Suggestion of the week

Cloud

Programming

Podcast

Miscellaneous

  • How To Develop Apps Like PUBG (Apoorv Gehlot) - An interesting article that gives us an idea of how a game like pugs got that success, and who they manage that rapid growth.
~

Reading Notes #387

Cloud


Programming


Podcasts


Books



Dare to Lead: Brave Work. Tough Conversations. Whole Hearts. (Brené Brown) - A nice book. pack with a lot of information. A lot's of stories to emphasize her points, I always like that. It was maybe a little too much cartesian for me... many steps. Or maybe I was not in a good mindset. Good book however.








~

Reading Notes #378



Cloud

Programming

Miscellaneous

Reading Notes #374

Cloud


Programming


Podcast

  • Hevesh5 - Making a YouTube Career from Viral Domino Art (#46) (That Creative Life) - Great show. An amazing story.
  • Azure Functions using Node with Simona Cotin (.NET Rocks!) - Great show. I just switch my website following that Jam stack pattern. I was planning to use Azure Functions to add a few little twists.... I'm happy to see that I not alone thinking like that!
  • 0230 - Alain Vezina - Le métier du DevOps (Visual Studio Talk Show) - Super épisode, très intéressant d'entendre parler du rôle de DevOps de quelqu'un qui le vie au quotidien. Merci de la suggestion, je crois, bien que je suis du pour relire The Pheonix Project.
  • Goal Setting Tips & Tracking KPIs (Video Pursuit Podcast) - Really interesting episode. Everybody is talking about matrix and KPI... But it's not frequent to hear about the "how". I really like how the goals are explained, achievable, but not easy... And how we should react when we don't reach them.

Miscellaneous


~ Good week!

Reading Notes #373

Cloud


Programming


Books



Donald Miller

A really interesting book that helps to focus and keep in mind the most important. I didn't read it with a purpose of business really, but it did make me remember past experiences and it was easy to make the relationship between success and when the story was clear. Take the time to read it, do the exercises/ reflections required... it's worth it.










~

Reading Notes #372

Suggestion of the week

Cloud

Programming


Miscellaneous

Reading Notes #366

Cloud


Programming


Databases


Miscellaneous



Reading Notes #359

DockerDesktopCloud


Programming


Databases


Miscellaneous


Books

How to Be a Bawse_cover
How to Be a Bawse A Guide to Conquering Life
Lilly Singh
Not only the message is strong, but the way she delivers it is awesome. Many times I laugh and nod of the head... Definitely a great book to read at the end of the year when resolution time is not far...









~

Reading Notes #358

CakeLogoCloud


Programming


Miscellaneous


~

Reading Notes #357

71lKlEYntPL._SL1500_Suggestion of the week


Cloud


Programming


Miscellaneous



~


Reading Notes #353

aliasesSuggestion of the week



Cloud



Programming



Books

The_FIrst_20_HoursThe First 20 Hours: How to Learn Anything...Fast (Josh Kaufman) - That was a very interesting book. I devoured it much faster than I thought! As I was reading it, I was thinking... hey as a developer/programmer I already do a lot of those things... Things change so fast, technology changes... And a few pages later, the author was saying the same thing. :) It looks like we can adapt to many deferent situations. The author share with us a few journeys as he was learning new stuff. While I may not be interested to learn how to play to Go, I found all part of the book very interesting as those journeys a pact with tons of information.
ISBN: 1591845556 (ISBN13: 9781591845553)


Miscellaneous


~

How to create an Azure Container Instance (ACI) with .Net Core

For a project I just started, I need to create Azure resources from code. In fact, I want to create an Azure Container Instance. I already know how to create a container from Logic Apps and Azure CLI/PowerShell, but I was looking to create it inside an Azure Function. After a quick research online, I found the Azure Management Libraries for .NET (aka Fluent API) a project available on Github that do just that (and so much more)!
In this post, I will share with you how this library work and the result of my test.

The Goal


For this demo, I will create a .Net Core console application that creates an Azure Containter Instance (ACI). After it should be easy to take this code and migrate to an Azure Function or anywhere else.

hello-container

The Console Application


Let's create a simple console application with the following command: dotnet new console -o AzFluentDemo cd AzFluentDemo dotnet add package microsoft.azure.management.fluent The last command will use the nuget package available online an add it to our solution. Now we need a service principal so our application could access the Azure subscription. A since way to create one is the use Azure CLI az ad sp create-for-rbac --sdk-auth > my.azureauth This will create an Active Directory (AD) Service Principal (SP) and write the content into the file my.azureauth. Perfect, now open the solution, for this kind of project, I like to use Visual Studio Code so code . will do the work for me. Replace the content of the Program.cs file by the following code.

using System;
using Microsoft.Azure.Management.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent;
using Microsoft.Azure.Management.ResourceManager.Fluent.Core;
namespace AzFluentDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            string authFilePath = "/home/frank/Dev/AzFluentDemo/my.azureauth";
            string resourceGroupName  = "cloud5mins";
            string containerGroupName = "frank-containers";
            string containerImage  = "microsoft/aci-helloworld";
            // Set Context
            IAzure azure = Azure.Authenticate(authFilePath).WithDefaultSubscription();
            ISubscription sub;
            sub = azure.GetCurrentSubscription();
            Console.WriteLine($"Authenticated with subscription '{sub.DisplayName}' (ID: {sub.SubscriptionId})");
            // Create ResoureGroup
            azure.ResourceGroups.Define(resourceGroupName)
                .WithRegion(Region.USEast)
                .Create();
            // Create Container instance
            IResourceGroup resGroup = azure.ResourceGroups.GetByName(resourceGroupName);
            Region azureRegion = resGroup.Region;
            // Create the container group
            var containerGroup = azure.ContainerGroups.Define(containerGroupName)
                .WithRegion(azureRegion)
                .WithExistingResourceGroup(resourceGroupName)
                .WithLinux()
                .WithPublicImageRegistryOnly()
                .WithoutVolume()
                .DefineContainerInstance(containerGroupName + "-1")
                    .WithImage(containerImage)
                    .WithExternalTcpPort(80)
                    .WithCpuCoreCount(1.0)
                    .WithMemorySizeInGB(1)
                    .Attach()
                .WithDnsPrefix(containerGroupName)
                .Create();
            Console.WriteLine($"Soon Available at http://{containerGroup.Fqdn}");
        }
    }
}

In the first row, I declare a few constants. The path of the service principal created earlier, resource group name, the container group name, and the image I will use. For this demo aci-helloworld. Then we get access with the Azure.Authenticate. Once we got access, it's y easy and the intellisense is fantastic! I don't think I need to explain the rest of the code as it already self-explanatory.

Got an Error?


While running you main in contour an error message complaining about the namespace not being registered or something like that ( I'm sorry I did not note the error message). You only need to register it with the command:

az provider register --namespace Microsoft.ContainerInstance

It will take a few minutes. To see if it's done you can execute this command:

az provider show -n Microsoft.ContainerInstance --query "registrationState" 

Wrap it up


And voila! If you do a dotnet run after a minute or two, you will have a new web application running inside a container available from http://frank=containers.eastus.azurecontainer.io. It's now very easy to take that code and bring it to an Azure Function or in any .Net Core Application that runs anywhere (Linux, Windows, Mac Os, web, containers, etc.)!


In a video, please!


I also have a video of this post if you prefer.



References




~

Reading Notes #350



markdig

Cloud


Programming


Miscellaneous


Books

Fast FocusFast Focus (Damon Zahariades) - Great short book. Not like the other of his kind, this book goes right to the point and offers actionable item. It's very practical and accessible to everyone. At the end of the book, you know what to do to get started and improve your focus.



Reading Notes #348

IMG_20181016_073145

Cloud


Programming


Data


Miscellaneous


~enjoy!

Reading Notes #347

MVIMG_20181011_103658

Cloud


Programming


Data


Miscellaneous



Reading Notes #346

Cloud

IMG_20181006_093540 (1)

Programming


Miscellaneous

  • Microsoft Ignite Aftermath ( Chris Pietschmann, Dan Patrick) - If you are like me and need to catch up on what append to Ignite, this post is a really good place to start as it contains a list of all the links we need.

~

Reading Notes #345

DSCF1554Suggestion of the week



Cloud



Programming



Miscellaneous

~

Reading Notes #343

2018-09-02_20-42-43Cloud


Programming


Reading Notes #341

IMG_20180815_181252Cloud


Programming


Integration


Miscellaneous


Books

  • VaporizedVaporized: Solid Strategies for Success in a Dematerialized World (Robert Tercek) - I really loved that book. In this world of digital transformation where everything goes so fast, this book explains why you should care. In fact, it asked so many good questions and related facts. I like to pretend I'm aware of the new technologies. That I'm on the edge, that I'm aware of the trending stuff... But guess what?! I got surprised, and even a bit scare at one point. This book is a must. Enjoy! ASIN: B01F9G31H8