devops
Global Azure Virtual - Shhhhh: Secrets Should Stay Secret
·87 words·1 min
azure
devops
dotnet
kubernetes
keyvault
managedidentity
A common challenge when building cloud applications is how to manage the credentials in your code for authenticating to cloud services. In this session we’ll explore how to keep your credentials safe and how you can work without saving those credentials in the developers machines and therefore avoid an accidental upload to source control.
MongoDB Enterprise Operator: Deploying MongoDB in AKS
·614 words·3 mins
kubernetes
azure
devops
aks
mongodb
a couple of weeks ago I was trying to deploy MongoDB in AKS using the MongoDB Enterprise Operator and had trouble finding a simple tutorial to make the thing work. This post intends to fill that gap with a straight to the point approach.
Prerequisites # Be sure to deploy AKS with a set of nodes with at least 8GB of RAM. I used Standard_D3_v2
DOSConf - Shhhhh: Secrets Should Stay Secret
azure
devops
dotnet
kubernetes
keyvault
managedidentity
DOSConf - Azure Kuberentes Service: Lessons Learned
azure
devops
dotnet
kubernetes
keyvault
managedidentity
Netcoreconf Barcelona - Shhhhh: Secrets Should Stay Secret
·87 words·1 min
azure
devops
dotnet
kubernetes
keyvault
managedidentity
A common challenge when building cloud applications is how to manage the credentials in your code for authenticating to cloud services. In this session we’ll explore how to keep your credentials safe and how you can work without saving those credentials in the developers machines and therefore avoid an accidental upload to source control.
Visual Studio Code Remote Containers: Jekyll
·482 words·3 mins
devops
jekyll
visual studio code
For the last 3 years this blog was written using Jekyll which has a series of requirements such as Ruby that I don’t want to keep installing or maintaining on my PC. So I created this Developer Container for those who want to use Jekyll from an isolated container.
Let’s check the container definition:
TenerifeDev Christmas TechParty - Asistentes Virtuales
azure
devops
kubernetes
alexa
chatops
Interfaz Podcast Episodio 129 – En vivo desde Microsoft Ignite 2019 – Novedades en AKS y Contenedores con Carlos Mendible
·4 words·1 min
azure
devops
kubernetes
alexa
chatops
Check the podcast here
GitOps: Deploying apps in Azure Kubernetes Service (AKS) with Flux
·312 words·2 mins
azure
kubernetes
devops
git
gitops
aks
flux
Recently I learned about GitOps which is a way to manage your Kubernetes clusters and the applications you run on top using Git. The idea is that you can declaratively describe the desired state of your systems in Git and roll out changes as soon as merges occur.
You can immediately see the main benefits of such an approach: Your Git repositories become the single source of truth for both your infrastructure and application code, allowing the teams to increase productivity and stability (you get the Git log to audit changes).
Kured: Restart your Azure Kubernetes Service Nodes
·278 words·2 mins
azure
kubernetes
devops
aks
kured
Two weeks ago I got an email message from Microsoft Azure explaining that Azure Kubernetes Services had been patched but that I had to restart my nodes (reboot the clusters) to complete the operation.
The first thing you need to know is that, when things like this happens, the Azure platform creates a file called /var/run/reboot-required in each of the nodes of your cluster.
Visual Studio Code Remote Containers: Azure Blockchain
·390 words·2 mins
azure
devops
blockchain
truffle
ganache
nodejs
ethereum
visual studio code
After collaborating with the Azure Ansible container I decided to also develop a Developer Container for those who want or need to use the Azure Blockchain Development Kit for Ethereum to create smart contracts, taking away the burden of installing Python, Truffle, Ganache and NodeJS on your machine.
Once again I collaborated with Chuck Lantz and the container definition resulted in the following two files:
Visual Studio Code Remote Containers: Azure Ansible
·558 words·3 mins
azure
devops
ansible
visual studio code
Last year I was working on a project for deploying Azure services using Ansible, and let me tell you something: Back then a feature like Visual Studio Remote Containers would have helped us so much!
Why? Because just installing Visual Studio Code, the Remote Development Extension Pack, and Docker you have a killer combo that makes it possible to create a Development environment in a snap and share it with your source code.
Scale a Kubernetes Deployment with .NET Core
·351 words·2 mins
dotnet
kubernetes
devops
aspnetcore
Let’s start:
Create a folder for your new project # Open a command prompt an run:
mkdir kuberenetes.scale Create the project # cd kuberenetes.scale dotnet new api Add the references to KubernetesClient # dotnet add package KubernetesClient -v 1.5.18 dotnet restore Create a PodsController.cs with the following code # using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using k8s; using k8s.Models; using Microsoft.AspNetCore.JsonPatch; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; namespace kubernetes.scale { [Route("api/[controller]")] [ApiController] public class PodsController : ControllerBase { private KubernetesClientConfiguration k8sConfig = null; public PodsController(IConfiguration config) { // Reading configuration to know if running inside a cluster or in local mode. var useKubeConfig = bool.Parse(config["UseKubeConfig"]); if (!useKubeConfig) { // Running inside a k8s cluser k8sConfig = KubernetesClientConfiguration.InClusterConfig(); } else { // Running on dev machine k8sConfig = KubernetesClientConfiguration.BuildConfigFromConfigFile(); } } [HttpPatch("scale")] public IActionResult Scale([FromBody]ReplicaRequest request) { // Use the config object to create a client. using (var client = new Kubernetes(k8sConfig)) { // Create a json patch for the replicas var jsonPatch = new JsonPatchDocument<V1Scale>(); // Set the new number of repplcias jsonPatch.Replace(e => e.Spec.Replicas, request.Replicas); // Creat the patch var patch = new V1Patch(jsonPatch); // Patch the "minions" Deployment in the "default" namespace client.PatchNamespacedDeploymentScale(patch, request.Deployment, request.Namespace); return NoContent(); } } } public class ReplicaRequest { public string Deployment { get; set; } public string Namespace { get; set; } public int Replicas { get; set; } } } Replace the contents of the appsettings.Development.json file # Note the UseKubeConfig property is set to true.
Accepting Azure Marketplace Terms with Ansible
·243 words·2 mins
azure
devops
ansible
Last May I wrote: Accepting Azure Marketplace Terms with Azure CLI and this time we’ll accomplish the same task with Ansible.
Turns out that Ansible 2.6 comes with a handy new module: azure_rm_resource which lets you create, update or delete any Azure resource using Azure REST API. So I decided to take it for a test drive with the “Accepting Terms” sample.
Installing Azure CLI and Ansible on Ubuntu
·226 words·2 mins
azure
devops
ansible
azure cli
I’ve been using Ansible and the Azure CLI every single day for the last 3 months. Non stop work editing playbooks and scripts with Visual Studio Code and running them on Ubuntu (WSL) on my Windows 10 machine.
Turns out that because Ansible uses python version 2.7.12 and the Azure CLI uses python 3.6.5 you can make a mess if you get “creative” trying to install the tools instead of using the recommended commands:
Accepting Azure Marketplace Terms with Azure CLI
·136 words·1 min
azure
devops
azure cli
When you try to deploy a VM from the Marketplace using an ARM (json) template you’ll get an error like the one below in the case when you’ve not previously accepted the Legal terms for the image:
[{"Legal terms have not been accepted for this item on this subscription. To accept terms using Powershell..."}] Accepting the Legal terms is something you have to do once per subscription for each provider offer you want to use. So how can you accept the terms using the Azure CLI (version 2.0.26 or higher)?
Running Ansible Azure playbook in Azure Cloud Shell
·150 words·1 min
azure
devops
ansible
cloud shell
NOTE: The issue described in this post was fixed!!! (ansible 2.5.2 and Azure CLI 2.0.34) # Last week I tried to run this simple Ansible playbook in Azure Cloud Shell:
# resource_group.yml # Create test resource group in west europe - name: Create a Resource Group hosts: localhost connection: local gather_facts: no tasks: - name: Create Resource Group azure_rm_resourcegroup: location: westeurope name: test state: present The first attempt to run the playbook with:
Use PowerShell to create a Microsoft Teams Channel
·159 words·1 min
devops
powershell
microsoft teams
For those of you who have been trying to automate anything related to Microsoft Teams, let me tell you that there is a new PowerShell Module in town: Microsoft Teams 0.9.0 which you can install with the following command:
Install-Module MicrosoftTeams Now to automate the channel creation In A Team you can simply:
Use PowerShell to enable Azure Storage Account Firewall Rules
·157 words·1 min
azure
devops
storage account
powershell
In this post I’ll show you how to Use PowerShell to enable Azure Storage Account Firewall Rules.
Be sure to be have AzureRM PowerShell 4.4.1 module installed.
Login to your Azure Account # Launch Powershell and start by Login to your Azure Account.
Use PowerShell to Enable and Automate Azure Analysis Services Backup
·605 words·3 mins
azure
devops
analysis services
backup
powershell
In this post I’ll show you how to Use PowerShell to Enable and Automate Azure Analysis Backup.
Enable Azure Analysis Service Backup # Enable-AzureRmAnalysisServicesBackup is a small powershell script that uses the the Set-AzureRmResource cmdlet to enable backup location to an Azure Analysis Service instance.