Azure OpenAI
Azure OpenAI is a service born out of a partnership between Microsoft and OpenAI, offering users with REST APIs to leverage large language models (LLMs) such as o1-preview, o1-mini, GPT-4o, GPT-4o mini, GPT-4 Turbo, GPT-4o audio, GPT-3.5, Embeddings, DALL-E, Whisper, and Text to speech (Preview). Azure OpenAI provides functionalities like content creation, text summarisation, code generation, semantic search, and so on, which can be seamlessly integrated into various tools and platforms using REST API, Python SDK, or Azure OpenAI Studio, with a strong emphasis on responsibility to prevent incorrect or harmful content-Responsible AI (learn more in Responsible AI Transparency Report: How we build, support our customers, and grow).
In this article, we will walk you step-by-step on how to utilise Azure OpenAI, covering everything from the first-ever account creation (for free of charge!) to deploying and employing models across different environments.
Steps to Get the Azure Free Trial Account
Upon starting with the Build in the cloud with an Azure account portal, you will encounter two service plans: Try Azure for free and the Pay-as-you-go option.
Try Azure for free: This plan provides you with $200 worth of credits usable over a 30-day period. This is perfect for experimenting with the available features. If you are interested in using the service beyond the initial credits, you have the option to upgrade to the Pay-as-you-go plan.
Pay-as-you-go: This plan operates on a usage-based billing model, making it well-suited for long-term projects. You are charged according to the amount of service you consume, offering flexibility and scalability as your needs evolve.
Here we will delve into the Try Azure for free option. After entering this portal, you will be guided to the account creation step-Your profile, as shown in the following figure:
At the Azure – Sign-up portal, fill out the profile for an Azure Free Trial Account.
Afterward, you will proceed to the Identity Verification by Card step, where credit or debit card details are required. Note that your card will not be automatically charged unless you select the Pay-as-you-go option.

Fill out the card details to complete the registration for the Azure Free Trial Account.
Subsequently, you will be directed to the Quickstart Center page, where key checklists for getting started with Azure are provided. If needed, you can explore additional resources and tutorials.

User will be guided to the Quickstart Center – Microsoft Azure.
Now that you have the Azure Free Trial Account with $200 free credits, let’s proceed with the following steps: creating a resource group, deploying the model, and utilising the model in various environments!
Creating a Resource Group
A resource group serves as a container for managing related resources within Azure solutions. There are three methods for creating resources: Portal, CLI, and PowerShell. In this article, we will focus on the Portal option (for more information on these creation methods, please refer to Create and deploy an Azure OpenAI Service resource).
To start utilising Azure OpenAI, the initial step involves creating a resource group, which will act as the cornerstone for deploying OpenAI models. In the Azure portal, begin by clicking on + Create a resource, followed by searching for Azure OpenAI.


In the Create a resource – Microsoft Azure section of the Microsoft Azure portal, select Azure OpenAI.
Within the Basics tab, input the details as illustrated in the figure below:

In the Resource group section, select Create new to establish a new resource group and assign it a name of your choice for your project. Then proceed to configure the Region, keeping in mind that model availability depends on regional options (refer to Azure OpenAI | Model summary table and region availability). For this instance, East US is selected. Afterwards, choose a Name that suits your preferences and select the appropriate Pricing tier (limited only to Standard S0).
Next, in the Network tab, there are three security types available as follows:
- Type 1: Allow access from all networks, including the internet (we will proceed with this option)
- Type 2: Permit access only from selected networks by configuring the security for your Azure AI resources
- Type 3: Disable network access entirely; in this case, private endpoint connections will be the sole method of accessing the resources

In the Network tab, select the first Type: All networks. Including the internet, can access this resource.
In the Tag section, you can create name/value pairs to categorise resources and streamline consolidated billing by applying consistent tags across multiple resources and resource groups. Note that these tags will be automatically updated if you modify resource settings on other tabs after creating tags.

In this case, the Tags option will be left blank.
You can review your configuration settings in the Review + Submit section. Select Create to confirm your settings. The Azure portal will notify you when the new resource is available, and then you can select Go to the resource.


Now that you have the Resource group, let’s go ahead to the next step: deploying a model!
Deploying a Model
In your resource group, click on Go to Azure OpenAI Studio found under the Explore and deploy section. This will take you to the homepage of Azure OpenAI Studio.

Go to the Azure OpenAI Studio button will navigate you to the Azure OpenAI Studio homepage.
Under the Model catalog option, you will find a variety of service models available (refer to the model availability in Azure OpenAI | Model summary table and region availability). For this article, we will select GPT-4o. Upon selecting the model, you will be navigated to its overview page where you then select Deploy.

Clicking the Deploy button will open a pop-up window for configuring the model. In the Deployment name tab, you can assign a custom name as desired. It is important to note that the Deployment type is preset to the default option, which is Global Standard (for further details on deployment types, refer to Azure OpenAI deployment types).

After clicking Deploy, you will be directed to the model details page.
Using the model in Different Environments
With the model now deployed, we will explore how to utilise it across various environments: Chat Playground, Python, and via API integration in this article.
Using the Model through Chat Playground
Azure OpenAI offers an intuitive interface called the Chat Playground, allowing users to interact with language models directly without requiring any coding knowledge, i.e., no code required!
On the Azure OpenAI Studio homepage, navigate to Chat Playground in the left-hand menu. The model we previously created (GPT-4o, in this instance) is selected under the Setup section.

On the right side, you will find a chat interface where users can input prompts and receive responses from the deployed model. Additionally, users have the option to pre-define how the model should behave in its responses within the Give the Model instructions and context section.
Using the Model through Python
For more advanced use cases, you can integrate GPT-4o with Python. This approach allows you to automate tasks, analyze large datasets, and more.
First, you need to install the OpenAI Python client library using the following command:

You will need to obtain the API key and Endpoint from the Azure portal. These can be found under the Keys and Endpoint in Resource Management.

To locate your keys and endpoint, first navigate to your resource group, and then search for the Resource Management section. Noted that it is possible to use either KEY 1 or KEY 2.
Next, write a Python script as follows to create a new application connected to your model. You can use your preferred text editor or integrated development environment (IDE) for this task (script adapted from Using Azure OpenAI with Python: A Step-by-Step Guide | by Elanthirayan | Medium).

If successful, the result will appear like this:

Using the Model through API
For scalable integrations, Azure OpenAI enables you to connect your model using the REST APIs. This approach is suitable for building applications and/or automating workflows.
Let’s get started by setting up environment variables for your API key and Endpoint. You can run this command using either Command Prompt (CMD) or PowerShell (Windows system, in this case):

Subsequently, an API request will be made (refer to Azure OpenAI Service | REST API)

If successful, the result will look like this:

Or, for better readability, in JSON format as follows:

Users can integrate this into their applications for automated text generation or other purposes!
Conclusion
Azure OpenAI provides a versatile suite of tools for utilising advanced AI models across various environments. Whether users want to experiment interactively through Chat Playground, integrate programmatically with Python, or larger-scale solutions via APIs, Azure OpenAI provides the flexibility needed for a range of AI-driven applications. With the Azure Free Trial Account, users can explore these options without commitment. From content creation and code generation to semantic search, Azure OpenAI simplifies the journey of adopting AI while promoting responsible and ethical practices through its Responsible AI framework!
Subscribe for more useful articles on data and AI!
[hubspot type=”form” portal=”47406981″ id=”244b28eb-5322-4f57-80ff-1745ac75313c”]

