Giter Club home page Giter Club logo

apim-devops-bicep's Introduction

APIM DevOps Workflow

Deployment via CLI/Terminal

# COPY PARAMETERS TO LOCAL FILE
# FILL IN UNSPECIFIED PARAMS
cp main.parameters.json local.parameters.json

# SPECIFY LOCATION FOR DEPLOYMENT (USED FOR METADATA, NOT LOCATION FOR APIM DEPLOYMENT)
export LOCATION=eastus

# DEPLOY
az deployment sub create \
    --location $LOCATION \
    --name apim-deployment-`date +"%Y-%m-%d-%s"` \
    --template-file main.bicep \
    --parameters local.parameters.json \
    --confirm-with-what-if #if you want to see changes before confirming deployment

Deployment via GitHub Actions

  1. Setup your Environments

    • Create the Dev Environment
    • Create the Staging Environment
    • Create the Production Environment
  2. Define the Service Principal

    # CREATE SERVICE PRINCIPAL FOR WORKFLOW
    # THIS WILL BE USED AS A GITHUB ACTIONS SECRET
    # BY DEFAULT WILL HAVE CONTRIBUTOR ON SUBSCRIPTION
    az ad sp create-for-rbac \
    --name BicepGitHubActionsSP \
    --role Contributor \
    --sdk-auth
  3. Create a GitHub Secret named AZURE_CREDENTIALS

  4. Run Workflow

Initial Instantiation of APIM Instance

Portal Initialization

  1. First you can seed your portal-content folder by capturing the content from an experimental APIM instance where you customized and updated the portal:

    cd api-management-developer-portal
    npm install
    
    cd scripts.v3
    node ./capture \
    --subscriptionId <SUB_ID_OF_DEV_APIM> \
    --resourceGroupName <RG_NAME> \
    --service-name <APIM_NAME> \
    --folder ../../portal-content

    Moving forward you can now commit your portal content as an artifact you maintain like your other code and configuration for APIM

  2. You can run manually the generateAndPublish.js script if you want to now publish this content to a specific APIM instance:

    cd api-management-developer-portal
    npm install
    
    cd scripts.v3
    node ./generateAndPublish.js \
    --subscriptionId <SUB_ID_OF_TARGET_APIM> \
    --resourceGroupName <RG_NAME> \
    --service-name <APIM_NAME> \
    --folder ../../portal-content

    Note that the portal-content folder should have a media folder as well even if there are no contents in the media folder

References

apim-devops-bicep's People

Contributors

haithamshahin333 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.