How to integrate azure repo from amplify for CI/CD? - azure

I currently have an application in amplify but I want to integrate the repo, but I have it in azure, I don't see the option to integrate directly with azure from amplify.

In your case, the best suggestion would be to use multiple remotes provided by GitHub. no need to worry if you are not using GitHub because the process and the commands are the same.
As you are using 2 different environments you need to use Azure Repos and Code commit with git standard.
Once you have done setting multiple repos, configuring CI/CD pipeline would be a better process to deploy based on your push.
It's worth pointing out that you’ll need to properly setup and configure your CI/CD pipeline. AWS provides a number of services to support this including AWS CodePipeline, AWS CodeBuild, and AWS CodeDeploy.

Related

When using GitHub Actions, how can I run my Terraform on my AWS environment?

I am migrating my deployment from Jenkins to GitHub Actions.
I understand how to pull from my repository, build, test my application.
But one of the steps I currently perform inside of Jenkins is to update my infrastructure using Terraform. This means the code has to run on an instance running in my AWS environment.
How is this possible when using GitHub Actions?
I prefer Self-host runner environment to default runners of GitHub Actions.The simple reason is security issues that arise with default runners,you must provide them AWS Secret Access Keys and IDs.This is the excellent module terraform-aws-github-runner that I used for my project.
You can setup AWS Access using AWS Credentials Configure action. You can use these credentials to run a SSM document for your instances through the GitHub Actions workflow either via the AWS CLI or a script in your repository. SSM documents run directly on the instances.

Can Terraform be used as a CICD to build/deploy application code in aws?

I am planning to do cicd for my AWS-ECS & lambda application, but I am confused about that can I use terraform to run my cicd pipelines for deploying when new code pushes to my git repository. I don't want to use codepiepline but yes Jenkins if require.
If anyone has built this kind of architecture then pls let me know...
I think the closest you can get to CI/CD with terraform is with GitHub actions (assuming you keep your terraform config in a git repo) & terraform cloud. This page describes it: https://learn.hashicorp.com/tutorials/terraform/github-actions
Terraform Cloud is free for up to 5 users as well. I personally do use terraform cloud since you can version your modules / infrastructure & I use jenkins to schedule the builds. I think GitHub actions could be a little simpler but haven't tried yet.

How to maintain many Azure resources and deployments in one git repo?

I have a project that consists of an Azure webapp, a PostgreSQL on Azure, and multiple Azure functions for background ETL workflows. I also have a local Python package that I need to access from both the webapp and the Azure functions.
How can I structure configuration and script deployment for those resources from a single git repo?
Any suggestions or pointers to good examples or tutorials would be very appreciated.
All the Azure tutorials that I've seen are only for small and simple projects.
For now, I've hand-written an admin.py script that does e.g. the webapp and function deployments by creating a Python package, creating ZIP files for each resource and doing ZIP deployments. This is getting messy, and now I want to have QA and PROD versions, and I need to pass secrets so that the DB is reachable, and it's getting more complex. Is there either a nice way to structure this packaging / deployment, or a tool to help with it? For me, putting everything in Kubernetes is not the solution, at least the DB already exists. Also, Azure DevOps is not an option, we are using Gitlab CI, so eventually I want to have a solution that can run on CI/CD there.
Not sure if this will help complete but here we go.
Instead of using a hand-written admin.py script, try using a yaml pipeline flow. For Gitlab, they have https://docs.gitlab.com/ee/ci/yaml/ that you can use to get started. From what you've indicated, I would recommend having several job steps in your yaml pipeline that will build and package your web and function apps. For deployment, you can make use of environments. Have a look at https://docs.gitlab.com/ee/ci/multi_project_pipelines.html as well which illustrates how you can create downstream pipelines.
From a deployment standpoint, the current integration I've found between Azure and GitLab leaves me with two recommendations:
Leverage the script command of yaml to continue zipping your artifacts use Azure CLI (I would assume you can install the tools during the pipeline) to zip deploy.
Keep your code inside the GitLab repo and utilize Azure Pipelines to handle the CI/CD for you.
I hope you find this helpful.

Creating Bitbucket Server Webhook for AzureDevops Builds

To keep it short and sweet I am attempting to automate my CI/CD process which includes a AzureDevOps build running automatically when code is pushed in a bitbucket server repo. I have not found any documentation on how to set this up. Does anyone have any experience with this process? Keep in mind (even though i've mentioned it) I am using the server version of Bitbucket while using the PAAS version of AzureDevops.
It's fairly straightforward. When you create a pipeline, it will ask you where your repo is.
If it's hosted by Atlassian (you access it by https://bitbucket.org), select the BitBucket Cloud one and provide your login.
If it's self hosted, select "Other Git".

Continuous deployment to Azure using Bamboo

I'm working with Atlassian Bamboo on Demand for Continuous Integration and it works great.
Now I'm trying to use the "Deploy" feature and the problem is that I'm working with Azure (ftp, publish, git, mercurial... I really don't care how) and I can't find a "task" which could perform it.
Has anyone achieved this?
I do automated deployments to AWS from bamboo, but the concept is pretty much the same.
Bamboo has no specific options for deploying to the public cloud, so you have to build or call an existing deployment tool. At the end of the day bamboo deployments provide you with meta-data over which build has been deployed to which environment, and security over who can do deploys, but its up to you have to make the actual deploy work. Bamboo does give you a totally extensible engine for controlling the "how" via scripting. The deployment engine is basically a cut down version of the CI engine with a subset of tasks.
I resolved to build our deployment tooling due to it being fairly simple to get started and a worthwhile investment in time because this will be used often and improved over time. Bamboo gives me authorization and access control, and my scripts give me fine grained control of my deployments.
I'm assuming you are running a bamboo agent on a windows image like me. So powershell scripts are your friend . If you're running in linux you'll want to do the same with bash.
I have a powershell scripts controlling my deployments through a controller/agent model.
The controller script is source controlled and maintained in mercurial repo. This is pulled by the repository task.
The agent is a powershell script wrapped by a simple webapi rest service with a custom authentication mechanism. The agent is setup when an app server instance is provisioned in ec2. We use puppet for server provisioning.
The controller does the following for a deployment
connects to the vpc
determines the available nodes in my web farm using ec2
selects the first node and sends the node an "upgrade database" command
then proceeds to send "upgrade app server" command to each node
The logic for doing the deploy is parameterized so it can be re-used for deployment to different environment. I use bamboo deploy variables to manage feeding parameters for the different environments.
DEV is deployed automatically, test, staging and prod are all manual click deploys which are locked down to specific users.
One option I considered but did not invest the time to look at as aws elastic beanstalk as a deployment tool. It has a rich api for deploys. On the Azure side it looks like web deploy supports deployment to Azure IIS sites.

Resources