Skip to main content
This guide walks you through setting up Azure resources and deploying the VisionaryAI backend infrastructure using Azure Functions.

Prerequisites

Before you begin, ensure you have:
You can also use the Azure extension in VS Code to log in and deploy functions directly from the editor.

Create Azure resources

1

Create a resource group

Create a new resource group to organize your VisionaryAI resources:
2

Create a storage account

Create an Azure Storage account for blob storage and function app storage:
Storage account names must be between 3-24 characters, lowercase letters and numbers only, and globally unique across Azure.
3

Create a blob container

Create a container named images to store generated DALL-E images:
4

Create a Function App

Create an Azure Function App to host your serverless functions:
5

Retrieve storage credentials

Get your storage account name and key for configuration:
Save these values for the next step.

Configure environment variables

Set up the required environment variables in your Function App:
See environment variables for detailed information about each variable.

Deploy functions

1

Navigate to the Azure directory

2

Install dependencies

3

Deploy to Azure

Deploy your functions to the Function App:
The deployment process will bundle all functions and dependencies, then upload them to your Azure Function App.
4

Verify deployment

List your deployed functions:
You should see:
  • generateImage
  • generateSASToken
  • getChatGPTSuggestion
  • getImages

Test your deployment

Once deployed, test your functions using the Azure Portal or CLI:
Test the suggestion endpoint:

Update your Next.js configuration

Update your Next.js application to use the deployed Azure Functions:

Monitor your functions

View logs and monitor function execution in the Azure Portal:
  1. Navigate to your Function App
  2. Select Monitor > Logs
  3. Enable Application Insights for detailed telemetry
Application Insights is configured in host.json with sampling enabled to reduce costs while maintaining visibility.

Next steps