Azure OpenAI Service (ChatGPT, GPT-4, embeddings, etc.)
- Steps:
- Go to Azure Portal.
- Create a resource → search for Azure OpenAI → select Create.
- Choose region, pricing tier, and resource group.
- Once deployed, go to the resource → Keys and Endpoint.
- Use the REST API or SDK (Python, C#, JavaScript) to send prompts and receive responses.
- Secure access with Azure Entra ID and role-based access control (RBAC).
- Common use cases: chatbots, text summarization, code generation, semantic search.
2. Azure AI Services (prebuilt APIs)
- These are “ready-made” AI APIs you can call without training models.
- Categories include:
- Vision (image recognition, OCR, face detection).
- Language (translation, sentiment analysis, summarization).
- Speech (text-to-speech, speech-to-text, translation).
- Decision (anomaly detection, personalizers).
- Steps:
- In the Azure portal, search for Azure AI Services.
- Create a multi-service resource or a single API (e.g., Language Service).
- Copy endpoint & keys → call via REST or SDK.
3. Azure Machine Learning (custom AI models)
If you want to train your own ML/AI models:
- Steps:
- Create an Azure Machine Learning workspace in the portal.
- Configure compute resources (CPU/GPU clusters).
- Upload or connect your dataset.
- Use:
- AutoML → automatically trains models.
- Designer (drag-and-drop) → no-code model training.
- Notebooks (Python, R) → full control over ML pipelines.
- Deploy the trained model as a web service in Azure (real-time or batch).
- Integrations: works with Azure Data Lake, Databricks, Synapse.
4. AI Orchestration & Security
- Use Azure AI Studio to combine OpenAI + search + your data.
- Secure with:
- Azure Entra ID (authentication).
- Private Endpoints (network security).
- Managed Identities (avoid hardcoding keys).
- Monitor with Azure Monitor + Application Insights.
✅ Quick Example – Calling Azure OpenAI in Python
import openai
openai.api_key = "YOUR_KEY"
openai.api_base = "https://YOUR-RESOURCE-NAME.openai.azure.com/"
openai.api_type = "azure"
openai.api_version = "2023-05-15"
response = openai.ChatCompletion.create(
engine="gpt-4",
messages=[{"role":"system","content":"You are an assistant."},
{"role":"user","content":"Summarize Azure AI services."}]
)
print(response['choices'][0]['message']['content'])