Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 8d01c14

Browse files
authored
Merge pull request #68 from vsingh55/fix/clarify-aci-foundry-lab4-instructions
Fix #65: Clarify lab instructions for Azure Container Instance deployment and add Azure CLI example for reliable setup
2 parents ba367f0 + fb52580 commit 8d01c14

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

Instructions/Exercises/ai-foundry/04-use-a-container.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,61 @@ Many commonly used Azure AI services APIs are available in container images. For
110110
111111
4. Verify that the command returns a JSON document containing information about the sentiment detected in the two input documents (which should be postive and negative, in that order).
112112
113+
## Troubleshooting
114+
115+
> **Note:**
116+
> Seeing your container as "Running" in the Azure Portal does **not** always mean it is ready to process requests. If you try to use `curl` and get errors like:
117+
>
118+
> ```text
119+
> curl: (52) Empty reply from server
120+
> curl: (56) Recv failure: Connection reset by peer
121+
> ```
122+
>
123+
> This may mean the container has not been started with the correct parameters or environment, or is missing model files or internet access for model download.
124+
125+
### Alternative: Deploying the Container using Azure CLI
126+
127+
You can try the following command (replace the `rg-name`, `container-name`, `ApiKey` and `Billing` endpoint with your values):
128+
129+
```bash
130+
az container create \
131+
--resource-group <rg-name> \
132+
--name <container-name> \
133+
--image mcr.microsoft.com/azure-cognitive-services/sentiment \
134+
--ports 5000 \
135+
--dns-name-label ai102sentimentdemo \
136+
--environment-variables Eula=accept \
137+
--secure-environment-variables ApiKey=<your_api_key> Billing=<your_billing_endpoint> \
138+
--cpu 2 --memory 4 \
139+
--os-type Linux
140+
```
141+
After deployment, you can test the endpoint (replace <ACI_IP> as appropriate):
142+
```bash
143+
curl -X POST "http://<ACI_IP>:5000/text/analytics/v3.0/sentiment?model-version=latest" \
144+
-H "Content-Type: application/json" \
145+
-d '{
146+
"documents": [
147+
{
148+
"id": "1-en",
149+
"language": "en",
150+
"text": "The performance was amazing! The sound could have been clearer."
151+
},
152+
{
153+
"id": "2-en",
154+
"language": "en",
155+
"text": "The food and service were unacceptable. While the host was nice, the waiter was rude and food was cold."
156+
}
157+
]
158+
}'
159+
```
160+
**Try it**:
161+
162+
If v3.1 endpoints do not work, try using v3.0 or v3.1-preview.1 with above cmd.
163+
164+
Always check the /status endpoint and container logs for model loading messages (look for: Model loaded from /input/TextAnalytics/v3.x/Sentiment).
165+
166+
If you still encounter issues, running the container locally with Docker may help to diagnose local vs. cloud issues.
167+
113168
## Clean Up
114169

115170
If you've finished experimenting with your container instance, you should delete it.

0 commit comments

Comments
 (0)