Flexible Deployment

Published Jul 20 2021 11:07 AM 1,397 Views
Microsoft

In a previous a blog I wrote about Cognitive Services in containers, and we dove in an example on how to deploy a Speech Container.

 

In this blog we are going to dive into the different way you can run Cognitive Services in a container on Azure. We first look at the different options on how you can run a container on Azure and secondly, we investigate a few scenarios how you might want to run your application.

 

What are containers?
Containerization is an approach to software distribution in which an application or service, including its dependencies & configuration, is packaged together as a container image. With little or no modification, a container image can be deployed on a container host. Containers are isolated from each other and the underlying operating system, with a smaller footprint than a virtual machine. Containers can be instantiated from container images for short-term tasks and removed when no longer needed.
Read more on Microsoft Docs

 

Running Containers on Azure

First let us start find out the options you can choose from, when hosting a container solution on Azure. We will look at 4 different options. For every option there is a code sample using the Azure CLI.

 

Create a Text Analytics endpoint in Azure

To follow along with the code samples you need to create a Text Analytics endpoint in Azure first.

 

# Create a resource group called demo_rg in the region westeurope
az group create --name demo_rg --location westeurope

# Create a Text Analytics Cognitive Service Endpoint 
az cognitiveservices account create \
    --name textanalytics-resource \
    --resource-group demo_rg \
    --kind TextAnalytics \
    --sku F0 \
    --location westeurope \  

# Get the endpoint URL
az cognitiveservices account show --name textanalytics-resource --resource-group demo_rg  --query properties.endpoint -o json

# Get the  API Keys
az cognitiveservices account keys list --name textanalytics-resource --resource-group demo_rg

 

Use the container directly or create a reusable container

You can run the containers directly from the Microsoft Container Repository or create a reusable container and store it in your own Container repository.


Sample on how to run the Text Analytics Container locally from the Microsoft Container Registry.

 

```
# Run the container 
docker run --rm -it -p 5000:5000 --memory 8g --cpus 1 \
mcr.microsoft.com/azure-cognitive-services/textanalytics/sentiment \
Eula=accept \
Billing={ENDPOINT_URI} \
ApiKey={API_KEY}

# Test the container
curl -X POST "http://localhost:5000/text/analytics/v3.0/sentiment" 
-H "Content-Type: application/json" 
-d "{\"documents\":[{\"language\":\"en\",\"id\":\"1-en\",\"text\":\"Hello beautiful world.\"}]}"
```

 

Reuse a container.

You can use a container recipes to create Cognitive Services Containers that can be reused. Containers can be built with some or all configuration settings so that they are not needed when the container is started.

 

Once you have this new layer of container (with settings), and you have tested it locally, you can store the container in a container registry. When the container starts, it will only need those settings that are not currently stored in the container. The private registry container provides configuration space for you to pass those settings in.

 

# Create a Dockerfile
FROM mcr.microsoft.com/azure-cognitive-services/sentiment:latest
ENV billing={BILLING_ENDPOINT}
ENV apikey={ENDPOINT_KEY}
ENV EULA=accept

# Build the docker image
docker build -t <your-image-name> .

# Run your container
docker run --rm -it -p 5000:5000 --memory 8g --cpus 1 <your-image-name>

# Test the container
curl -X POST "http://localhost:5000/text/analytics/v3.0/sentiment" 
-H "Content-Type: application/json" 
-d "{\"documents\":[{\"language\":\"en\",\"id\":\"1-en\",\"text\":\"Hello beautiful world.\"}]}"

 

Now that you have your own container you can push the container to your own Container Repository.

 

# Create the container registry
az acr create --resource-group demo_rg --name henksregistry --sku Basic --admin-enabled true

# Get the username
az acr credential show -n henksregistry --query username

# Get the password 
az acr credential show -n henksregistry  --query passwords[0].value

# Get the repository URL
az acr show -n henksregistry --query loginServer

# Sign in to your private registry with the details from the steps above
docker login henksregistry.azurecr.io

# Tag your container
docker tag <your-image-name>  henksregistry.azurecr.io/<your-image-name>

# Push your container to the registry
docker push henksregistry.azurecr.io/<your-image-name>

 

Now you have a Text Analytics Container in your own private Azure Container Registry.

Read more on Docs
Install and run Text Analytics containers  
Create containers for reuse 
Create a private container registry using the Azure CLI


Let us go to the next step and see how we can deploy these containers in the different offerings and see the benefits.

 

Azure Container Instance (ACI)

The easiest option to run a container is to use an Azure Container instance also referred as the serverless container option. It can run Linux and Windows containers. If you use Linux based containers you can run multiple containers in a container group, mount volumes from Azure Files, monitored them with Azure Monitor and use a GPU.

