You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: notebooks/GenAI/azure_infra_setup/README.md
+83-15Lines changed: 83 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,77 @@
1
-
# Setting Up Azure Environment for Azure GenAI Cloud Lab
2
-
3
-
Welcome! This guide will help you set up your Azure environment to complete the activities in the [Azure GenAI](../) directory of the NIH Cloud Lab. We will walk you through the steps required to configure PowerShell, deploy necessary resources using an ARM template, upload local files to Azure Storage Account, and acquire keys and secrets for `.env` variables.
4
-
5
-
## Prerequisites
1
+
# Setting Up Azure Environment for Azure GenAI Cloud Lab
2
+
3
+
This guide will help you set up your Azure environment to complete the activities in the [GenAI](../) directory of the NIH Cloud Lab.
4
+
The purpose of this guide is to walk you through an automated deployment of the resources needed to carry out these activities.
5
+
This automated approach utilizes a pre-built [ARM template](arm_resources.json) file, which serves as an alternative approach
6
+
to manually deploying and configuring resources via the Azure portal.
- Step-by-step instructions to set up and configure PowerShell and Azure CLI for the neccessary Azure resource deployments.
20
+
2. Deploy Resources Using an ARM Template
21
+
- Detailed guidance on deploying the necessary resources in Azure using an ARM template for the [GenAI](../) directory.
22
+
3. Upload Local Files to Azure Storage Account
23
+
- Instructions on how to upload files from the [search_documents](../search_documents/) directory to an Azure Storage Account Blob container.
24
+
4. Acquire Keys and Secrets for .env Variables
25
+
- Steps to obtain keys and secrets from deployed resources and use them in your .env files for the tutorials in the [GenAI](../) directory.
26
+
27
+
## Prerequisites <aname="prerequisites"></a>
6
28
7
29
- An active Azure subscription
8
30
- PowerShell installed on your machine (option 1)
9
31
- Azure CLI installed (option 2)
32
+
33
+
### Powershell (option 1) vs. Azure CLI (option 2)
34
+
35
+
Choosing between Azure CLI and PowerShell comes down to personal preference and the working environment:
36
+
37
+
-**Cloud Environments**: For users working in the cloud, such as with Azure Machine Learning or Azure VMs, Azure CLI may be a more suitable option.
38
+
-***Note***: If users are utilizing any of these environments, please skip Step 1 and move directly to Step 2 using Azure CLI (option 2).
39
+
-**Local Environments**: For users working on a local machine, both Azure CLI and PowerShell are viable options. The choice depends on personal preference.
40
+
-***Note***: If users are utilizing Azure CLI, please skip Step 1 and move directly to Step 2.
41
+
42
+
## Resources and Pricing <aname="resources_and_pricing"></a>
43
+
44
+
Provided is a list of resources that will be deployed by the provided ARM template along with the estimated cost breakdown for each resource.
45
+
***An ARM Template is a JSON file that defines the infrastructure and configuration for your Azure project***. It allows you to deploy, manage, and configure
46
+
all the resources for your solution in a single, coordinated operation. When executing the provided ARM template, actual costs may vary depending on usage
47
+
and the Azure pricing model for each resource. Please find the resources that will be deployed below.
-**Purpose**: This resource is used to store and manage files from [search_documents](../search_documents/) in a single container.
53
+
-**Estimated Cost**: $0.018 per GB/$18.40 per 1000 GB per month
54
+
55
+
2.**Azure AI Search**
56
+
-**Resource Type**: Cognitive Search (Basic)
57
+
-**Purpose**: This resource provides AI search capabilities for the GenAI tutorials, including indexing and querying.
58
+
-**Estimated Cost**: $0.10 per hour/$73.73 per month
59
+
60
+
3.**Azure OpenAI**
61
+
-**Resource Type**: Cognitive Services (Standard)
62
+
-**Purpose**: This resource provides access to OpenAI models, including GPT-4 and embeddings for AI processing.
63
+
-**Models Deployed**:
64
+
-**Model**: gpt-4o-mini
65
+
-**Version**: 2024-07-18
66
+
-**Cost per 1M Tokens**: $0.15 input/$0.60 output
67
+
-**Model**: text-embedding-3-small
68
+
-**Version**: 1
69
+
-**Cost per 1K Tokens**: $0.00002
70
+
-**Estimated Cost**: Varies based on model usage and API calls. Please refer to [Azure OpenAI Service Pricing](https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/?msockid=3df6a53ac4916aa73e41b1e3c5c36bd4) for more details.
10
71
11
-
## Steps
72
+
Please refer to the [Azure Pricing Calculator](https://azure.microsoft.com/en-us/pricing/calculator/) for a more detailed and personalized estimate based on your specific usage patterns and region.
73
+
74
+
## Get Started <aname="get_started"></a>
12
75
13
76
### 1. Setting Up the Azure Module in PowerShell
14
77
@@ -17,9 +80,6 @@ First, you need to install the Azure module in PowerShell to connect to your Azu
17
80
```powershell
18
81
# Install the Az module (if using PowerShell)
19
82
Install-Module -Name Az -AllowClobber -Force
20
-
21
-
# Import the Az module (if using Azure CLI)
22
-
Import-Module Az
23
83
```
24
84
25
85
### 2. Logging into Azure
@@ -32,7 +92,7 @@ You can log into your Azure account either using PowerShell or Azure CLI.
32
92
Connect-AzAccount
33
93
```
34
94
**Using Azure CLI**
35
-
```powershell
95
+
```bash
36
96
# Log into your Azure account
37
97
az login
38
98
```
@@ -83,7 +143,7 @@ az group create --name $resourceGroupName --location $location
83
143
84
144
### 5. Deploying the ARM Template
85
145
86
-
Deploy the [ARM template](/notebooks/GenAI/azure_infra_setup/arm_resources.json) to create the Azure Storage Account, Azure AI Search, and Azure OpenAI resources.
146
+
Deploy the [ARM template](arm_resources.json) to create the Azure Storage Account, Azure AI Search, and Azure OpenAI resources.
87
147
88
148
***Using PowerShell***
89
149
```powershell
@@ -123,7 +183,11 @@ done
123
183
124
184
### 7. Retrieving API Keys
125
185
126
-
Retrieve the API keys for each service created by the ARM template deployment. These secrets are confidential and should be handled appropriately. Once the output is received, the values will be added to your `.env` file, which should be created in the ./notebooks/GenAI directory. Note that this `.env` file is already added to the `.gitignore`.
186
+
Retrieve the API keys for each service created by the ARM template deployment. These secrets are confidential and should be handled appropriately.
187
+
Once the output is received, the values should be added to your `.env` file, which should be created in the [GenAI](../) directory.
188
+
Note that this `.env` file is already added to the `.gitignore` file, which tells Git which files or directories to ignore in a project,
189
+
preventing them from being tracked or included in version control. Adding `.env` to `.gitignore` is crucial because it prevents sensitive information
190
+
like API keys and passwords from being exposed in your version control system.
127
191
128
192
**Azure Storage Account**
129
193
@@ -221,14 +285,18 @@ AZURE_SEARCH_ADMIN_KEY = "Your Azure AI Search API key"
221
285
BLOB_CONTAINER_NAME = "Your Azure Blob Container name hosting files from /search_documents"
Congratulations on completing the Azure setup! During this process, we established a new resource group dedicated to the NIH Cloud Lab environment and configured three Azure resources in your tenant using an ARM template file. The resources include:
290
+
Congratulations on completing the Azure setup! During this process, we established a new resource group dedicated to the NIH Cloud Lab environment and
291
+
configured three Azure resources in your tenant using an ARM template file. The resources include:
227
292
228
293
- An Azure Storage Account with a deployed Blob container and files uploaded from `../search_documents`
229
294
- Azure AI Search
230
295
- Azure OpenAI with deployed `gpt-4o-mini` and `text-embedding-3-small` models
231
296
232
297
Additionally, we configured `.env` variables in your local `.env` file, which is added to `.gitignore` by default.
233
298
234
-
You are now ready to proceed with the GenAI activities in the NIH Cloud Lab.
299
+
You are now ready to proceed with the GenAI tutorials!
300
+
301
+
## Clean Up <aname="clean_up"></a>
302
+
No clean up neccessary, as the created resources will be used for tutorials found in [GenAI](../).
Copy file name to clipboardExpand all lines: notebooks/GenAI/embedding_demos/Demo_Suite.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,8 @@ def main():
15
15
st.title("Azure OpenAI RAG Demo Suite")
16
16
st.markdown("### Demo Overviews")
17
17
st.write("""
18
-
Welcome to the Azure OpenAI RAG Demo Suite. On the left side-panel, you will find various demonstrations that showcase the capabilities of Azure OpenAI with a Streamlit frontend. Each demonstration is described in detail below, highlighting their unique features and functionalities.
18
+
Welcome to the Azure OpenAI RAG Demo Suite. On the left side-panel, you will find various demonstrations that showcase the capabilities
19
+
of Azure OpenAI with a Streamlit frontend. Each demonstration is described in detail below, highlighting their unique features and functionalities.
19
20
""")
20
21
21
22
# Horizontal divider
@@ -24,7 +25,7 @@ def main():
24
25
# Chat with Your Data section
25
26
st.markdown("### Generate & Search with Azure OpenAI & Azure AI Search (AI Search Query)")
26
27
st.write("""
27
-
This demo provides an interactive platform for users to manage documents stored in their Azure Blob Container.
28
+
This demo provides an interactive platform for users to chat over documents stored in their Azure Blob Container.
28
29
This is accomplished by indexing the documents in Azure AI Search and employing a combination of semantic and vector search techniques.
29
30
In this demo, we concentrate on real documents that are housed in an Azure Blob Container.
30
31
These documents undergo a process of chunking, after which embeddings from these chunks are stored in Azure AI Search, serving as our vector database.
0 commit comments