This Microsoft Azure OpenAI article will show how to deploy Azure OpenAI GPT-4o Resource and Model using Bice.
Azure OpenAI is a Microsoft implementation of the popular OpenAI service and AI models. Using Azure OpenAI, companies can use OpenAI’s LLMs with Azure infrastructure, tools, and security and compliance services. It also offers seamless integration with other Azure services.
GPT-4o is OpenAI’s latest AI Model. It offers an integrated AI model with audio, text, and visual capabilities using a single API service.
At CPI, we help companies deploy, develop, and manage AI applications. One of our tasks is deploying AI Services like Vision and GPT-4o. Since we are a Microsoft partner, our preferred infrastructure deployment method is Bicep. Bicep offers many advantages over Terraform, including access to the latest Azure API version.
Install Bicep
Before using Bicep, we need to install the tool. If you are using Azure CLI, the tool is already included with the latest Azure CLI version. If you prefer Azure PowerShell, use the following command (on Windows) to install Bicep.
winget install -e --id Microsoft.Bicep
Connect to Azure
After installing Bicep, connect to Microsoft Azure using the following Azure PowerShell cmdlet.
Connect-AzAccount -UseDeviceAuthentication
Create Resource Group
Since the scope of our deployment is at the Resource Group level, we need to create a resource group using the following cmdlet.
New-AzResourceGroup -Name CPIOpenAI -Location eastus
Create Bicep Template
The following Bicep template (main.bicep) will deploy an AI resource and a model. The model will be the latest GPT-4o model (2024-05-13).
resource openai 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: 'CPIOpenAI'
location: 'eastus'
sku: {
name: 'S0'
}
kind: 'OpenAI'
properties: {
}
}
resource openaideployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = {
name: 'gpt'
sku: {
name: 'Standard'
capacity: 1
}
parent: openai
properties: {
model: {
name: 'gpt-4o'
format: 'OpenAI'
version: '2024-05-13'
}
raiPolicyName: 'Microsoft.Default'
versionUpgradeOption: 'OnceCurrentVersionExpired'
}
}
Save the template.
Deploy Azure OpenAI GPT-4o Resource and Model using Bicep
To deploy the model, run the following Azure PowerShell cmdlet. In the cmdlet, change the resource group name to your resource group’s name.
New-AzResourceGroupDeployment -ResourceGroupName "CPIOpenAI" -TemplateFile .\main.bicep
Once the deployment is completed, you can use the Azure OpenAI studio portal to review the deployed model under the deployment section.
![](https://cloudproin-e5ddd09d0f1b51fcfd2f-endpoint.azureedge.net/blobcloudproinf8788b00c9/wp-content/uploads/2024/07/image-26.png)
Trackbacks/Pingbacks