Azure Container Instances is a great solution for any scenario that can operate in isolated containers, including simple applications, task automation, and build jobs. You can run them securely in a virtual network and use a Traffic Manager to distribute traffic across multiple instances.

Read more about Azure Container Instances
Azure Container Instances documentation
Azure Container Instances (ACI) across 3 regions in under 30 seconds with Azure Traffic Manager by A...
What is Traffic Manager?

 

This sample shows how you can deploy the sentiment analysis container to an Azure Container Instance.

 

az container create 
    --resource-group <insert resource group name> \
    --name <insert container name> \
    --dns-name-label <insert unique name> \
    --memory 2 --cpu 1 \
    --ports 5000 \
    --image mcr.microsoft.com/azure-cognitive-services/textanalytics/sentiment:3.0-en \
    --environment-variables \
        Eula=accept \
        Billing=<insert endpoint>  \
        ApiKey=<insert apikey>

 

Azure App Service

Azure App Service is a great way to host a simple container solution, it offers some more out of the box functionality then Azure Container Instances. All the features from an App Service like Azure AutoScale are available and easily integrate with services like Azure Front Door and traffic manager to perform traffic routing and load-balancing.

 

App Service not only adds the power of Microsoft Azure to your application, such as security, load balancing, autoscaling, and automated management. You can also take advantage of its DevOps capabilities, such as continuous deployment from Azure DevOps, GitHub, Docker Hub, and other sources, package management, staging environments, custom domain, and TLS/SSL certificates.

 

Azure App Service for your containerized solutions is great if you are looking for easy to use service that automatically scales when traffic increases and integrates with other Azure Services for traffic management like Traffic Manager and Azure Frontdoor.

 

Read more about Azure App Service on Microsoft Docs and Azure.com.
- App Service documentation 
Web App for Containers

This sample shows how you can deploy the sentiment analysis container to an Azure App Service

 

# Create an App Service
az appservice plan create 
   --name <app-name> 
   --resource-group demo_rg 
   --sku S1 --is-linux

# Create the webapp with the private container (Deployment can take a while)
az webapp create 
  --name <webapp-name>
  --plan <app-name>   
  --resource-group demo_rg  
  -i <registryname>.azurecr.io/<your-image-name>

curl -X POST "http://<webapp-name>.azurewebsites.net/text/analytics/v3.0/sentiment" 
-H "Content-Type: application/json" 
-d "{\"documents\":[{\"language\":\"en\",\"id\":\"1-en\",\"text\":\"Hello beautiful world.\"}]}"

 

The options above are the quickest way to get started with containers on Azure. But some solutions require advanced orchestration or need to be able to run on edge devices in disconnected scenarios. For this scenarios Azure offers Azure Kubernetes Services and IoT Edge.

 

Azure Kubernetes Services

Deploy and manage containerized applications more easily with a fully managed Kubernetes service. Azure Kubernetes Service (AKS) offers serverless Kubernetes, an integrated continuous integration and continuous delivery (CI/CD) experience, and enterprise-grade security and governance. Unite your development and operations teams on a single platform to rapidly build, deliver, and scale applications with confidence.

 

Kubernetes is a rapidly evolving platform that manages container-based applications and their associated networking and storage components. Kubernetes focuses on the application workloads, not the underlying infrastructure components. Kubernetes provides a declarative approach to deployments, backed by a robust set of APIs for management operations.

 

You can build and run modern, portable, microservices-based applications, using Kubernetes to orchestrate and manage the availability of the application components. Kubernetes supports both stateless and stateful applications as teams progress through the adoption of microservices-based applications.

 

As an open platform, Kubernetes allows you to build your applications with your preferred programming language, OS, libraries, or messaging bus. Existing continuous integration and continuous delivery (CI/CD) tools can integrate with Kubernetes to schedule and deploy releases.

 

AKS provides a managed Kubernetes service that reduces the complexity of deployment and core management tasks, like upgrade coordination. The Azure platform manages the AKS control plane, and you only pay for the AKS nodes that run your applications.

 

Read more on Microsoft Docs

 

IoT Edge

Azure IoT Edge is a fully managed service built on Azure IoT Hub. Deploy your cloud workloads—artificial intelligence, Azure and third-party services, or your own business logic—to run on Internet of Things (IoT) edge devices via standard containers. By moving certain workloads to the edge of the network, your devices spend less time communicating with the cloud, react more quickly to local changes, and operate reliably even in extended offline periods.

 

Azure IoT Edge moves cloud analytics and custom business logic to devices so that your organization can focus on business insights instead of data management. Scale out your IoT solution by packaging your business logic into standard containers, then you can deploy those containers to any of your devices and monitor it all from the cloud.

 

Analytics drives business value in IoT solutions, but not all analytics needs to be in the cloud. If you want to respond to emergencies as quickly as possible, you can run anomaly detection workloads at the edge. If you want to reduce bandwidth costs and avoid transferring terabytes of raw data, you can clean and aggregate the data locally then only send the insights to the cloud for analysis.

 

