How to use Cognitive Services and containers

Published Feb 08 2021 03:30 PM 3,740 Views
Microsoft

In this blog we are going to take a look at how we can run a selection of Cognitive Services in Docker compatible containers. This option of using these services can come in handy if you run into scenarios where your application can not connect to the cloud all the time or if you need more control over your data.

 


What are Cognitive Services

Azure Cognitive Services are cloud-based services that expose AI models through a REST API. These services enable you to add cognitive features, like object detection and speech recognition to your applications without having data science skills. By using the provided SDKs in the programming language of your choice you can create application that can see (Computer Vision), hear (Speech), speak (Speech), understand (Language), and even make decisions (Decision).

Cognitive Services in containers

Azure Cognitive Service in containers gives developers the flexibility in where to deploy and host the services that come with Docker containers and keeping the same API experience as when they where hosted in the Azure.

Using these containers gives you the flexibility to bring Cognitive Services closer to your data for compliance, security or other operational reasons.

 

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.


When to use Cognitive Services in containers?

Running Cognitive Services in containers can be the solution for you if you have specific requirements or constraints making that make it impossible to run Cognitive services in Azure. The most common scenarios include connectivity and control over the data. If you are running Cognitive Services in Azure all the infrastructure is taken care of, running them in containers moves the infrastructure responsibility, like performance and updating the container, to you.


A case where you choose for container could be, if your connection to Azure is not stable enough. For instance if you have 1000's of document on-prem and you want to run OCR. If you use the Computer Vision OCR endpoint in the cloud you would need to send all the documents to the end point in azure, while if you run the container locally you only need to send the billing information every 15 minutes to Azure.

Features and benefits

Immutable infrastructure: Enable DevOps teams' to leverage a consistent and reliable set of known system parameters, while being able to adapt to change. Containers provide the flexibility to pivot within a predictable ecosystem and avoid configuration drift.

Control over data: Choose where your data gets processed by Cognitive Services. This can be essential if you can't send data to the cloud but need access to Cognitive Services APIs. Support consistency in hybrid environments – across data, management, identity, and security.

Control over model updates: Flexibility in versioning and updating of models deployed in their solutions. Portable architecture: Enables the creation of a portable application architecture that can be deployed on Azure, on-premises and the edge. Containers can be deployed directly to Azure Kubernetes Service, Azure Container Instances, or to a Kubernetes cluster deployed to Azure Stack. For more information, see Deploy Kubernetes to Azure Stack.

High throughput / low latency: Provide customers the ability to scale for high throughput and low latency requirements by enabling Cognitive Services to run physically close to their application logic and data. Containers do not cap transactions per second (TPS) and can be made to scale both up and out to handle demand if you provide the necessary hardware resources.

Scalability: With the ever growing popularity of containerization and container orchestration software, such as Kubernetes; scalability is at the forefront of technological advancements. Building on a scalable cluster foundation, application development caters to high availability.

 

Which services are available

Container support is currently available for a subset of Azure Cognitive Services, including parts of:

Group Service Documentation
Anomaly Detector Anomaly Detector Documentation
Computer Vision Read OCR (Optical Character Recognition) Documentation
  Spatial Analysis Documentation
Form Recognizer Form Recognizer Documentation
Language Understanding Language Understanding Documentation
Speech Custom Speech-to-text Documentation
  Custom Text-to-speech Documentation
  Speech-to-text Documentation
  Text-to-speech Documentation
  Neural Text-to-speech Documentation
  Speech language detection Documentation
Text Analytics Key Phrase Extraction Documentation
  Text language detection Documentation
  Sentiment analysis Documentation
Face Face Documentation


How to use Cognitive Services in containers

The use of the services in containers is exactly the same as if you would use them in Azure. The deployment of the container is the part that takes a bit of planning and research. The services are shipped in Docker Containers. This means that the containers can be deployed to any Docker compatible platform. This can be your local machine running Docker Desktop or a fully scalable Kubernetes installation in your on premise data center.

Generic workflow

  • Create the resource in Azure
  • Get the endpoint
  • Retrieve the API Key
  • Find the container for the service
  • Deploy the container
  • Use the container endpoint as you would use the API resource

Optional you can mount your own storage and connect Application Insights.

Tutorial: Run a Text to Speech container in an Azure Container Instance.

In this tutorial we are going to run a Cognitive Service Speech container in an Azure Container Instance and use the REST API to convert text into speech.

To run the code below you need an Azure Subscription. if you don’t have an Azure subscription you can get $200 credit for the first month. And have the Azure command-line interface installed. If you don't have the Azure CLI installed follow this tutorial.


1. Create a resource group

Everything in Azure always start with creating a Resource Group. A resource group is a resource that holds related resources for an Azure solution.

