Skip to content

Instantly share code, notes, and snippets.

@yokawasa
Last active December 3, 2018 05:43
Show Gist options
  • Save yokawasa/09046180c85a93792473eac80a63d65a to your computer and use it in GitHub Desktop.
Save yokawasa/09046180c85a93792473eac80a63d65a to your computer and use it in GitHub Desktop.
Quick Demo of Spinning up API in Azure Container instances
#!/bin/sh
set -e -x
RESOURCE_GROUP="RG-apim"
REGION="southeastasia"
# REGION needs to be the following ACI available regions:
# westus,eastus,westeurope,westus2,northeurope,southeastasia,eastus2,centralus,australiaeast,southcentralus,centralindia,canadacentral
PREFIX="yoichika"
echo "Create Resource Group"
az group create -n $RESOURCE_GROUP -l $REGION
echo "Create API in Azure Container Instance"
az container create --name "${PREFIX}-api" \
--resource-group $RESOURCE_GROUP \
--image "danielscholl/demoapi" \
--dns-name-label "${PREFIX}-api" \
--ports 80
echo "Test Access to Swagger"
open "http://${PREFIX}-api.${REGION}.azurecontainer.io/index.html"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment