DEV Community

Jane for Mastering Backend

Posted on • Originally published at blog.masteringbackend.com

How to Create an Azure OpenAI Resource and Deploy Your First Model.

How to Create an Azure OpenAI Resource and Deploy Your First Model

Azure OpenAI allows developers to use powerful AI models such as GPT-4, GPT-4o, and GPT-3.5 directly from the Azure cloud. These models can be used to build chatbots, AI assistants, content generators, and many intelligent applications.

In this article, you will learn how to create an Azure OpenAI resource, deploy a model, and get the API key required to use the service in your application.

Prerequisites

Before starting, make sure you have:

  • An Azure account

  • Access to the Azure Portal

  • Azure OpenAI service is enabled for your subscription

If you do not have an Azure account, you can create one from the Azure website.

Step 1: Create Azure OpenAI Resource

First, you need to create an Azure OpenAI resource.

Open the Azure Portal:

https://portal.azure.com

Steps

  1. Login to the Azure Portal.

  2. In the search bar, type Azure OpenAI.

  3. Click Create.

Now fill the required fields.

Configuration

Resource Group

Create a new resource group or select an existing one.

Region

Choose a supported region such as:

  • East US

  • Sweden Central

Name

Enter a unique resource name.

Example:

openai-demo
Enter fullscreen mode Exit fullscreen mode

Use our Online Code Editor

Pricing Tier

Select Standard.

After filling the details:

Click Review + Create

Then click Create to deploy the resource.

Deployment usually takes around one to two minutes.

Step 2: Deploy a Model

Once the resource is created, you need to deploy a model.

Steps

  1. Open the Azure OpenAI resource you created.

  2. In the left menu, click Model Deployments.

  3. Click Deploy Model.

Now select a model.

Recommended Models

For most applications, these models work well:

gpt-4o-mini

Fast and cost efficient model.

gpt-35-turbo

Popular chat model.

Deployment Configuration

Model

Select the model you want.

Deployment Name

Example:

gpt-4o-mini
Enter fullscreen mode Exit fullscreen mode

Use our Online Code Editor

Click Deploy.

Azure will now create the model deployment.

Step 3: Get API Credentials

To call the Azure OpenAI API from your application, you need an API key and endpoint.

Steps

  1. Open the Azure OpenAI resource.

  2. Click Keys and Endpoint.

You will see the following information.

API Key 1

API Key 2

Endpoint

Example:

API KEY
xxxxxxxxxxxxxxxxxxxxxxxx

ENDPOINT
https://openai-demo.openai.azure.com/
Enter fullscreen mode Exit fullscreen mode

Use our Online Code Editor

You can use either Key 1 or Key 2 in your application.

Example API Endpoint

Your application will send requests to the endpoint.

Example:

https://openai-demo.openai.azure.com/openai/deployments/gpt-4o-mini/chat/completions?api-version=2024-02-15-preview
Enter fullscreen mode Exit fullscreen mode

Use our Online Code Editor

Your request must include:

  • API Key

  • Endpoint

  • Deployment Name

Conclusion

Azure OpenAI makes it easy to use powerful AI models in enterprise applications. The basic process involves three steps:

  1. Create an Azure OpenAI resource

  2. Deploy a model such as gpt-4o-mini

  3. Get API credentials and endpoint

Once these steps are completed, you can start building AI-powered applications using Azure OpenAI.

Have a great one!!!

Author: Ayush Shrivastava


Thank you for being a part of the community

Before you go:

Whenever you’re ready

There are 4 ways we can help you become a great backend engineer:

  • The MB Platform: Join thousands of backend engineers learning backend engineering. Build real-world backend projects, learn from expert-vetted courses and roadmaps, track your learning and set schedules, and solve backend engineering tasks, exercises, and challenges.
  • The MB Academy: The “MB Academy” is a 6-month intensive Advanced Backend Engineering Boot Camp to produce great backend engineers.
  • Join Backend Weekly: If you like posts like this, you will absolutely enjoy our exclusive weekly newsletter, sharing exclusive backend engineering resources to help you become a great Backend Engineer.
  • Get Backend Jobs: Find over 2,000+ Tailored International Remote Backend Jobs or Reach 50,000+ backend engineers on the #1 Backend Engineering Job Board.

Top comments (0)