To create a resource group using the CLI you have to specify 2 parameters, the name of the group and the location where this group is deployed.

az group create --name demo_rg --location westeurope


2. Create Cognitive Service resource

The next resource that needs to be created is a Cognitive Services. To create this resource we need to specify a few parameters. Besides the name and resource group, you need to specify the kind of cognitive service you want to create. For our tutorial we are creating a 'SpeechServices' service.

az cognitiveservices account create \
    --name speech-resource \
    --resource-group demo_rg \
    --kind SpeechServices \
    --sku F0 \
    --location westeurope \
    --yes


3. Get the endpoint & API Key

If step 1 and 2 are successfully deployed we can extract the properties we need for when we are going to run the container in the next step. The 2 properties we need are the endpoint URL and the API key. The speech service in the container is using these properties to connect to Azure every 15 minutes to send the billing information.

To retrieve endpoint:

az cognitiveservices account show --name speech-resource --resource-group demo_rg  --query properties.endpoint -o json


To retrieve the API keys:

az cognitiveservices account keys list --name speech-resource --resource-group demo_rg


3. Deploy the container in an ACI

One of the easiest ways to run a container is to use Azure Container Instances. With one command in the Azure CLI you can deploy a container and make it accessible for the everyone.

To create an ACI it take a few parameters. If you want your ACI to be accessible from the internet you need to specify the parameter: '--dns-name-label'. The URL for the ACI will look like this: http://{dns-name-label}.{region}.azurecontainer. The dns-name-label property needs to be unique.

az container create 
    --resource-group demo_rg \
    --name speechcontainer \
    --dns-name-label <insert unique name> \
    --memory 2 --cpu 1 \
    --ports 5000 \
    --image mcr.microsoft.com/azure-cognitive-services/speechservices/text-to-speech:latest \
    --environment-variables \
        Eula=accept 
        Billing=<insert endpoint> 
        ApiKey=<insert apikey>

The deployment of the container takes a few minutes.

4. Validate that a container is running

The easiest way to validate if the container is running, is to use a browser and open the container homepage. To do this you first need to retrieve the URL for the container. This can be done using the Azure CLI with the following command.

az container show --name speechcontainer --resource-group demo_rg --query ipAddress.fqdn -o json

Navigate to the URL on port 5000. The URL should look like this: http://{dns-name-label}.{region}.azurecontainer.io:5000/

If everything went well you should see a screen like this:
container_is_running

5. Submit your first task

The Text to Speech service in the container is a REST endpoint. To use it we would need to create a POST request. There are many ways to do a POST request. For our tutorial we are going to use Visual Studio Code to do this.

Requirements:


If you have the Visual Studio Code with th REST Client installed create a file call: rest.http and copy past the code below in the file.