If you want to learn more about IoT Edge you can watch the video "IoT ELP Module 3 Adding Intelligence, Unlocking New Insights with AI & ML

 

 

There are also other services on Azure that can run containers, but might need some work to get the Cognitive Services containers running on them:
- Azure Batch
- Azure Function App
- Azure Service Fabric

Continue your learning journey and get skilled up on all things Azure AI!

%3CLINGO-SUB%20id%3D%22lingo-sub-2564524%22%20slang%3D%22en-US%22%3EFlexible%20Deployment%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2564524%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20a%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fblogs%2Fblogworkflowpage%2Fblog-id%2FAzureAIBlog%2Farticle-id%2F160%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_self%22%3Eprevious%20a%20blog%3C%2FA%3E%20I%20wrote%20about%20Cognitive%20Services%20in%20containers%2C%20and%20we%20dove%20in%20an%20example%20on%20how%20to%20deploy%20a%20Speech%20Container.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20blog%20we%20are%20going%20to%20dive%20into%20the%20different%20way%20you%20can%20run%20Cognitive%20Services%20in%20a%20container%20on%20Azure.%20We%20first%20look%20at%20the%20different%20options%20on%20how%20you%20can%20run%20a%20container%20on%20Azure%20and%20secondly%2C%20we%20investigate%20a%20few%20scenarios%20how%20you%20might%20want%20to%20run%20your%20application.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWhat%20are%20containers%3F%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CEM%3EContainerization%20is%20an%20approach%20to%20software%20distribution%20in%20which%20an%20application%20or%20service%2C%20including%20its%20dependencies%20%26amp%3B%20configuration%2C%20is%20packaged%20together%20as%20a%20container%20image.%20With%20little%20or%20no%20modification%2C%20a%20container%20image%20can%20be%20deployed%20on%20a%20container%20host.%20Containers%20are%20isolated%20from%20each%20other%20and%20the%20underlying%20operating%20system%2C%20with%20a%20smaller%20footprint%20than%20a%20virtual%20machine.%20Containers%20can%20be%20instantiated%20from%20container%20images%20for%20short-term%20tasks%20and%20removed%20when%20no%20longer%20needed.%3C%2FEM%3E%3CBR%20%2F%3E%3CA%20title%3D%22Read%20more%20on%20Microsoft%20Docs%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Foverview%2Fwhat-is-a-container%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERead%20more%20on%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--408695220%22%20id%3D%22toc-hId--408695220%22%3ERunning%20Containers%20on%20Azure%3C%2FH2%3E%0A%3CP%3EFirst%20let%20us%20start%20find%20out%20the%20options%20you%20can%20choose%20from%2C%20when%20hosting%20a%20container%20solution%20on%20Azure.%20We%20will%20look%20at%204%20different%20options.%20For%20every%20option%20there%20is%20a%20code%20sample%20using%20the%20Azure%20CLI.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-281866254%22%20id%3D%22toc-hId-281866254%22%3E%3CSPAN%3ECreate%20a%20Text%20Analytics%20endpoint%20in%20Azure%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3ETo%20follow%20along%20with%20the%20code%20samples%20you%20need%20to%20create%20a%20Text%20Analytics%20endpoint%20in%20Azure%20first.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23%20Create%20a%20resource%20group%20called%20demo_rg%20in%20the%20region%20westeurope%0Aaz%20group%20create%20--name%20demo_rg%20--location%20westeurope%0A%0A%23%20Create%20a%20Text%20Analytics%20Cognitive%20Service%20Endpoint%20%0Aaz%20cognitiveservices%20account%20create%20%5C%0A%20%20%20%20--name%20textanalytics-resource%20%5C%0A%20%20%20%20--resource-group%20demo_rg%20%5C%0A%20%20%20%20--kind%20TextAnalytics%20%5C%0A%20%20%20%20--sku%20F0%20%5C%0A%20%20%20%20--location%20westeurope%20%5C%20%20%0A%0A%23%20Get%20the%20endpoint%20URL%0Aaz%20cognitiveservices%20account%20show%20--name%20textanalytics-resource%20--resource-group%20demo_rg%20%20--query%20properties.endpoint%20-o%20json%0A%0A%23%20Get%20the%20%20API%20Keys%0Aaz%20cognitiveservices%20account%20keys%20list%20--name%20textanalytics-resource%20--resource-group%20demo_rg%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1525588209%22%20id%3D%22toc-hId--1525588209%22%3EUse%20the%20container%20directly%20or%20create%20a%20reusable%20container%3C%2FH3%3E%0A%3CP%3EYou%20can%20run%20the%20containers%20directly%20from%20the%20Microsoft%20Container%20Repository%20or%20create%20a%20reusable%20container%20and%20store%20it%20in%20your%20own%20Container%20repository.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ESample%20on%20how%20to%20run%20the%20Text%20Analytics%20Container%20locally%20from%20the%20Microsoft%20Container%20Registry.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%60%60%60%0A%23%20Run%20the%20container%20%0Adocker%20run%20--rm%20-it%20-p%205000%3A5000%20--memory%208g%20--cpus%201%20%5C%0Amcr.microsoft.com%2Fazure-cognitive-services%2Ftextanalytics%2Fsentiment%20%5C%0AEula%3Daccept%20%5C%0ABilling%3D%7BENDPOINT_URI%7D%20%5C%0AApiKey%3D%7BAPI_KEY%7D%0A%0A%23%20Test%20the%20container%0Acurl%20-X%20POST%20%22http%3A%2F%2Flocalhost%3A5000%2Ftext%2Fanalytics%2Fv3.0%2Fsentiment%22%20%0A-H%20%22Content-Type%3A%20application%2Fjson%22%20%0A-d%20%22%7B%5C%22documents%5C%22%3A%5B%7B%5C%22language%5C%22%3A%5C%22en%5C%22%2C%5C%22id%5C%22%3A%5C%221-en%5C%22%2C%5C%22text%5C%22%3A%5C%22Hello%20beautiful%20world.%5C%22%7D%5D%7D%22%0A%60%60%60%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-961924624%22%20id%3D%22toc-hId-961924624%22%3E%3CSPAN%3EReuse%20a%20container.%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20use%20a%20container%20recipes%20to%20create%20Cognitive%20Services%20Containers%20that%20can%20be%20reused.%20Containers%20can%20be%20built%20with%20some%20or%20all%20configuration%20settings%20so%20that%20they%20are%20not%20needed%20when%20the%20container%20is%20started.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EOnce%20you%20have%20this%20new%20layer%20of%20container%20(with%20settings)%2C%20and%20you%20have%20tested%20it%20locally%2C%20you%20can%20store%20the%20container%20in%20a%20container%20registry.%20When%20the%20container%20starts%2C%20it%20will%20only%20need%20those%20settings%20that%20are%20not%20currently%20stored%20in%20the%20container.%20The%20private%20registry%20container%20provides%20configuration%20space%20for%20you%20to%20pass%20those%20settings%20in.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23%20Create%20a%20Dockerfile%0AFROM%20mcr.microsoft.com%2Fazure-cognitive-services%2Fsentiment%3Alatest%0AENV%20billing%3D%7BBILLING_ENDPOINT%7D%0AENV%20apikey%3D%7BENDPOINT_KEY%7D%0AENV%20EULA%3Daccept%0A%0A%23%20Build%20the%20docker%20image%0Adocker%20build%20-t%20%3CYOUR-IMAGE-NAME%3E%20.%0A%0A%23%20Run%20your%20container%0Adocker%20run%20--rm%20-it%20-p%205000%3A5000%20--memory%208g%20--cpus%201%20%3CYOUR-IMAGE-NAME%3E%0A%0A%23%20Test%20the%20container%0Acurl%20-X%20POST%20%22http%3A%2F%2Flocalhost%3A5000%2Ftext%2Fanalytics%2Fv3.0%2Fsentiment%22%20%0A-H%20%22Content-Type%3A%20application%2Fjson%22%20%0A-d%20%22%7B%5C%22documents%5C%22%3A%5B%7B%5C%22language%5C%22%3A%5C%22en%5C%22%2C%5C%22id%5C%22%3A%5C%221-en%5C%22%2C%5C%22text%5C%22%3A%5C%22Hello%20beautiful%20world.%5C%22%7D%5D%7D%22%3C%2FYOUR-IMAGE-NAME%3E%3C%2FYOUR-IMAGE-NAME%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20that%20you%20have%20your%20own%20container%20you%20can%20push%20the%20container%20to%20your%20own%20Container%20Repository.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23%20Create%20the%20container%20registry%0Aaz%20acr%20create%20--resource-group%20demo_rg%20--name%20henksregistry%20--sku%20Basic%20--admin-enabled%20true%0A%0A%23%20Get%20the%20username%0Aaz%20acr%20credential%20show%20-n%20henksregistry%20--query%20username%0A%0A%23%20Get%20the%20password%20%0Aaz%20acr%20credential%20show%20-n%20henksregistry%20%20--query%20passwords%5B0%5D.value%0A%0A%23%20Get%20the%20repository%20URL%0Aaz%20acr%20show%20-n%20henksregistry%20--query%20loginServer%0A%0A%23%20Sign%20in%20to%20your%20private%20registry%20with%20the%20details%20from%20the%20steps%20above%0Adocker%20login%20henksregistry.azurecr.io%0A%0A%23%20Tag%20your%20container%0Adocker%20tag%20%3CYOUR-IMAGE-NAME%3E%20%20henksregistry.azurecr.io%2F%3CYOUR-IMAGE-NAME%3E%0A%0A%23%20Push%20your%20container%20to%20the%20registry%0Adocker%20push%20henksregistry.azurecr.io%2F%3CYOUR-IMAGE-NAME%3E%0A%3C%2FYOUR-IMAGE-NAME%3E%3C%2FYOUR-IMAGE-NAME%3E%3C%2FYOUR-IMAGE-NAME%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3E%3CSPAN%3ENow%20you%20have%20a%20Text%20Analytics%20Container%20in%20your%20own%20private%20Azure%20Container%20Registry.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3ERead%20more%20on%20Docs%3C%2FSTRONG%3E%3CBR%20%2F%3E-%26nbsp%3B%3CA%20title%3D%22Install%20and%20run%20Text%20Analytics%20containers%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Ftext-analytics%2Fhow-tos%2Ftext-analytics-how-to-install-containers%3Ftabs%3Dsentiment%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EInstall%20and%20run%20Text%20Analytics%20containers%3C%2FA%3E%20%26nbsp%3B%3CBR%20%2F%3E-%26nbsp%3B%3CA%20title%3D%22Create%20containers%20for%20reuse%26nbsp%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcontainers%2Fcontainer-reuse-recipe%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECreate%20containers%20for%20reuse%26nbsp%3B%3C%2FA%3E%3CBR%20%2F%3E-%26nbsp%3B%3CA%20title%3D%22Create%20a%20private%20container%20registry%20using%20the%20Azure%20CLI%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcontainer-registry%2Fcontainer-registry-get-started-azure-cli%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECreate%20a%20private%20container%20registry%20using%20the%20Azure%20CLI%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CBR%20%2F%3ELet%20us%20go%20to%20the%20next%20step%20and%20see%20how%20we%20can%20deploy%20these%20containers%20in%20the%20different%20offerings%20and%20see%20the%20benefits.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--845529839%22%20id%3D%22toc-hId--845529839%22%3E%3CSPAN%3EAzure%20Container%20Instance%20(ACI)%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EThe%20easiest%20option%20to%20run%20a%20container%20is%20to%20use%20an%20Azure%20Container%20instance%20also%20referred%20as%20the%20serverless%20container%20option.%20It%20can%20run%20Linux%20and%20Windows%20containers.%20If%20you%20use%20Linux%20based%20containers%20you%20can%20run%20multiple%20containers%20in%20a%20container%20group%2C%20mount%20volumes%20from%20Azure%20Files%2C%20monitored%20them%20with%20Azure%20Monitor%20and%20use%20a%20GPU.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAzure%20Container%20Instances%20is%20a%20great%20solution%20for%20any%20scenario%20that%20can%20operate%20in%20isolated%20containers%2C%20including%20simple%20applications%2C%20task%20automation%2C%20and%20build%20jobs.%20You%20can%20run%20them%20securely%20in%20a%20virtual%20network%20and%20use%20a%20Traffic%20Manager%20to%20distribute%20traffic%20across%20multiple%20instances.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3ERead%20more%20about%20Azure%20Container%20Instances%3C%2FSTRONG%3E%3CBR%20%2F%3E-%26nbsp%3B%3CA%20title%3D%22Azure%20Container%20Instances%20documentation%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcontainer-instances%2F%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Container%20Instances%20documentation%3C%2FA%3E%3CBR%20%2F%3E-%26nbsp%3B%3CA%20title%3D%22Azure%20Container%20Instances%20(ACI)%20across%203%20regions%20in%20under%2030%20seconds%20with%20Azure%20Traffic%20Manager%20by%26nbsp%3BAaron%20Wislang%22%20href%3D%22https%3A%2F%2Faaronmsft.com%2Fposts%2Fazure-container-instances%2F%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EAzure%20Container%20Instances%20(ACI)%20across%203%20regions%20in%20under%2030%20seconds%20with%20Azure%20Traffic%20Manager%20by%26nbsp%3BAaron%20Wislang%3C%2FA%3E%3CBR%20%2F%3E-%26nbsp%3B%3CA%20title%3D%22What%20is%20Traffic%20Manager%3F%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Ftraffic-manager%2Ftraffic-manager-overviewWhat%2520is%2520Traffic%2520Manager%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWhat%20is%20Traffic%20Manager%3F%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThis%20sample%20shows%20how%20you%20can%20deploy%20the%20sentiment%20analysis%20container%20to%20an%20Azure%20Container%20Instance.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Eaz%20container%20create%20%0A%20%20%20%20--resource-group%20%3CINSERT%20resource%3D%22%22%20group%3D%22%22%20name%3D%22%22%3E%20%5C%0A%20%20%20%20--name%20%3CINSERT%20container%3D%22%22%20name%3D%22%22%3E%20%5C%0A%20%20%20%20--dns-name-label%20%3CINSERT%20unique%3D%22%22%20name%3D%22%22%3E%20%5C%0A%20%20%20%20--memory%202%20--cpu%201%20%5C%0A%20%20%20%20--ports%205000%20%5C%0A%20%20%20%20--image%20mcr.microsoft.com%2Fazure-cognitive-services%2Ftextanalytics%2Fsentiment%3A3.0-en%20%5C%0A%20%20%20%20--environment-variables%20%5C%0A%20%20%20%20%20%20%20%20Eula%3Daccept%20%5C%0A%20%20%20%20%20%20%20%20Billing%3D%3CINSERT%20endpoint%3D%22%22%3E%20%20%5C%0A%20%20%20%20%20%20%20%20ApiKey%3D%3CINSERT%20apikey%3D%22%22%3E%0A%3C%2FINSERT%3E%3C%2FINSERT%3E%3C%2FINSERT%3E%3C%2FINSERT%3E%3C%2FINSERT%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1641982994%22%20id%3D%22toc-hId-1641982994%22%3E%3CSPAN%3EAzure%20App%20Service%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EAzure%20App%20Service%20is%20a%20great%20way%20to%20host%20a%20simple%20container%20solution%2C%20it%20offers%20some%20more%20out%20of%20the%20box%20functionality%20then%20Azure%20Container%20Instances.%20All%20the%20features%20from%20an%20App%20Service%20like%20Azure%20%3CA%20title%3D%22AutoScale%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Ffeatures%2Fautoscale%2F%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAutoScale%3C%2FA%3E%20are%20available%20and%20easily%20integrate%20with%20services%20like%20Azure%20Front%20Door%20and%20traffic%20manager%20to%20perform%20traffic%20routing%20and%20load-balancing.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EApp%20Service%20not%20only%20adds%20the%20power%20of%20Microsoft%20Azure%20to%20your%20application%2C%20such%20as%20security%2C%20load%20balancing%2C%20autoscaling%2C%20and%20automated%20management.%20You%20can%20also%20take%20advantage%20of%20its%20DevOps%20capabilities%2C%20such%20as%20continuous%20deployment%20from%20Azure%20DevOps%2C%20GitHub%2C%20Docker%20Hub%2C%20and%20other%20sources%2C%20package%20management%2C%20staging%20environments%2C%20custom%20domain%2C%20and%20TLS%2FSSL%20certificates.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAzure%20App%20Service%20for%20your%20containerized%20solutions%20is%20great%20if%20you%20are%20looking%20for%20easy%20to%20use%20service%20that%20automatically%20scales%20when%20traffic%20increases%20and%20integrates%20with%20other%20Azure%20Services%20for%20traffic%20management%20like%20Traffic%20Manager%20and%20Azure%20Frontdoor.%3CEM%3E%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSTRONG%3ERead%20more%20about%20Azure%20App%20Service%20on%20Microsoft%20Docs%20and%20Azure.com.%3C%2FSTRONG%3E%3CBR%20%2F%3E-%20%3CA%20title%3D%22App%20Service%20documentation%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fapp-service%2F%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EApp%20Service%20documentation%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E-%26nbsp%3B%3CA%20title%3D%22Web%20App%20for%20Containers%22%20href%3D%22https%3A%2F%2Fazure.microsoft.comservices%2Fapp-service%2Fcontainers%2F%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EWeb%20App%20for%20Containers%3C%2FA%3E%3CEM%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThis%20sample%20shows%20how%20you%20can%20deploy%20the%20sentiment%20analysis%20container%20to%20an%20Azure%20App%20Service%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3E%23%20Create%20an%20App%20Service%0Aaz%20appservice%20plan%20create%20%0A%20%20%20--name%20%3CAPP-NAME%3E%20%0A%20%20%20--resource-group%20demo_rg%20%0A%20%20%20--sku%20S1%20--is-linux%0A%0A%23%20Create%20the%20webapp%20with%20the%20private%20container%20(Deployment%20can%20take%20a%20while)%0Aaz%20webapp%20create%20%0A%20%20--name%20%3CWEBAPP-NAME%3E%0A%20%20--plan%20%3CAPP-NAME%3E%20%20%20%0A%20%20--resource-group%20demo_rg%20%20%0A%20%20-i%20%3CREGISTRYNAME%3E.azurecr.io%2F%3CYOUR-IMAGE-NAME%3E%0A%0Acurl%20-X%20POST%20%22http%3A%2F%2F%3CWEBAPP-NAME%3E.azurewebsites.net%2Ftext%2Fanalytics%2Fv3.0%2Fsentiment%22%20%0A-H%20%22Content-Type%3A%20application%2Fjson%22%20%0A-d%20%22%7B%5C%22documents%5C%22%3A%5B%7B%5C%22language%5C%22%3A%5C%22en%5C%22%2C%5C%22id%5C%22%3A%5C%221-en%5C%22%2C%5C%22text%5C%22%3A%5C%22Hello%20beautiful%20world.%5C%22%7D%5D%7D%22%0A%3C%2FWEBAPP-NAME%3E%3C%2FYOUR-IMAGE-NAME%3E%3C%2FREGISTRYNAME%3E%3C%2FAPP-NAME%3E%3C%2FWEBAPP-NAME%3E%3C%2FAPP-NAME%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20options%20above%20are%20the%20quickest%20way%20to%20get%20started%20with%20containers%20on%20Azure.%20But%20some%20solutions%20require%20advanced%20orchestration%20or%20need%20to%20be%20able%20to%20run%20on%20edge%20devices%20in%20disconnected%20scenarios.%20For%20this%20scenarios%20Azure%20offers%20Azure%20Kubernetes%20Services%20and%20IoT%20Edge.%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--165471469%22%20id%3D%22toc-hId--165471469%22%3E%3CSPAN%3EAzure%20Kubernetes%20Services%20%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EDeploy%20and%20manage%20containerized%20applications%20more%20easily%20with%20a%20fully%20managed%20Kubernetes%20service.%20Azure%20Kubernetes%20Service%20(AKS)%20offers%20serverless%20Kubernetes%2C%20an%20integrated%20continuous%20integration%20and%20continuous%20delivery%20(CI%2FCD)%20experience%2C%20and%20enterprise-grade%20security%20and%20governance.%20Unite%20your%20development%20and%20operations%20teams%20on%20a%20single%20platform%20to%20rapidly%20build%2C%20deliver%2C%20and%20scale%20applications%20with%20confidence.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EKubernetes%20is%20a%20rapidly%20evolving%20platform%20that%20manages%20container-based%20applications%20and%20their%20associated%20networking%20and%20storage%20components.%20Kubernetes%20focuses%20on%20the%20application%20workloads%2C%20not%20the%20underlying%20infrastructure%20components.%20Kubernetes%20provides%20a%20declarative%20approach%20to%20deployments%2C%20backed%20by%20a%20robust%20set%20of%20APIs%20for%20management%20operations.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20build%20and%20run%20modern%2C%20portable%2C%20microservices-based%20applications%2C%20using%20Kubernetes%20to%20orchestrate%20and%20manage%20the%20availability%20of%20the%20application%20components.%20Kubernetes%20supports%20both%20stateless%20and%20stateful%20applications%20as%20teams%20progress%20through%20the%20adoption%20of%20microservices-based%20applications.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAs%20an%20open%20platform%2C%20Kubernetes%20allows%20you%20to%20build%20your%20applications%20with%20your%20preferred%20programming%20language%2C%20OS%2C%20libraries%2C%20or%20messaging%20bus.%20Existing%20continuous%20integration%20and%20continuous%20delivery%20(CI%2FCD)%20tools%20can%20integrate%20with%20Kubernetes%20to%20schedule%20and%20deploy%20releases.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAKS%20provides%20a%20managed%20Kubernetes%20service%20that%20reduces%20the%20complexity%20of%20deployment%20and%20core%20management%20tasks%2C%20like%20upgrade%20coordination.%20The%20Azure%20platform%20manages%20the%20AKS%20control%20plane%2C%20and%20you%20only%20pay%20for%20the%20AKS%20nodes%20that%20run%20your%20applications.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20title%3D%22Read%20more%20on%20Microsoft%20Docs%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fservices%2Fkubernetes-service%2F%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSPAN%3ERead%20more%20on%20Microsoft%20Docs%3C%2FSPAN%3E%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1972925932%22%20id%3D%22toc-hId--1972925932%22%3E%3CSPAN%3EIoT%20Edge%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3E%3CSPAN%3EAzure%20IoT%20Edge%20is%20a%20fully%20managed%20service%20built%20on%20Azure%20IoT%20Hub.%20Deploy%20your%20cloud%20workloads%E2%80%94artificial%20intelligence%2C%20Azure%20and%20third-party%20services%2C%20or%20your%20own%20business%20logic%E2%80%94to%20run%20on%20Internet%20of%20Things%20(IoT)%20edge%20devices%20via%20standard%20containers.%20By%20moving%20certain%20workloads%20to%20the%20edge%20of%20the%20network%2C%20your%20devices%20spend%20less%20time%20communicating%20with%20the%20cloud%2C%20react%20more%20quickly%20to%20local%20changes%2C%20and%20operate%20reliably%20even%20in%20extended%20offline%20periods.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAzure%20IoT%20Edge%20moves%20cloud%20analytics%20and%20custom%20business%20logic%20to%20devices%20so%20that%20your%20organization%20can%20focus%20on%20business%20insights%20instead%20of%20data%20management.%20Scale%20out%20your%20IoT%20solution%20by%20packaging%20your%20business%20logic%20into%20standard%20containers%2C%20then%20you%20can%20deploy%20those%20containers%20to%20any%20of%20your%20devices%20and%20monitor%20it%20all%20from%20the%20cloud.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAnalytics%20drives%20business%20value%20in%20IoT%20solutions%2C%20but%20not%20all%20analytics%20needs%20to%20be%20in%20the%20cloud.%20If%20you%20want%20to%20respond%20to%20emergencies%20as%20quickly%20as%20possible%2C%20you%20can%20run%20anomaly%20detection%20workloads%20at%20the%20edge.%20If%20you%20want%20to%20reduce%20bandwidth%20costs%20and%20avoid%20transferring%20terabytes%20of%20raw%20data%2C%20you%20can%20clean%20and%20aggregate%20the%20data%20locally%20then%20only%20send%20the%20insights%20to%20the%20cloud%20for%20analysis.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20you%20want%20to%20learn%20more%20about%20IoT%20Edge%20you%20can%20watch%20the%20video%20%22%3CA%20title%3D%22IoT%20ELP%20Module%203%20Adding%20Intelligence%2C%20Unlocking%20New%20Insights%20with%20AI%20%26amp%3B%20ML%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2FInternet-of-Things-Event-Learning-Path%2Ftree%2Fmain%2Fiot30%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EIoT%20ELP%20Module%203%20Adding%20Intelligence%2C%20Unlocking%20New%20Insights%20with%20AI%20%26amp%3B%20ML%3C%2FA%3E%22%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%20class%3D%22video-embed-center%20video-embed%22%3E%3CIFRAME%20class%3D%22embedly-embed%22%20src%3D%22https%3A%2F%2Fcdn.embedly.com%2Fwidgets%2Fmedia.html%3Fsrc%3Dhttps%253A%252F%252Fwww.youtube.com%252Fembed%252FdoLvCmHSKaM%253Ffeature%253Doembed%26amp%3Bdisplay_name%3DYouTube%26amp%3Burl%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DdoLvCmHSKaM%26amp%3Bimage%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252FdoLvCmHSKaM%252Fhqdefault.jpg%26amp%3Bkey%3Db0d40caa4f094c68be7c29880b16f56e%26amp%3Btype%3Dtext%252Fhtml%26amp%3Bschema%3Dyoutube%22%20width%3D%22400%22%20height%3D%22225%22%20scrolling%3D%22no%22%20title%3D%22YouTube%20embed%22%20frameborder%3D%220%22%20allow%3D%22autoplay%3B%20fullscreen%22%20allowfullscreen%3D%22true%22%3E%3C%2FIFRAME%3E%3C%2FDIV%3E%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThere%20are%20also%20other%20services%20on%20Azure%20that%20can%20run%20containers%2C%20but%20might%20need%20some%20work%20to%20get%20the%20Cognitive%20Services%20containers%20running%20on%20them%3A%3CBR%20%2F%3E-%20%3CA%20title%3D%22Azure%20Batch%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fbatch%2F%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Batch%3C%2FA%3E%3CBR%20%2F%3E-%20%3CA%20title%3D%22Azure%20Function%20App%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2F%2Fazure%2Fazure-functions%2Ffunctions-create-function-linux-custom-image%3Ftabs%3Dbash%252Cportal%26amp%3Bpivots%3Dprogramming-language-csharp%23enable-continuous-deployment-to-azure%26amp%3BWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Function%20App%3C%2FA%3E%3CBR%20%2F%3E-%20%3CA%20title%3D%22Azure%20Service%20Fabric%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fservice-fabric%2Fservice-fabric-containers-overview%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Service%20Fabric%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CA%20title%3D%22Continue%20your%20learning%20journey%20and%26nbsp%3Bget%20skilled%20up%20on%20all%20things%20Azure%20AI!%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Foverview%2Fai-platform%2Fdev-resources%2F%3FWT.mc_id%3Daiml-34112-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSPAN%3EContinue%20your%20learning%20journey%20and%26nbsp%3Bget%20skilled%20up%20on%20all%20things%20Azure%20AI!%3C%2FSPAN%3E%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2564524%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EIn%20this%20blog%20we%20are%20going%20to%20dive%20into%20the%20different%20way%20you%20can%20run%20Cognitive%20Services%20in%20a%20container%20on%20Azure.%20We%20first%20look%20at%20the%20different%20options%20on%20how%20you%20can%20run%20a%20container%20on%20Azure%20and%20secondly%2C%20we%20look%20into%20a%20few%20scenarios%20how%20you%20might%20want%20to%20run%20your%20application.%20%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2564524%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECognitive%20Services%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Jul 19 2021 11:30 PM
Updated by: