Coder Social home page Coder Social logo

aws-codecommit-azure-appservice's Introduction

AWS Code Commit to Azure AppService

This README explains how to integrate AWS Code Commit with Azure AppService to trigger automatic deploys.

  1. [Azure] Create Azure AppService

  2. [AWS] Create your AWS Code Commit Repo

  3. [AWS] Create an IAM User to hold the SSH Keys for Azure AppService (Kudu) access to repo

  4. [Azure] Retrieve the public key of your AppService

    https://{appservice}.scm.azurewebsites.net/api/sshkey?ensurePublicKey=1

  5. [AWS] Put the key in the Security Credentials of IAM User

    http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-unixes.html

  6. [Azure] Edit the ~/.ssh/config with Kudu (https://{your appservice}.scm.azurewebsites.net/DebugConsole) and assign the "SSH key ID"

     Host git-codecommit.*.amazonaws.com
       User {SSH Key Id}
       IdentityFile ~/.ssh/{your private key file}
    
  7. [AWS] Create a Lambda Function index.js

    Once the function is working, you can download the max execution time to 1s because the deploy is launched.

  8. [AWS] Assign permissions to Code Commit to execute Lambda

    http://docs.aws.amazon.com/codecommit/latest/userguide/how-to-notify-lambda-cc.html

     policy.json 
    
     {
     	"FunctionName": "trigger_ci_azure_paas", 
     	"StatementId": "1", 
     	"Action": "lambda:InvokeFunction", 
     	"Principal": "codecommit.amazonaws.com", 
     	"SourceArn": "arn:aws:codecommit:eu-west-1:XXXXXXX:*", 
     	"SourceAccount": "XXXXXXX"
     }
    
    
     $ aws lambda add-permission --cli-input-json file://policy.json
    
  9. [AWS] Create trigger a Code Commit

    • customData = (user and password from Azure AppService publish profile) = https://{user}:{password}@{site}.scm.azurewebsites.net/deploy
    • Trigger name = repository name
    • Last step function name
  10. [Azure] Setup deployment options

    • External repository
    • Select the ssh version of the repo from AWS Code Commit

aws-codecommit-azure-appservice's People

Contributors

davidayalas avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.