POST http://<dns-name-label>.<region>.azurecontainer.io:5000/speech/synthesize/cognitiveservices/v1  HTTP/1.1
Content-Type: application/ssml+xml
X-Microsoft-OutputFormat: riff-24khz-16bit-mono-pcm
Accept: audio/*

<speak version="1.0" xml:lang="en-US">
    <voice name="en-US-AriaRUS">
        The future we invent is a choice we make. 
        Not something that just happens.
    </voice>
</speak>
  • Change the name of the URL to the URL of your ACI.
  • Next click on the Send Request link (just above the URL)

On the right side of VS Code you should see the response of the API. In the top right corner you see "Save Response Body" click on the button and save the response as a .wav file. Now you can use any media player to play the response.

 

vscode_api_response

 

Learn more

Microsoft Learn

Microsoft Learn is a free, online training platform that provides interactive learning for Microsoft products and more.


For this blog we have created a custom Collection of Learn Modules covering all the topics in depth.

Blogs and articles


On Microsoft Docs

 

%3CLINGO-SUB%20id%3D%22lingo-sub-2113684%22%20slang%3D%22en-US%22%3EHow%20to%20use%20Cognitive%20Services%20and%20containers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113684%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20this%20blog%20we%20are%20going%20to%20take%20a%20look%20at%20how%20we%20can%20run%20a%20selection%20of%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Foverview%2Fai-platform%2Fdev-resources%2F%3FOCID%3DAID3029145%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECognitive%20Services%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ein%20Docker%20compatible%20containers.%20This%20option%20of%20using%20these%20services%20can%20come%20in%20handy%20if%20you%20run%20into%20scenarios%20where%20your%20application%20can%20not%20connect%20to%20the%20cloud%20all%20the%20time%20or%20if%20you%20need%20more%20control%20over%20your%20data.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%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%252FKg4nKWDo6OQ%253Ffeature%253Doembed%26amp%3Bdisplay_name%3DYouTube%26amp%3Burl%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253DKg4nKWDo6OQ%26amp%3Bimage%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252FKg4nKWDo6OQ%252Fhqdefault.jpg%26amp%3Bkey%3Db0d40caa4f094c68be7c29880b16f56e%26amp%3Btype%3Dtext%252Fhtml%26amp%3Bschema%3Dyoutube%22%20width%3D%22200%22%20height%3D%22112%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%3CH2%20id%3D%22toc-hId--527023340%22%20id%3D%22toc-hId--526966485%22%3E%3CBR%20%2F%3E%3CA%20id%3D%22user-content-what-are-cognitive-services%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%23what-are-cognitive-services%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EWhat%20are%20Cognitive%20Services%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH2%3E%0A%3CP%3EAzure%20Cognitive%20Services%20are%20cloud-based%20services%20that%20expose%20AI%20models%20through%20a%20REST%20API.%20These%20services%20enable%20you%20to%20add%20cognitive%20features%2C%20like%20object%20detection%20and%20speech%20recognition%20to%20your%20applications%20without%20having%20data%20science%20skills.%20By%20using%20the%20provided%20SDKs%20in%20the%20programming%20language%20of%20your%20choice%20you%20can%20create%20application%20that%20can%20see%20(Computer%20Vision)%2C%20hear%20(Speech)%2C%20speak%20(Speech)%2C%20understand%20(Language)%2C%20and%20even%20make%20decisions%20(Decision).%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1960489493%22%20id%3D%22toc-hId-1960546348%22%3E%3CA%20id%3D%22user-content-cognitive-services-in-containers%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%23cognitive-services-in-containers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3ECognitive%20Services%20in%20containers%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH2%3E%0A%3CP%3EAzure%20Cognitive%20Service%20in%20containers%20gives%20developers%20the%20flexibility%20in%20where%20to%20deploy%20and%20host%20the%20services%20that%20come%20with%20Docker%20containers%20and%20keeping%20the%20same%20API%20experience%20as%20when%20they%20where%20hosted%20in%20the%20Azure.%3C%2FP%3E%0A%3CP%3EUsing%20these%20containers%20gives%20you%20the%20flexibility%20to%20bring%20Cognitive%20Services%20closer%20to%20your%20data%20for%20compliance%2C%20security%20or%20other%20operational%20reasons.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E%3CSTRONG%3EWhat%20are%20containers%3C%2FSTRONG%3E%3CBR%20%2F%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%2C%20and%20removed%20when%20no%20longer%20needed.%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%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%252Fhdfbn4Q8jbo%253Ffeature%253Doembed%26amp%3Bdisplay_name%3DYouTube%26amp%3Burl%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253Dhdfbn4Q8jbo%26amp%3Bimage%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252Fhdfbn4Q8jbo%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%3CH2%20id%3D%22toc-hId-153035030%22%20id%3D%22toc-hId-153091885%22%3E%3CBR%20%2F%3EWhen%20to%20use%20Cognitive%20Services%20in%20containers%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH2%3E%0A%3CP%3ERunning%20Cognitive%20Services%20in%20containers%20can%20be%20the%20solution%20for%20you%20if%20you%20have%20specific%20requirements%20or%20constraints%20making%20that%20make%20it%20impossible%20to%20run%20Cognitive%20services%20in%20Azure.%20The%20most%20common%20scenarios%20include%20connectivity%20and%20control%20over%20the%20data.%20If%20you%20are%20running%20Cognitive%20Services%20in%20Azure%20all%20the%20infrastructure%20is%20taken%20care%20of%2C%20running%20them%20in%20containers%20moves%20the%20infrastructure%20responsibility%2C%20like%20performance%20and%20updating%20the%20container%2C%20to%20you.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EA%20case%20where%20you%20choose%20for%20container%20could%20be%2C%20if%20your%20connection%20to%20Azure%20is%20not%20stable%20enough.%20For%20instance%20if%20you%20have%201000's%20of%20document%20on-prem%20and%20you%20want%20to%20run%20OCR.%20If%20you%20use%20the%20Computer%20Vision%20OCR%20endpoint%20in%20the%20cloud%20you%20would%20need%20to%20send%20all%20the%20documents%20to%20the%20end%20point%20in%20azure%2C%20while%20if%20you%20run%20the%20container%20locally%20you%20only%20need%20to%20send%20the%20billing%20information%20every%2015%20minutes%20to%20Azure.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-843596504%22%20id%3D%22toc-hId-843653359%22%3E%3CA%20id%3D%22user-content-features-and-benefits%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%23features-and-benefits%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EFeatures%20and%20benefits%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH3%3E%0A%3CP%3E%3CSTRONG%3EImmutable%20infrastructure%3A%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EEnable%20DevOps%20teams'%20to%20leverage%20a%20consistent%20and%20reliable%20set%20of%20known%20system%20parameters%2C%20while%20being%20able%20to%20adapt%20to%20change.%20Containers%20provide%20the%20flexibility%20to%20pivot%20within%20a%20predictable%20ecosystem%20and%20avoid%20configuration%20drift.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EControl%20over%20data%3A%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EChoose%20where%20your%20data%20gets%20processed%20by%20Cognitive%20Services.%20This%20can%20be%20essential%20if%20you%20can't%20send%20data%20to%20the%20cloud%20but%20need%20access%20to%20Cognitive%20Services%20APIs.%20Support%20consistency%20in%20hybrid%20environments%20%E2%80%93%20across%20data%2C%20management%2C%20identity%2C%20and%20security.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EControl%20over%20model%20updates%3A%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EFlexibility%20in%20versioning%20and%20updating%20of%20models%20deployed%20in%20their%20solutions.%20Portable%20architecture%3A%20Enables%20the%20creation%20of%20a%20portable%20application%20architecture%20that%20can%20be%20deployed%20on%20Azure%2C%20on-premises%20and%20the%20edge.%20Containers%20can%20be%20deployed%20directly%20to%20Azure%20Kubernetes%20Service%2C%20Azure%20Container%20Instances%2C%20or%20to%20a%20Kubernetes%20cluster%20deployed%20to%20Azure%20Stack.%20For%20more%20information%2C%20see%20Deploy%20Kubernetes%20to%20Azure%20Stack.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EHigh%20throughput%20%2F%20low%20latency%3A%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EProvide%20customers%20the%20ability%20to%20scale%20for%20high%20throughput%20and%20low%20latency%20requirements%20by%20enabling%20Cognitive%20Services%20to%20run%20physically%20close%20to%20their%20application%20logic%20and%20data.%20Containers%20do%20not%20cap%20transactions%20per%20second%20(TPS)%20and%20can%20be%20made%20to%20scale%20both%20up%20and%20out%20to%20handle%20demand%20if%20you%20provide%20the%20necessary%20hardware%20resources.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EScalability%3A%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3EWith%20the%20ever%20growing%20popularity%20of%20containerization%20and%20container%20orchestration%20software%2C%20such%20as%20Kubernetes%3B%20scalability%20is%20at%20the%20forefront%20of%20technological%20advancements.%20Building%20on%20a%20scalable%20cluster%20foundation%2C%20application%20development%20caters%20to%20high%20availability.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--963857959%22%20id%3D%22toc-hId--963801104%22%3EWhich%20services%20are%20available%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH3%3E%0A%3CP%3EContainer%20support%20is%20currently%20available%20for%20a%20subset%20of%20Azure%20Cognitive%20Services%2C%20including%20parts%20of%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTHEAD%3E%0A%3CTR%3E%0A%3CTH%3EGroup%3C%2FTH%3E%0A%3CTH%3EService%3C%2FTH%3E%0A%3CTH%3EDocumentation%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3C%2FTHEAD%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3EAnomaly%20Detector%3C%2FTD%3E%0A%3CTD%3EAnomaly%20Detector%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fanomaly-detector%2Fanomaly-detector-container-howto%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EComputer%20Vision%3C%2FTD%3E%0A%3CTD%3ERead%20OCR%20(Optical%20Character%20Recognition)%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcomputer-vision%2Fcomputer-vision-how-to-install-containers%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3ESpatial%20Analysis%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcomputer-vision%2Fspatial-analysis-container%3Ftabs%3Dazure-stack-edge%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EForm%20Recognizer%3C%2FTD%3E%0A%3CTD%3EForm%20Recognizer%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fform-recognizer%2Fform-recognizer-container-howto%3F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3ELanguage%20Understanding%3C%2FTD%3E%0A%3CTD%3ELanguage%20Understanding%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fluis%2Fluis-container-howto%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3ESpeech%3C%2FTD%3E%0A%3CTD%3ECustom%20Speech-to-text%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fspeech-service%2Fspeech-container-howto%3Ftabs%3Dcstt%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3ECustom%20Text-to-speech%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fspeech-service%2Fspeech-container-howto%3Ftabs%3Dctts%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3ESpeech-to-text%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fspeech-service%2Fspeech-container-howto%3Ftabs%3Dstt%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3EText-to-speech%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fspeech-service%2Fspeech-container-howto%3Ftabs%3Dtts%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3ENeural%20Text-to-speech%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fspeech-service%2Fspeech-container-howto%3Ftabs%3Dntts%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3ESpeech%20language%20detection%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fspeech-service%2Fspeech-container-howto%3Ftabs%3Dlid%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EText%20Analytics%3C%2FTD%3E%0A%3CTD%3EKey%20Phrase%20Extraction%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcognitive-services%2Ftext-analytics%2Fhow-tos%2Ftext-analytics-how-to-install-containers%3Ftabs%3Dkeyphrase%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3EText%20language%20detection%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Ftext-analytics%2Fhow-tos%2Ftext-analytics-how-to-install-containers%3Ftabs%3Dlanguage%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3ESentiment%20analysis%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Ftext-analytics%2Fhow-tos%2Ftext-analytics-how-to-install-containers%3Ftabs%3Dsentiment%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EFace%3C%2FTD%3E%0A%3CTD%3EFace%3C%2FTD%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fcognitive-services%2Fface%2Fface-how-to-install-containers%3F%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDocumentation%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CH2%20id%3D%22toc-hId--974361063%22%20id%3D%22toc-hId--974304208%22%3E%3CBR%20%2F%3E%3CA%20id%3D%22user-content-how-to-use-cognitive-services-in-containers%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%23how-to-use-cognitive-services-in-containers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EHow%20to%20use%20Cognitive%20Services%20in%20containers%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH2%3E%0A%3CP%3EThe%20use%20of%20the%20services%20in%20containers%20is%20exactly%20the%20same%20as%20if%20you%20would%20use%20them%20in%20Azure.%20The%20deployment%20of%20the%20container%20is%20the%20part%20that%20takes%20a%20bit%20of%20planning%20and%20research.%20The%20services%20are%20shipped%20in%20Docker%20Containers.%20This%20means%20that%20the%20containers%20can%20be%20deployed%20to%20any%20Docker%20compatible%20platform.%20This%20can%20be%20your%20local%20machine%20running%20Docker%20Desktop%20or%20a%20fully%20scalable%20Kubernetes%20installation%20in%20your%20on%20premise%20data%20center.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--283799589%22%20id%3D%22toc-hId--283742734%22%3E%3CA%20id%3D%22user-content-generic-workflow%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%23generic-workflow%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EGeneric%20workflow%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3ECreate%20the%20resource%20in%20Azure%3C%2FLI%3E%0A%3CLI%3EGet%20the%20endpoint%3C%2FLI%3E%0A%3CLI%3ERetrieve%20the%20API%20Key%3C%2FLI%3E%0A%3CLI%3EFind%20the%20container%20for%20the%20service%3C%2FLI%3E%0A%3CLI%3EDeploy%20the%20container%3C%2FLI%3E%0A%3CLI%3EUse%20the%20container%20endpoint%20as%20you%20would%20use%20the%20API%20resource%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EOptional%20you%20can%20mount%20your%20own%20storage%20and%20connect%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fazure-monitor%2Fapp%2Fapp-insights-overview%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EApplication%20Insights%3C%2FA%3E.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--294302693%22%20id%3D%22toc-hId--294245838%22%3ETutorial%3A%20Run%20a%20Text%20to%20Speech%20container%20in%20an%20Azure%20Container%20Instance.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH2%3E%0A%3CP%3EIn%20this%20tutorial%20we%20are%20going%20to%20run%20a%20Cognitive%20Service%20Speech%20container%20in%20an%20Azure%20Container%20Instance%20and%20use%20the%20REST%20API%20to%20convert%20text%20into%20speech.%3C%2FP%3E%0A%3CP%3ETo%20run%20the%20code%20below%20you%20need%20an%20Azure%20Subscription.%20if%20you%20don%E2%80%99t%20have%20an%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Ffree%2F%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20subscription%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eyou%20can%20get%20%24200%20credit%20for%20the%20first%20month.%20And%20have%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fcli%2Fazure%2Fwhat-is-azure-cli%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20command-line%20interface%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Einstalled.%20If%20you%20don't%20have%20the%20Azure%20CLI%20installed%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Finstall-azure-cli%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Efollow%20this%20tutorial%3C%2FA%3E.%3CBR%20%2F%3E%3CBR%20%2F%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%252F8KuJKlDSNwA%253Ffeature%253Doembed%26amp%3Bdisplay_name%3DYouTube%26amp%3Burl%3Dhttps%253A%252F%252Fwww.youtube.com%252Fwatch%253Fv%253D8KuJKlDSNwA%26amp%3Bimage%3Dhttps%253A%252F%252Fi.ytimg.com%252Fvi%252F8KuJKlDSNwA%252Fhqdefault.jpg%26amp%3Bkey%3Db0d40caa4f094c68be7c29880b16f56e%26amp%3Btype%3Dtext%252Fhtml%26amp%3Bschema%3Dyoutube%22%20width%3D%22200%22%20height%3D%22112%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%3CH3%20id%3D%22toc-hId-396258781%22%20id%3D%22toc-hId-396315636%22%3E%3CBR%20%2F%3E%3CA%20id%3D%22user-content-1-create-a-resource-group%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%231-create-a-resource-group%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3E1.%20Create%20a%20resource%20group%3C%2FH3%3E%0A%3CP%3EEverything%20in%20Azure%20always%20start%20with%20creating%20a%20Resource%20Group.%20A%20resource%20group%20is%20a%20resource%20that%20holds%20related%20resources%20for%20an%20Azure%20solution.%3C%2FP%3E%0A%3CP%3ETo%20create%20a%20resource%20group%20using%20the%20CLI%20you%20have%20to%20specify%202%20parameters%2C%20the%20name%20of%20the%20group%20and%20the%20location%20where%20this%20group%20is%20deployed.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Eaz%20group%20create%20--name%20demo_rg%20--location%20westeurope%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CH3%20id%3D%22toc-hId--1411195682%22%20id%3D%22toc-hId--1411138827%22%3E%3CBR%20%2F%3E2.%20Create%20Cognitive%20Service%20resource%3C%2FH3%3E%0A%3CP%3EThe%20next%20resource%20that%20needs%20to%20be%20created%20is%20a%20Cognitive%20Services.%20To%20create%20this%20resource%20we%20need%20to%20specify%20a%20few%20parameters.%20Besides%20the%20name%20and%20resource%20group%2C%20you%20need%20to%20specify%20the%20kind%20of%20cognitive%20service%20you%20want%20to%20create.%20For%20our%20tutorial%20we%20are%20creating%20a%20'SpeechServices'%20service.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Eaz%20cognitiveservices%20account%20create%20%5C%0A%20%20%20%20--name%20speech-resource%20%5C%0A%20%20%20%20--resource-group%20demo_rg%20%5C%0A%20%20%20%20--kind%20SpeechServices%20%5C%0A%20%20%20%20--sku%20F0%20%5C%0A%20%20%20%20--location%20westeurope%20%5C%0A%20%20%20%20--yes%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CH3%20id%3D%22toc-hId-381153672%22%20id%3D%22toc-hId-381210527%22%3E%3CBR%20%2F%3E%3CA%20id%3D%22user-content-3-get-the-endpoint--api-key%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%233-get-the-endpoint--api-key%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3E3.%20Get%20the%20endpoint%20%26amp%3B%20API%20Key%3C%2FH3%3E%0A%3CP%3EIf%20step%201%20and%202%20are%20successfully%20deployed%20we%20can%20extract%20the%20properties%20we%20need%20for%20when%20we%20are%20going%20to%20run%20the%20container%20in%20the%20next%20step.%20The%202%20properties%20we%20need%20are%20the%20endpoint%20URL%20and%20the%20API%20key.%20The%20speech%20service%20in%20the%20container%20is%20using%20these%20properties%20to%20connect%20to%20Azure%20every%2015%20minutes%20to%20send%20the%20billing%20information.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3ETo%20retrieve%20endpoint%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Eaz%20cognitiveservices%20account%20show%20--name%20speech-resource%20--resource-group%20demo_rg%20%20--query%20properties.endpoint%20-o%20json%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3ETo%20retrieve%20the%20API%20keys%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Eaz%20cognitiveservices%20account%20keys%20list%20--name%20speech-resource%20--resource-group%20demo_rg%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CH3%20id%3D%22toc-hId--1426300791%22%20id%3D%22toc-hId--1426243936%22%3E%3CBR%20%2F%3E%3CA%20id%3D%22user-content-3-deploy-the-container-in-an-aci%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%233-deploy-the-container-in-an-aci%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3E3.%20Deploy%20the%20container%20in%20an%20ACI%3C%2FH3%3E%0A%3CP%3EOne%20of%20the%20easiest%20ways%20to%20run%20a%20container%20is%20to%20use%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcontainer-instances%2F%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Container%20Instances%3C%2FA%3E.%20With%20one%20command%20in%20the%20Azure%20CLI%20you%20can%20deploy%20a%20container%20and%20make%20it%20accessible%20for%20the%20everyone.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3ETo%20create%20an%20ACI%20it%20take%20a%20few%20parameters.%20If%20you%20want%20your%20ACI%20to%20be%20accessible%20from%20the%20internet%20you%20need%20to%20specify%20the%20parameter%3A%20'--dns-name-label'.%20The%20URL%20for%20the%20ACI%20will%20look%20like%20this%3A%20http%3A%2F%2F%7Bdns-name-label%7D.%7Bregion%7D.azurecontainer.%20The%20dns-name-label%20property%20needs%20to%20be%20unique.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Eaz%20container%20create%20%0A%20%20%20%20--resource-group%20demo_rg%20%5C%0A%20%20%20%20--name%20speechcontainer%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%2Fspeechservices%2Ftext-to-speech%3Alatest%20%5C%0A%20%20%20%20--environment-variables%20%5C%0A%20%20%20%20%20%20%20%20Eula%3Daccept%20%0A%20%20%20%20%20%20%20%20Billing%3D%3CINSERT%20endpoint%3D%22%22%3E%20%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%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EThe%20deployment%20of%20the%20container%20takes%20a%20few%20minutes.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1061212042%22%20id%3D%22toc-hId-1061268897%22%3E%3CA%20id%3D%22user-content-4-validate-that-a-container-is-running%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%234-validate-that-a-container-is-running%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3E4.%20Validate%20that%20a%20container%20is%20running%3C%2FH3%3E%0A%3CP%3EThe%20easiest%20way%20to%20validate%20if%20the%20container%20is%20running%2C%20is%20to%20use%20a%20browser%20and%20open%20the%20container%20homepage.%20To%20do%20this%20you%20first%20need%20to%20retrieve%20the%20URL%20for%20the%20container.%20This%20can%20be%20done%20using%20the%20Azure%20CLI%20with%20the%20following%20command.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Eaz%20container%20show%20--name%20speechcontainer%20--resource-group%20demo_rg%20--query%20ipAddress.fqdn%20-o%20json%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3ENavigate%20to%20the%20URL%20on%20port%205000.%20The%20URL%20should%20look%20like%20this%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CEM%3E%3CA%20href%3D%22http%3A%2F%2F%7Bdns-name-label%7D.%7Bregion%7D.azurecontainer.io%3A5000%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttp%3A%2F%2F%7Bdns-name-label%7D.%7Bregion%7D.azurecontainer.io%3A5000%2F%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3EIf%20everything%20went%20well%20you%20should%20see%20a%20screen%20like%20this%3A%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22container_is_running%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F252211iD041E4C90262D356%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22container_is_running%22%20alt%3D%22container_is_running%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--746242421%22%20id%3D%22toc-hId--746185566%22%3E%3CSPAN%3E5.%26nbsp%3B%3C%2FSPAN%3ESubmit%20your%20first%20task%3C%2FH3%3E%0A%3CP%3EThe%20Text%20to%20Speech%20service%20in%20the%20container%20is%20a%20REST%20endpoint.%20To%20use%20it%20we%20would%20need%20to%20create%20a%20POST%20request.%20There%20are%20many%20ways%20to%20do%20a%20POST%20request.%20For%20our%20tutorial%20we%20are%20going%20to%20use%20Visual%20Studio%20Code%20to%20do%20this.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ERequirements%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fcode.visualstudio.com%2F%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDownload%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eand%20Install%20Visual%20Studio%20Code%3C%2FLI%3E%0A%3CLI%3EInstall%20a%20plugin%20called%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fmarketplace.visualstudio.com%2Fitems%3FitemName%3Dhumao.rest-client%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EREST%20Client%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CBR%20%2F%3EIf%20you%20have%20the%20Visual%20Studio%20Code%20with%20th%20REST%20Client%20installed%20create%20a%20file%20call%3A%20rest.http%20and%20copy%20past%20the%20code%20below%20in%20the%20file.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3EPOST%20http%3A%2F%2F%3CDNS-NAME-LABEL%3E.%3CREGION%3E.azurecontainer.io%3A5000%2Fspeech%2Fsynthesize%2Fcognitiveservices%2Fv1%20%20HTTP%2F1.1%0AContent-Type%3A%20application%2Fssml%2Bxml%0AX-Microsoft-OutputFormat%3A%20riff-24khz-16bit-mono-pcm%0AAccept%3A%20audio%2F*%0A%0A%3CSPEAK%20version%3D%221.0%22%20lang%3D%22en-US%22%3E%0A%20%20%20%20%3CVOICE%20name%3D%22en-US-AriaRUS%22%3E%0A%20%20%20%20%20%20%20%20The%20future%20we%20invent%20is%20a%20choice%20we%20make.%20%0A%20%20%20%20%20%20%20%20Not%20something%20that%20just%20happens.%0A%20%20%20%20%3C%2FVOICE%3E%0A%3C%2FSPEAK%3E%0A%3C%2FREGION%3E%3C%2FDNS-NAME-LABEL%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CUL%3E%0A%3CLI%3EChange%20the%20name%20of%20the%20URL%20to%20the%20URL%20of%20your%20ACI.%3C%2FLI%3E%0A%3CLI%3ENext%20click%20on%20the%20Send%20Request%20link%20(just%20above%20the%20URL)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EOn%20the%20right%20side%20of%20VS%20Code%20you%20should%20see%20the%20response%20of%20the%20API.%20In%20the%20top%20right%20corner%20you%20see%20%22Save%20Response%20Body%22%20click%20on%20the%20button%20and%20save%20the%20response%20as%20a%20.wav%20file.%20Now%20you%20can%20use%20any%20media%20player%20to%20play%20the%20response.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22vscode_api_response%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F252214i2C870D0807E43A24%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22vscode_api_response%22%20alt%3D%22vscode_api_response%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1612187693%22%20id%3D%22toc-hId-1612244548%22%3ELearn%20more%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20title%3D%22Get%20started%20with%20a%20free%20Azure%20Account%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Ffree%2F%3FOCID%3DAID3029145%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGet%20started%20with%20a%20free%20Azure%20Account%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-ai%2Fget-skilled-on-ai-and-ml-on-your-terms-with-azure-ai%2Fba-p%2F2103678%22%20target%3D%22_blank%22%3EGet%20skilled%20on%20AI%20and%20ML%20%E2%80%93%20on%20your%20terms%20with%20Azure%20AI%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20title%3D%22AI%20Developer%20page%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Foverview%2Fai-platform%2Fdev-resources%2F%3FOCID%3DAID3029145%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAI%20Developer%20page%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20title%3D%22Watch%20Azure%20AI%20Essentials%3A%20Easily%20add%20AI%20to%20your%20applications%22%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKg4nKWDo6OQ%26amp%3Blist%3DPLLasX02E8BPBkMW8mAyNcRxk4e3l-l_p0%26amp%3Bindex%3D2%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EWatch%20Azure%20AI%20Essentials%3A%20Easily%20add%20AI%20to%20your%20applications%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20id%3D%22toc-hId--66184051%22%20id%3D%22toc-hId--66127196%22%3E%3CA%20id%3D%22user-content-microsoft-learn%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%23microsoft-learn%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EMicrosoft%20Learn%3C%2FH3%3E%0A%3CP%3EMicrosoft%20Learn%20is%20a%20free%2C%20online%20training%20platform%20that%20provides%20interactive%20learning%20for%20Microsoft%20products%20and%20more.%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EFor%20this%20blog%20we%20have%20created%20a%20custom%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20title%3D%22Collection%20of%20Learn%20Modules%22%20href%3D%22https%3A%2F%2Faka.ms%2Fai%2Flearn%2Fcognitive-containers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECollection%20of%20Learn%20Modules%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ecovering%20all%20the%20topics%20in%20depth.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1873638514%22%20id%3D%22toc-hId--1873581659%22%3E%3CA%20id%3D%22user-content-blogs-and-articles%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%23blogs-and-articles%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EBlogs%20and%20articles%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fblog%2Fgetting-started-with-azure-cognitive-services-in-containers%2F%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EGetting%20started%20with%20Azure%20Cognitive%20Services%20in%20containers%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fblog%2Fbringing-ai-to-the-edge%2F%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EBringing%20AI%20to%20the%20edge%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fblog%2Frunning-cognitive-service-containers%2F%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERunning%20Cognitive%20Service%20containers%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20id%3D%22toc-hId-613874319%22%20id%3D%22toc-hId-613931174%22%3E%3CBR%20%2F%3E%3CA%20id%3D%22user-content-on-microsoft-docs%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fhnky%2Fblog%2Fblob%2Fmaster%2FHow-to-use-Cognitive-Services-and-containers.md%23on-microsoft-docs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EOn%20Microsoft%20Docs%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcontainers%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Cognitive%20Services%20containers%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcognitive-services-container-support%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Cognitive%20Services%20containers%20Support%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcontainers%2Fcontainer-reuse-recipe%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECreate%20containers%20for%20reuse%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcontainers%2Fazure-container-instance-recipe%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDeploy%20and%20run%20container%20on%20Azure%20Container%20Instance%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcontainers%2Fazure-kubernetes-recipe%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDeploy%20the%20Text%20Analytics%20language%20detection%20container%20to%20Azure%20Kubernetes%20Service%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcontainers%2Fdocker-compose-recipe%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EUse%20Docker%20Compose%20to%20deploy%20multiple%20containers%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fcognitive-services%2Fcontainers%2Fcontainer-faq%3FWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Cognitive%20Services%20containers%20frequently%20asked%20questions%20(FAQ)%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2113684%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20this%20blog%20we%20are%20going%20to%20take%20a%20look%20at%20how%20we%20can%20run%20a%20selection%20of%20%3CA%20title%3D%22Learn%20more%20about%20Cognitive%20Services%22%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Foverview%2Fai-platform%2Fdev-resources%2F%3FOCID%3DAID3029145%26amp%3BWT.mc_id%3Daiml-12167-heboelma%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECognitive%20Services%3C%2FA%3E%26nbsp%3Bin%20Docker%20compatible%20containers.%20This%20option%20of%20using%20these%20services%20can%20come%20in%20handy%20if%20you%20run%20into%20scenarios%20where%20your%20application%20can%20not%20connect%20to%20the%20cloud%20all%20the%20time%20or%20if%20you%20need%20more%20control%20over%20your%20data.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2113684%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:
‎Feb 10 2021 10:43 PM
Updated by: