Skip to content

Commit 2dc4d28

Browse files
authored
Update DeploymentGuide.md
1 parent 0883cd9 commit 2dc4d28

File tree

1 file changed

+0
-136
lines changed

1 file changed

+0
-136
lines changed

documentation/DeploymentGuide.md

Lines changed: 0 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -187,142 +187,6 @@ There are several ways to deploy the solution. You can deploy to run in Azure in
187187
188188
When Deployment is complete, follow steps in [Set Up Authentication in Azure App Service](../documentation/azure_app_service_auth_setup.md) to add app authentication to your web app running on Azure App Service
189189
190-
## Local Deployment
191-
To run the solution site and API backend only locally for development and debugging purposes, See the [local setup](#local-setup).
192-
193-
## Manual Azure Deployment
194-
Manual Deployment differs from the 'Quick Deploy' option in that it will install an Azure Container Registry (ACR) service, and relies on the installer to build and push the necessary containers to this ACR. This allows you to build and push your own code changes and provides a sample solution you can customize based on your requirements.
195-
196-
### Prerequisites
197-
198-
- Current Azure CLI installed
199-
You can update to the latest version using ```az upgrade```
200-
- Azure account with appropriate permissions
201-
- Docker installed
202-
203-
### Deploy the Azure Services
204-
All of the necessary Azure services can be deployed using the /deploy/macae.bicep script. This script will require the following parameters:
205-
206-
```
207-
az login
208-
az account set --subscription <SUBSCRIPTION_ID>
209-
az group create --name <RG_NAME> --location <RG_LOCATION>
210-
```
211-
To deploy the script you can use the Azure CLI.
212-
```
213-
az deployment group create \
214-
--resource-group <RG_NAME> \
215-
--template-file <BICEP_FILE> \
216-
--name <DEPLOYMENT_NAME>
217-
```
218-
219-
Note: if you are using windows with PowerShell, the continuation character (currently '\') should change to the tick mark ('').
220-
221-
The template will require you fill in locations for Cosmos and OpenAI services. This is to avoid the possibility of regional quota errors for either of these resources.
222-
223-
### Create the Containers
224-
#### Get admin credentials from ACR
225-
226-
Retrieve the admin credentials for your Azure Container Registry (ACR):
227-
228-
```sh
229-
az acr credential show \
230-
--name <e.g. macaeacr2t62qyozi76bs> \
231-
--resource-group <rg-name>
232-
```
233-
234-
#### Login to ACR
235-
236-
Login to your Azure Container Registry:
237-
238-
```sh
239-
az acr login --name <e.g. macaeacr2t62qyozi76bs>
240-
```
241-
242-
#### Build and push the image
243-
244-
Build the frontend and backend Docker images and push them to your Azure Container Registry. Run the following from the src/backend and the src/frontend directory contexts:
245-
246-
```sh
247-
az acr build \
248-
--registry <e.g. macaeacr2t62qyozi76bs> \
249-
--resource-group <rg-name> \
250-
--image <e.g. backendmacae:latest> .
251-
```
252-
253-
### Add images to the Container APP and Web App services
254-
255-
To add your newly created backend image:
256-
- Navigate to the Container App Service in the Azure portal
257-
- Click on Application/Containers in the left pane
258-
- Click on the "Edit and deploy" button in the upper left of the containers pane
259-
- In the "Create and deploy new revision" page, click on your container image 'backend'. This will give you the option of reconfiguring the container image, and also has an Environment variables tab
260-
- Change the properties page to
261-
- point to your Azure Container registry with a private image type and your image name (e.g. backendmacae:latest)
262-
- under "Authentication type" select "Managed Identity" and choose the 'mace-containerapp-pull'... identity setup in the bicep template
263-
- In the environment variables section add the following (each with a 'Manual entry' source):
264-
265-
name: 'COSMOSDB_ENDPOINT'
266-
value: \<Cosmos endpoint>
267-
268-
name: 'COSMOSDB_DATABASE'
269-
value: 'autogen'
270-
Note: To change the default, you will need to create the database in Cosmos
271-
272-
name: 'COSMOSDB_CONTAINER'
273-
value: 'memory'
274-
275-
name: 'AZURE_OPENAI_ENDPOINT'
276-
value: <Azure OpenAI endpoint>
277-
278-
name: 'AZURE_OPENAI_DEPLOYMENT_NAME'
279-
value: 'gpt-4o'
280-
281-
name: 'AZURE_OPENAI_API_VERSION'
282-
value: '2024-08-01-preview'
283-
Note: Version should be updated based on latest available
284-
285-
name: 'FRONTEND_SITE_NAME'
286-
value: 'https://<website Name>.azurewebsites.net'
287-
288-
name: 'APPLICATIONINSIGHTS_CONNECTION_STRING'
289-
value: <Application Insights Connection String>
290-
291-
- Click 'Save' and deploy your new revision
292-
293-
To add the new container to your website run the following:
294-
295-
```
296-
az webapp config container set --resource-group <resource_group_name> \
297-
--name <container_name> \
298-
--container-image-name <e.g. macaeacr2t62qyozi76bs.azurecr.io/frontendmacae:latest> \
299-
--container-registry-url <e.g. https://macaeacr2t62qyozi76bs.azurecr.io>
300-
```
301-
302-
303-
### Add the Entra identity provider to the Azure Web App
304-
To add the identity provider, please follow the steps outlined in [Set Up Authentication in Azure App Service](../documentation/azure_app_service_auth_setup.md)
305-
306-
### Run locally and debug
307-
308-
To debug the solution, you can use the Cosmos and OpenAI services you have manually deployed. To do this, you need to ensure that your Azure identity has the required permissions on the Cosmos and OpenAI services.
309-
310-
- For OpenAI service, you can add yourself to the 'Cognitive Services OpenAI User' permission in the Access Control (IAM) pane of the Azure portal.
311-
- Cosmos is a little more difficult as it requires permissions be added through script. See these examples for more information:
312-
- [Use data plane role-based access control - Azure Cosmos DB for NoSQL | Microsoft Learn](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/security/how-to-grant-data-plane-role-based-access?tabs=built-in-definition%2Cpython&pivots=azure-interface-cli)
313-
- [az cosmosdb sql role assignment | Microsoft Learn](https://learn.microsoft.com/en-us/cli/azure/cosmosdb/sql/role/assignment?view=azure-cli-latest#az-cosmosdb-sql-role-assignment-create)
314-
315-
Add the appropriate endpoints from Cosmos and OpenAI services to your .env file.
316-
Note that you can configure the name of the Cosmos database in the configuration. This can be helpful if you wish to separate the data messages generated in local debugging from those associated with the cloud based solution. If you choose to use a different database, you will need to create that database in the Cosmos instance as this is not done automatically.
317-
318-
If you are using VSCode, you can use the debug configuration shown in the [local setup](#local-setup).
319-
320-
## Requirements:
321-
322-
- Python 3.10 or higher + PIP
323-
- Azure CLI, and an Azure Subscription
324-
- Visual Studio Code IDE
325-
326190
# Local setup
327191
328192
> **Note for macOS Developers**: If you are using macOS on Apple Silicon (ARM64) the DevContainer will **not** work. This is due to a limitation with the Azure Functions Core Tools (see [here](https://github.com/Azure/azure-functions-core-tools/issues/3112)).

0 commit comments

Comments
 (0)