Continuous Integration With VSTS and AWS EC2 Instances - amazon-ec2

We are managing source code in the VSTS there we had the Main Git Branch. And now we want to automate the deployment/release process with AWS EC2 instance.
We installed the AWS Toolkit for Visual Studio 2017 from the marketplace.
Can anyone guide how to deploy to AWS EC2 instance from VSTS?

You are talking about IaaS (Infrastructure as a code) there are several ways which you can able to achieve this.
Tools like terraform, ansible, cloud formation we're some popular tools which you can able to create an Ec2 instance from VSTS or Azure DevOps.
For an instance you can see here on how you can create an ec2 instance using terraform.
You can install the terraform extension from market place into your azure devops account.

Related

How to determine if an asp.net app is running on an azure vm

We have an asp.net app that gets deployed to both On-Prem and on Azure VMs. We are trying to figure out how to configure the app so that when deployed on an Azure VM it will use Azure App Configuration Service, but when deployed On-Prem it will continue to use the settings in the config files?
How can we know on app start up whether or not we are deployed on an Azure VM?
If you can, I would recommend you add a special environment variable when you provision your Azure VM or deploy your application. If not, you may use Azure Instance Metadata Service to tell the code is running in Azure VMs.

deploy laravel application to azure kubernetes using azure devops

i'm struggling a lot with a Laravel application that i want to deploy to azure AKS using azure DevOps
the thing is i'm reading a lots of non-accurate tutorials and docs, i didnt found anything related on how to push or deploy a Laravel docker image to azure aks using azure DevOps and it's frustrating,
can someone help me with that by giving me some hints or tutorials ?
thank you !
how to push or deploy a Laravel docker image to azure aks using azure DevOps
Agree with Daniel, you need to build the container, push it to a container registry, here is the detailed official tutorial. And then either run a series of kubectl commands or create Kubernetes manifests that tell Kubernetes how to run the containers.
In addition, this doc: Deploy a Docker container app to Azure Kubernetes Service will show you how to set up continuous deployment of your containerized application to an Azure Kubernetes Service (AKS) using Azure Pipelines.
BTW, videos: Getting started with CI/CD & Azure Container Service (AKS) powered by VSTS and CI-CD for Azure Kubernetes Service AKS using Azure DevOps are also helpful.

Deploying from Azure Devops to AWS machine behind VPN

We have our machines that we want to deploy to on AWS private subnet and we connect to them via VPN.
We want to use Azure Devops to build and deploy our code. Is there a way to deploy from Azure Devops to AWS machines through VPN?
Make sure your machine can access dev.azure.com, then you can try AWS Toolkit for Azure DevOps extension to work with AWS services.
Also, you can install one self-agent on your machine so that you can run the pipeline in your local environments.

Deploy Application to AWS EC2 Instance using terraform

I need to deploy my Java application to AWS EC2 Instance using terraform. The catch here, we should not use *.pem file to deploy the application.
I try to create ELB and associate instances using terraform.I can able to deploy the application using ssh and pem file to ec2 instances Private IPs. But we shouldn't use *.pem or *.ppk file, as it'll not be allowed in production servers.
I tried using chef with terraform , but that also requires *.pem to connect to AWS Instances.
Please let me know the detailed steps/suggestions of how to deploy the application using terraform without using pem file.
If you can't make any changes to your instance after creating it (including deploying the application) then you will need to bake any and all changes into the AMI that Terraform deploys.
You might want to look into using Packer to create AMIs with your intended configuration and then use Terraform to deploy these AMIs.
For reference, this strategy is known as "immutable infrastructure" so you might want to do some further reading into this area.
If instead it's simply that SSH connectivity is not allowed and you can make changes over other ports then you should be able to use an AMI that has a Chef client, Puppet agent or Salt minion on it (there may well be other tools that work over a non SSH protocol/port but this restriction rules out Ansible) and then use any of those tools to continue to configure your instance. Obviously you could find a suitable AMI from the AMI marketplace or, once again, use Packer to set up the relevant configuration management client.

Difference between Amazon EC2 API tools and AMI tools?

The developer tools page here list two set of tools for Amazon EC2
Amazon EC2 API tools
Amazon EC2 AMI tools
What are the differences between the two set of tools?
The API tools serve as the client interface to the Amazon EC2 web service. Use these tools to register and launch instances, manipulate security groups, and more
The Amazon EC2 AMI Tools are command-line utilities to help bundle an Amazon Machine Image (AMI), create an AMI from an existing machine or installed volume, and upload a bundled AMI to Amazon S3.
From the definitions shown at Developer Tools.
So, if you want to manage instances, use API tools; if you want to build and upload an AMI (Amazon Machine Image), use AMI tools.
Here are the lines from Amazon Documentation:
The Amazon EC2 command line interface tools (also called the CLI tools) wrap the Amazon EC2 API actions. These tools are written in Java and include shell scripts for both Windows and Linux/UNIX/Mac OSX.
Note
Alternatively, you can use the AWS Command Line Interface (AWS CLI), which provides commands for a broad set of AWS products, including Amazon EC2. To get started with the AWS CLI, see the AWS Command Line Interface User Guide. For more information about the AWS CLI commands for Amazon EC2, see ec2 in the AWS Command Line Interface Reference.
Before you can use the Amazon EC2 CLI tools, you need to download them and configure them to use your AWS account. You can set up the tools on your own computer or on an Amazon EC2 instance.
http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-windows.html

Resources