diff --git a/docs/AzureAIModelQuotaSettings.md b/docs/AzureAIModelQuotaSettings.md new file mode 100644 index 00000000..73bf6bce --- /dev/null +++ b/docs/AzureAIModelQuotaSettings.md @@ -0,0 +1,9 @@ +# How to Check & Update AI Model Quota + +Please follow [quota check instructions guide](./QuotaCheck.md) to check quota availability by region. + +1. **Navigate** to the [Azure AI Foundry portal](https://ai.azure.com/). +2. **Select** the AI Project associated with this accelerator. +3. **Go to** the `Management Center` from the bottom-left navigation menu. +4. Select `Request Quota` +5. Request More Quota with fill up the form for 'Request for Quota Increase' or delete any unused model deployments as needed. diff --git a/docs/AzureAccountSetup.md b/docs/AzureAccountSetup.md new file mode 100644 index 00000000..22ffa836 --- /dev/null +++ b/docs/AzureAccountSetup.md @@ -0,0 +1,14 @@ +## Azure account setup + +1. Sign up for a [free Azure account](https://azure.microsoft.com/free/) and create an Azure Subscription. +2. Check that you have the necessary permissions: + * Your Azure account must have `Microsoft.Authorization/roleAssignments/write` permissions, such as [Role Based Access Control Administrator](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#role-based-access-control-administrator-preview), [User Access Administrator](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#user-access-administrator), or [Owner](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#owner). + * Your Azure account also needs `Microsoft.Resources/deployments/write` permissions on the subscription level. + +You can view the permissions for your account and subscription by following the steps below: +- Navigate to the [Azure Portal](https://portal.azure.com/) and click on `Subscriptions` under 'Navigation' +- Select the subscription you are using for this accelerator from the list. + - If you try to search for your subscription and it does not come up, make sure no filters are selected. +- Select `Access control (IAM)` and you can see the roles that are assigned to your account for this subscription. + - If you want to see more information about the roles, you can go to the `Role assignments` + tab and search by your account name and then click the role you want to view more information about. \ No newline at end of file diff --git a/docs/DeleteResourceGroup.md b/docs/DeleteResourceGroup.md new file mode 100644 index 00000000..3869ee50 --- /dev/null +++ b/docs/DeleteResourceGroup.md @@ -0,0 +1,56 @@ +# Deleting Resources After a Failed Deployment in Azure Portal + +If your deployment fails and you need to clean up the resources manually, follow these steps in the Azure Portal. + +--- + +## **1. Navigate to the Azure Portal** + +1. Open [Azure Portal](https://portal.azure.com/). +2. Sign in with your Azure account. + +--- + +## **2. Find the Resource Group** + +1. In the search bar at the top, type **"Resource groups"** and select it. +2. Locate the **resource group** associated with the failed deployment. + +![Resource Groups](./images/portal_services_resource_groups.png) + +![Resource Groups](./images/portal_resource_groups_search.png) + +--- + +## **3. Delete the Resource Group** + +1. Click on the **resource group name** to open it. +2. Click the **Delete resource group** button at the top. + +![Delete Resource Group](./images/portal_resource_group_delete.png) + +3. Type the resource group name in the confirmation box and click **Delete**. + +๐Ÿ“Œ **Note:** Deleting a resource group will remove all resources inside it. + +--- + +## **4. Delete Individual Resources (If Needed)** + +If you donโ€™t want to delete the entire resource group, follow these steps: + +1. Open **Azure Portal** and go to the **Resource groups** section. +2. Click on the specific **resource group**. +3. Select the **resource** you want to delete (e.g., App Service, Storage Account). +4. Click **Delete** at the top. + +![Delete Individual Resource](./images/portal_web_app_delete.png) + +--- + +## **5. Verify Deletion** + +- After a few minutes, refresh the **Resource groups** page. +- Ensure the deleted resource or group no longer appears. + +๐Ÿ“Œ **Tip:** If a resource fails to delete, check if it's **locked** under the **Locks** section and remove the lock. diff --git a/docs/DeploymentGuide.md b/docs/DeploymentGuide.md index 3b043b2f..149098e6 100644 --- a/docs/DeploymentGuide.md +++ b/docs/DeploymentGuide.md @@ -1,76 +1,102 @@ -# Deployment Guide +# Deployment Guide -## Deployment Options +## Overview -### Sandbox or WAF Aligned Deployment Options +This guide walks you through deploying the Research Assistant Solution Accelerator to Azure. The deployment process takes approximately 15-20 minutes for the default Development/Testing configuration and includes both infrastructure provisioning and application setup. -The [`infra`](../infra) folder of the Build-your-own-copilot-Solution-Accelerator contains the [`main.bicep`](../infra/main.bicep) Bicep script, which defines all Azure infrastructure components for this solution. +๐Ÿ†˜ **Need Help?** If you encounter any issues during deployment, check our [Troubleshooting Guide](./TroubleShootingSteps.md) for solutions to common problems. -By default, the `azd up` command uses the [`main.parameters.json`](../infra/main.parameters.json) file to deploy the solution. This file is pre-configured for a **sandbox environment** โ€” ideal for development and proof-of-concept scenarios, with minimal security and cost controls for rapid iteration. +## Step 1: Prerequisites & Setup -For **production deployments**, the repository also provides [`main.waf.parameters.json`](../infra/main.waf.parameters.json), which applies a [Well-Architected Framework (WAF) aligned](https://learn.microsoft.com/en-us/azure/well-architected/) configuration. This option enables additional Azure best practices for reliability, security, cost optimization, operational excellence, and performance efficiency, such as: +### 1.1 Azure Account Requirements - - Enhanced network security (e.g., Network protection with private endpoints) - - Stricter access controls and managed identities - - Logging, monitoring, and diagnostics enabled by default - - Resource tagging and cost management recommendations +Ensure you have access to an [Azure subscription](https://azure.microsoft.com/free/) with the following permissions: ---- +| **Required Permission/Role** | **Scope** | **Purpose** | +|------------------------------|-----------|-------------| +| **Contributor** | Subscription level | Create and manage Azure resources | +| **User Access Administrator** | Subscription level | Manage user access and role assignments | +| **Role Based Access Control** | Subscription/Resource Group level | Configure RBAC permissions | +| **App Registration Creation** | Azure Active Directory | Create and configure authentication | -**How to choose your deployment configuration:** +**๐Ÿ” How to Check Your Permissions:** -* Use the default `main.parameters.json` file for a **sandbox/dev environment** -* For a **WAF-aligned, production-ready deployment**, copy the contents of `main.waf.parameters.json` into `main.parameters.json` before running `azd up` +1. Go to [Azure Portal](https://portal.azure.com/) +2. Navigate to **Subscriptions** (search for "subscriptions" in the top search bar) +3. Click on your target subscription +4. In the left menu, click **Access control (IAM)** +5. Scroll down to see the table with your assigned roles - you should see: + - **Contributor** + - **User Access Administrator** + - **Role Based Access Control Administrator** (or similar RBAC role) -### Configuration Options +**For App Registration permissions:** +1. Go to **Microsoft Entra ID** โ†’ **Manage** โ†’ **App registrations** +2. Try clicking **New registration** +3. If you can access this page, you have the required permissions +4. Cancel without creating an app registration -#### VM Credentials Configuration +๐Ÿ“– **Detailed Setup:** Follow [Azure Account Set Up](./AzureAccountSetup.md) for complete configuration. -By default, the solution sets the VM administrator username and password from environment variables. +### 1.2 Check Service Availability & Quota -To set your own VM credentials before deployment, use: +โš ๏ธ **CRITICAL:** Before proceeding, ensure your chosen region has all required services available: -```sh -azd env set AZURE_ENV_VM_ADMIN_USERNAME -azd env set AZURE_ENV_VM_ADMIN_PASSWORD -``` +**Required Azure Services:** +- [Azure AI Foundry](https://learn.microsoft.com/en-us/azure/ai-foundry/) +- [Azure OpenAI Service](https://learn.microsoft.com/en-us/azure/ai-services/openai/) +- [Azure Blob Storage](https://learn.microsoft.com/en-us/azure/storage/blobs/) +- [Azure Container Apps](https://learn.microsoft.com/en-us/azure/container-apps/) +- [Azure Container Registry](https://learn.microsoft.com/en-us/azure/container-registry/) +- [Azure App Configuration](https://learn.microsoft.com/en-us/azure/azure-app-configuration/) +- [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/) +- [Azure Queue Storage](https://learn.microsoft.com/en-us/azure/storage/queues/) +- [o3 Model Capacity](https://learn.microsoft.com/en-us/azure/ai-foundry/foundry-models/concepts/models-sold-directly-by-azure) -#### Additional Configuration +**Recommended Regions:** East US, West US, Australia East, UK South, France Central -
- Reusing an Existing Log Analytics Workspace - - Guide to get your [Existing Workspace ID](/docs/re-use-log-analytics.md) -
+๐Ÿ” **Check Availability:** Use [Azure Products by Region](https://azure.microsoft.com/en-us/explore/global-infrastructure/products-by-region/) to verify service availability. -> [!TIP] -> Always review and adjust parameter values (such as region, capacity, security settings and log analytics workspace configuration) to match your organizationโ€™s requirements before deploying. For production, ensure you have sufficient quota and follow the principle of least privilege for all identities and role assignments. +### 1.3 Quota Check (Optional) +๐Ÿ’ก **RECOMMENDED:** Check your Azure OpenAI quota availability before deployment for optimal planning. -> [!IMPORTANT] -> The WAF-aligned configuration is under active development. More Azure Well-Architected recommendations will be added in future updates. +๐Ÿ“– **Follow:** [Quota Check Instructions](./QuotaCheck.md) to ensure sufficient capacity. ---- -## Deployment Environment Setup +**Recommended Configuration:** +- **Default:** 200k tokens (minimum) +- **Optimal:** 500k tokens (recommended for best performance) -Pick from the options below to see step-by-step instructions for Visual Studio Code (WEB) and Local Environment: +> **Note:** When you run `azd up`, the deployment will automatically show you regions with available quota, so this pre-check is optional but helpful for planning purposes. You can customize these settings later in [Step 3.3: Advanced Configuration](#33-advanced-configuration-optional). -
- Deploy in Visual Studio Code (WEB) +๐Ÿ“– **Adjust Quota:** Follow [Azure AI Model Quota Settings](./AzureAIModelQuotaSettings.md) if needed. + +## Step 2: Choose Your Deployment Environment -### Visual Studio Code (WEB) +Select one of the following options to deploy the Research Assistant Solution Accelerator: -You can run this solution in VS Code Web. The button will open a web-based VS Code instance in your browser: +### Environment Comparison -1. Open the solution accelerator (this may take several minutes): +| **Option** | **Best For** | **Prerequisites** | **Setup Time** | +|------------|--------------|-------------------|----------------| +| **VS Code Web** | Quick deployment, no local setup required | Azure account | ~2-4 minutes | +| **Local Environment** | Enterprise environments, full control | All tools individually | ~15-30 minutes | - [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvQnVpbGQteW91ci1vd24tY29waWxvdC1Tb2x1dGlvbi1BY2NlbGVyYXRvci9yZWZzL2hlYWRzL2J5b2MtcmVzZWFyY2hlci9pbmZyYS92c2NvZGVfd2ViIiwgImluZGV4VXJsIjogIi9pbmRleC5qc29uIiwgInZhcmlhYmxlcyI6IHsiYWdlbnRJZCI6ICIiLCAiY29ubmVjdGlvblN0cmluZyI6ICIiLCAidGhyZWFkSWQiOiAiIiwgInVzZXJNZXNzYWdlIjogIiIsICJwbGF5Z3JvdW5kTmFtZSI6ICIiLCAibG9jYXRpb24iOiAiIiwgInN1YnNjcmlwdGlvbklkIjogIiIsICJyZXNvdXJjZUlkIjogIiIsICJwcm9qZWN0UmVzb3VyY2VJZCI6ICIiLCAiZW5kcG9pbnQiOiAiIn0sICJjb2RlUm91dGUiOiBbImFpLXByb2plY3RzLXNkayIsICJweXRob24iLCAiZGVmYXVsdC1henVyZS1hdXRoIiwgImVuZHBvaW50Il19) +**๐Ÿ’ก Recommendation:** For fastest deployment, start with **VS Code Web** - no local installation required. + +--- +Pick from the options below to see step-by-step instructions for Visual Studio Code (WEB) and Local Environment: + +
+ Optin A: Visual Studio Code Web (Easiest) -2. When prompted, sign in using your Microsoft account linked to your Azure subscription. - - Select the appropriate subscription to continue. + [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvQnVpbGQteW91ci1vd24tY29waWxvdC1Tb2x1dGlvbi1BY2NlbGVyYXRvci9yZWZzL2hlYWRzL2J5b2MtcmVzZWFyY2hlci9pbmZyYS92c2NvZGVfd2ViIiwgImluZGV4VXJsIjogIi9pbmRleC5qc29uIiwgInZhcmlhYmxlcyI6IHsiYWdlbnRJZCI6ICIiLCAiY29ubmVjdGlvblN0cmluZyI6ICIiLCAidGhyZWFkSWQiOiAiIiwgInVzZXJNZXNzYWdlIjogIiIsICJwbGF5Z3JvdW5kTmFtZSI6ICIiLCAibG9jYXRpb24iOiAiIiwgInN1YnNjcmlwdGlvbklkIjogIiIsICJyZXNvdXJjZUlkIjogIiIsICJwcm9qZWN0UmVzb3VyY2VJZCI6ICIiLCAiZW5kcG9pbnQiOiAiIn0sICJjb2RlUm91dGUiOiBbImFpLXByb2plY3RzLXNkayIsICJweXRob24iLCAiZGVmYXVsdC1henVyZS1hdXRoIiwgImVuZHBvaW50Il19) -3. Once the solution opens, the **AI Foundry terminal** will automatically start running the following command to install the required dependencies: +1. Click the badge above (may take a few minutes to load) +2. Sign in with your Azure account when prompted +3. Select the subscription where you want to deploy the solution +4. Wait for the environment to initialize (includes all deployment tools) +5. Once the solution opens, the **AI Foundry terminal** will automatically start running the following command to install the required dependencies: ```shell sh install.sh @@ -82,78 +108,314 @@ You can run this solution in VS Code Web. The button will open a web-based VS Co - Keep my existing files unchanged ``` Choose โ€œ**Overwrite with versions from template**โ€ and provide a unique environment name when prompted. - -4. Continue with the [deploying steps](#deploying-with-azd). +6. Proceed to [Step 3: Configure Deployment Settings](#step-3-configure-deployment-settings)
- Deploy in your local Environment + Option B: Local Environment -### Local Environment - -1. Make sure the following tools are installed: - - [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) (v7.0+) - available for Windows, macOS, and Linux. - - [Azure Developer CLI (azd)](https://aka.ms/install-azd) (v1.18.0+) - version - - [Python 3.9 to 3.11](https://www.python.org/downloads/) - - [Docker Desktop](https://www.docker.com/products/docker-desktop/) - - [Git](https://git-scm.com/downloads) +**Required Tools:** +- [PowerShell 7.0+](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.5) +- [Azure Developer CLI (azd) 1.18.0+](https://aka.ms/install-azd) +- [Python 3.9 to 3.11](https://www.python.org/downloads/) +- [Docker Desktop](https://www.docker.com/products/docker-desktop/) +- [Git](https://git-scm.com/downloads) +**Setup Steps:** +1. Install all required deployment tools listed above 2. Clone the repository or download the project code via command-line: ```shell azd init -t microsoft/build-your-own-copilot-solution-accelerator/ -b byoc-researcher ``` -3. Open the project folder in your terminal or editor. -4. Continue with the [deploying steps](#deploying-with-azd). +3. Open the project folder in your terminal. +4. Continue with the Proceed to [Step 3: Configure Deployment Settings](#step-3-configure-deployment-settings) +**PowerShell Users:** If you encounter script execution issues, run: +```powershell +Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass +```
+## Step 3: Configure Deployment Settings +Review the configuration options below. You can customize any settings that meet your needs, or leave them as defaults to proceed with a standard deployment. + +### 3.1 Choose Deployment Type (Optional) + +| **Aspect** | **Development/Testing (Default)** | **Production** | +|------------|-----------------------------------|----------------| +| **Configuration File** | `main.parameters.json` (sandbox) | Copy `main.waf.parameters.json` to `main.parameters.json` | +| **Security Controls** | Minimal (for rapid iteration) | Enhanced (production best practices) | +| **Cost** | Lower costs | Cost optimized | +| **Use Case** | POCs, development, testing | Production workloads | +| **Framework** | Basic configuration | [Well-Architected Framework](https://learn.microsoft.com/en-us/azure/well-architected/) | +| **Features** | Core functionality | Reliability, security, operational excellence | + +**To use production configuration:** + +Copy the contents from the production configuration file to your main parameters file: + +1. Navigate to the `infra` folder in your project +2. Open `main.waf.parameters.json` in a text editor (like Notepad, VS Code, etc.) +3. Select all content (Ctrl+A) and copy it (Ctrl+C) +4. Open `main.parameters.json` in the same text editor +5. Select all existing content (Ctrl+A) and paste the copied content (Ctrl+V) +6. Save the file (Ctrl+S) + +### 3.2 Set VM Credentials (Optional - Production Deployment Only) +> **Note:** This section only applies if you selected **Production** deployment type in section 3.1. VMs are not deployed in the default Development/Testing configuration. + +By default, random GUIDs are generated for VM credentials. To set custom credentials: + +```shell +azd env set AZURE_ENV_VM_ADMIN_USERNAME +azd env set AZURE_ENV_VM_ADMIN_PASSWORD +``` +### 3.3 Advanced Configuration (Optional) + +
+Configurable Parameters + +You can customize various deployment settings before running `azd up`, including Azure regions, AI model configurations (deployment type, version, capacity), container registry settings, and resource names. + +๐Ÿ“– **Complete Guide:** See [Parameter Customization Guide](../docs/CustomizingAzdParameters.md) for the full list of available parameters and their usage. + +
+ +
+Reuse Existing Resources + +To optimize costs and integrate with your existing Azure infrastructure, you can configure the solution to reuse compatible resources already deployed in your subscription. + +**Supported Resources for Reuse:** + +- **Log Analytics Workspace:** Integrate with your existing monitoring infrastructure by reusing an established Log Analytics workspace for centralized logging and monitoring. [Configuration Guide](./re-use-log-analytics.md) + +**Key Benefits:** +- **Cost Optimization:** Eliminate duplicate resource charges +- **Operational Consistency:** Maintain unified monitoring and AI infrastructure +- **Faster Deployment:** Skip resource creation for existing compatible services +- **Simplified Management:** Reduce the number of resources to manage and monitor + +**Important Considerations:** +- Ensure existing resources meet the solution's requirements and are in compatible regions +- Review access permissions and configurations before reusing resources +- Consider the impact on existing workloads when sharing resources + +
+ +## Step 4: Deploy the Solution +๐Ÿ’ก **Before You Start:** If you encounter any issues during deployment, check our [Troubleshooting Guide](./TroubleShootingSteps.md) for common solutions. ### Deploying with AZD Once you've opened the project in Visual Studio Code (WEB) or local, you can deploy it to Azure by following these steps: -1. Login to Azure: +### 4.1 Authenticate with Azure - ```shell - azd auth login - ``` +```shell +azd auth login +``` - #### To authenticate with Azure Developer CLI (`azd`), use the following command with your **Tenant ID**: +**For specific tenants:** +```shell +azd auth login --tenant-id +``` - ```sh - azd auth login --tenant-id - ``` +> **Finding Tenant ID:** + > 1. Open the [Azure Portal](https://portal.azure.com/). + > 2. Navigate to **Microsoft Entra ID** from the left-hand menu. + > 3. Under the **Overview** section, locate the **Tenant ID** field. Copy the value displayed. -2. Provision and deploy all the resources: +### 4.2 Start Deployment - ```shell - azd up - ``` +```shell +azd up +``` + +**During deployment, you'll be prompted for:** +1. **Environment name** (e.g., "resasst") - Must be 3-16 characters long, alphanumeric only +2. **Azure subscription** selection +3. **Primary location** - Select the region where your infrastructure resources will be deployed +4. **Resource group** selection (create new or use existing) + +**Expected Duration:** 4-6 minutes for default configuration + +**โš ๏ธ Deployment Issues:** If you encounter errors or timeouts, try a different region as there may be capacity constraints. For detailed error solutions, see our [Troubleshooting Guide](./TroubleShootingSteps.md). + +### 4.3 Get Application URL + +After successful deployment: +1. Open [Azure Portal](https://portal.azure.com/) +2. Navigate to your resource group +3. Find the App Service. +4. Copy the **Application URL** from Default domain. + +โš ๏ธ **Important:** Complete [Post-Deployment Steps](#step-5-post-deployment-configuration) before accessing the application. + +## Step 5: Post-Deployment Configuration -3. Provide an `azd` environment name (e.g., "resass"). -4. Select a subscription from your Azure account and choose a location that has quota for all the resources. - -- This deployment will take *15-20 minutes* to provision the resources in your account and set up the solution with sample data. - - If you encounter an error or timeout during deployment, changing the location may help, as there could be availability constraints for the resources. +### 5.1 Configure Grant Draft Proposal Endpoint (Required) -5. When Deployment is complete, follow steps in [AI Foundry Deployment guide](./AIFoundryDeployment.md) to configure the grant draft proposal endpoint. +**This step is mandatory for grant draft access:** -5. Open the [Azure Portal](https://portal.azure.com/), go to the deployed resource group, find the App Service, and get the app URL from `Default domain`. +1. Follow [AI Foundry Deployment guide](./AIFoundryDeployment.md) to configure the grant draft proposal endpoint. +2. Wait up to 10 minutes for authentication changes to take effect -6. If you are done trying out the application, you can delete the resources by running `azd down`. - > **Note:** If you deployed with `enableRedundancy=true` and Log Analytics workspace replication is enabled, you must first disable replication before running `azd down` else resource group delete will fail. Follow the steps in [Handling Log Analytics Workspace Deletion with Replication Enabled](./LogAnalyticsReplicationDisable.md), wait until replication returns `false`, then run `azd down`. +### 5.2 Verify Deployment +1. Access your application using the URL from Step 4.3 +2. Confirm the application loads successfully +3. Verify you can sign in with your authenticated account -## Next Steps -Now that you've completed your deployment, you can start using the solution. +### 5.3 Test the Application +Now that you've completed your deployment, you can start using the solution. -To help you get started, here are some [Sample Questions](./SampleQuestions.md) you can follow to try it out. +**To help you get started:** +- Review the [Sample Questions](./SampleQuestions.md) file. +- Use these questions to test and explore the applicationโ€™s functionality. + +## Step 6: Clean Up (Optional) + +### Remove All Resources +```shell +azd down +``` +> **Note:** If you deployed with `enableRedundancy=true` and Log Analytics workspace replication is enabled, you must first disable replication before running `azd down` else resource group delete will fail. Follow the steps in [Handling Log Analytics Workspace Deletion with Replication Enabled](./LogAnalyticsReplicationDisable.md), wait until replication returns `false`, then run `azd down`. + +### Manual Cleanup (if needed) +If deployment fails or you need to clean up manually: +- Follow [Delete Resource Group Guide](./DeleteResourceGroup.md) + +## Managing Multiple Environments + +### Recover from Failed Deployment + +If your deployment failed or encountered errors, here are the steps to recover: + +
+Recover from Failed Deployment + +**If your deployment failed or encountered errors:** + +1. **Try a different region:** Create a new environment and select a different Azure region during deployment +2. **Clean up and retry:** Use `azd down` to remove failed resources, then `azd up` to redeploy +3. **Check troubleshooting:** Review [Troubleshooting Guide](./TroubleShootingSteps.md) for specific error solutions +4. **Fresh start:** Create a completely new environment with a different name + +**Example Recovery Workflow:** +```shell +# Remove failed deployment (optional) +azd down + +# Create new environment (3-16 chars, alphanumeric only) +azd env new resassit + +# Deploy with different settings/region +azd up +``` + +
+ +### Creating a New Environment + +If you need to deploy to a different region, test different configurations, or create additional environments: + +
+Create a New Environment + +**Create Environment Explicitly:** +```shell +# Create a new named environment (3-16 characters, alphanumeric only) +azd env new + +# Select the new environment +azd env select + +# Deploy to the new environment +azd up +``` + +**Example:** +```shell +# Create a new environment for production (valid: 3-16 chars) +azd env new resastprod + +# Switch to the new environment +azd env select resastprod + +# Deploy with fresh settings +azd up +``` + +> **Environment Name Requirements:** +> - **Length:** 3-16 characters +> - **Characters:** Alphanumeric only (letters and numbers) +> - **Valid examples:** `resast`, `test123`, `myappdev`, `prod2024` +> - **Invalid examples:** `ra` (too short), `my-very-long-environment-name` (too long), `test_env` (underscore not allowed), `myapp-dev` (hyphen not allowed) + +
+ +
+Switch Between Environments + +**List Available Environments:** +```shell +azd env list +``` + +**Switch to Different Environment:** +```shell +azd env select +``` + +**View Current Environment:** +```shell +azd env get-values +``` + +
+ +### Best Practices for Multiple Environments + +- **Use descriptive names:** `reastdev`, `reastprod`, `reasttest` (remember: 3-16 chars, alphanumeric only) +- **Different regions:** Deploy to multiple regions for testing quota availability +- **Separate configurations:** Each environment can have different parameter settings +- **Clean up unused environments:** Use `azd down` to remove environments you no longer need + +## Need Help? + +- ๐Ÿ› **Issues:** Check [Troubleshooting Guide](./TroubleShootingSteps.md) +- ๐Ÿ’ฌ **Support:** Review [Support Guidelines](../SUPPORT.md) +- ๐Ÿ”ง **Development:** See [Contributing Guide](../CONTRIBUTING.md) + +--- + +## Advanced: Deploy Local Changes + +If you've made local modifications to the code and want to deploy them to Azure, follow these steps to swap the configuration files: + +> **Note:** To set up and run the application locally for development, see the [Local Development Setup Guide](./LocalSetupGuide.md). + +### Step 1: Rename Azure Configuration Files + +**In the root directory:** +1. Rename `azure.yaml` to `azure_custom2.yaml` +2. Rename `azure_custom.yaml` to `azure.yaml` + +### Step 2: Rename Infrastructure Files + +**In the `infra` directory:** +1. Rename `main.bicep` to `main_custom2.bicep` +2. Rename `main_custom.bicep` to `main.bicep` + +### Step 3: Deploy Changes + +Run the deployment command: +```shell +azd up +``` -## Deploy Your local changes -To deploy your local changes rename the below files. - 1. Rename `azure.yaml` to `azure_custom2.yaml` and `azure_custom.yaml` to `azure.yaml`. - 2. Go to `infra` directory - - Rename `main.bicep` to `main_custom2.bicep` and `main_custom.bicep` to `main.bicep`. -Continue with the [deploying steps](#deploying-with-azd). +> **Note:** These custom files are configured to deploy your local code changes instead of pulling from the GitHub repository. \ No newline at end of file diff --git a/docs/TroubleShootingSteps.md b/docs/TroubleShootingSteps.md new file mode 100644 index 00000000..0863a23b --- /dev/null +++ b/docs/TroubleShootingSteps.md @@ -0,0 +1,373 @@ +# ๐Ÿ› ๏ธ Troubleshooting + +When deploying Azure resources, you may come across different error codes that stop or delay the deployment process. This section lists some of the most common errors along with possible causes and step-by-step resolutions. + +Use these as quick reference guides to unblock your deployments. + +> **๐Ÿ’ก Need deployment recovery help?** If your deployment failed and you need to start over, see the [Recover from Failed Deployment](https://github.com/microsoft/Container-Migration-Solution-Accelerator/blob/readme-updates/docs/DeploymentGuide.md#recover-from-failed-deployment) section in the deployment guide. + +## Error Codes + +
+ReadOnlyDisabledSubscription + +- Check if you have an active subscription before starting the deployment. + +
+ +
+ MissingSubscriptionRegistration/ AllowBringYourOwnPublicIpAddress/ InvalidAuthenticationToken + +Enable `AllowBringYourOwnPublicIpAddress` Feature + +Before deploying the resources, you may need to enable the **Bring Your Own Public IP Address** feature in Azure. This is required only once per subscription. + +### Steps + +1. **Run the following command to register the feature:** + + ```bash + az feature register --namespace Microsoft.Network --name AllowBringYourOwnPublicIpAddress + ``` + +2. **Wait for the registration to complete.** + You can check the status using: + + ```bash + az feature show --namespace Microsoft.Network --name AllowBringYourOwnPublicIpAddress --query properties.state + ``` + +3. **The output should show:** + "Registered" + +4. **Once the feature is registered, refresh the provider:** + + ```bash + az provider register --namespace Microsoft.Network + ``` + + ๐Ÿ’ก Note: Feature registration may take several minutes to complete. This needs to be done only once per Azure subscription. + +
+ +
+ResourceGroupNotFound + +## Option 1 + +### Steps + +1. Go to [Azure Portal](https:/portal.azure.com/#home). + +2. Click on the **"Resource groups"** option available on the Azure portal home page. + ![alt text](./images/portal_home_resource_groups.png) + +3. In the Resource Groups search bar, search for the resource group you intend to target for deployment. If it exists, you can proceed with using it. + ![alt text](./images/portal_resource_groups_select.png) + +## Option 2 + +- This error can occur if you deploy the template using the same .env file - from a previous deployment. +- To avoid this issue, create a new environment before redeploying. +- You can use the following command to create a new environment: + +``` +azd env new +``` + +
+
+ResourceGroupBeingDeleted + +To prevent this issue, please ensure that the resource group you are targeting for deployment is not currently being deleted. You can follow steps to verify resource group is being deleted or not. + +### Steps: + +1. Go to [Azure Portal](https://portal.azure.com/#home) +2. Go to resource group option and search for targeted resource group +3. If Targeted resource group is there and deletion for this is in progress, it means u cannot use this, you can create new or use any other resource group + +
+ +
+InternalSubscriptionIsOverQuotaForSku/ManagedEnvironmentProvisioningError + +Quotas are applied per resource group, subscriptions, accounts, and other scopes. For example, your subscription might be configured to limit the number of vCPUs for a region. If you attempt to deploy a virtual machine with more vCPUs than the permitted amount, you receive an error that the quota was exceeded. +For PowerShell, use the `Get-AzVMUsage` cmdlet to find virtual machine quotas. + +```ps +Get-AzVMUsage -Location "West US" +``` + +based on available quota you can deploy application otherwise, you can request for more quota + +
+ +
+InsufficientQuota + +- Check if you have sufficient quota available in your subscription before deployment. +- To verify, refer to the [Quota Check documentation](./QuotaCheck.md) for details. + +
+ +
+DeploymentModelNotSupported + +- The updated model may not be supported in the selected region. Please verify its availability in the [Azure AI Foundry models](https://learn.microsoft.com/en-us/azure/ai-foundry/foundry-models/concepts/models-sold-directly-by-azure?pivots=azure-openai&tabs=global-standard%2Cstandard-chat-completions) document. + +
+
+LinkedInvalidPropertyId/ ResourceNotFound/DeploymentOutputEvaluationFailed/ CanNotRestoreANonExistingResource + +- Before using any resource ID, ensure it follows the correct format. +- Verify that the resource ID you are passing actually exists. +- Make sure there are no typos in the resource ID. +- Verify that the provisioning state of the existing resource is `Succeeded` by running the following command to avoid this error while deployment or restoring the resource. + + ``` + az resource show --ids --query "properties.provisioningState" + ``` + +- Sample Resource IDs format + - Log Analytics Workspace Resource ID + ``` + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName} + ``` + - Azure AI Foundry Project Resource ID + ``` + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{name} + ``` +- For more information refer [Resource Not Found errors solutions](https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-not-found?tabs=bicep) + +
+
+ResourceNameInvalid + +- Ensure the resource name is within the allowed length and naming rules defined for that specific resource type, you can refer [Resource Naming Convention](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules) document. + +
+
+ServiceUnavailable/ResourceNotFound + +- Regions are restricted to guarantee compatibility with paired regions and replica locations for data redundancy and failover scenarios based on articles [Azure regions list](https://learn.microsoft.com/en-us/azure/reliability/regions-list) and [Reliability in Azure Cosmos DB for NoSQL](https://learn.microsoft.com/en-us/azure/reliability/reliability-cosmos-db-nosql). + +- You can request more quota for Cosmos DB, refer [Quota Request](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/create-support-request-quota-increase) Documentation + +
+
+Workspace Name - InvalidParameter + +To avoid this errors in workspace ID follow below rules. + +1. Must start and end with an alphanumeric character (letter or number). +2. Allowed characters: + `aโ€“z` + `0โ€“9` + `- (hyphen)` +3. Cannot start or end with a hyphen -. +4. No spaces, underscores (\_), periods (.), or special characters. +5. Must be unique within the Azure region & subscription. +6. Length: 3โ€“33 characters (for AML workspaces). +
+
+BadRequest: Dns record under zone Document is already taken + +This error can occur only when user hardcoding the CosmosDB Service name. To avoid this you can try few below suggestions. + +- Verify resource names are globally unique. +- If you already created an account/resource with same name in another subscription or resource group, check and delete it before reusing the name. +- By default in this template we are using unique prefix with every resource/account name to avoid this kind for errors. +
+
+NetcfgSubnetRangeOutsideVnet + +- Ensure the subnetโ€™s IP address range falls within the virtual networkโ€™s address space. +- Always validate that the subnet CIDR block is a subset of the VNet range. +- For Azure Bastion, the AzureBastionSubnet must be at least /27. +- Confirm that the AzureBastionSubnet is deployed inside the VNet. +
+
+DisableExport_PublicNetworkAccessMustBeDisabled + +- Check container source: Confirm whether the deployment is using a Docker image or Azure Container Registry (ACR). +- Verify ACR configuration: If ACR is included, review its settings to ensure they comply with Azure requirements. +- Check export settings: If export is disabled in ACR, make sure public network access is also disabled. +- Dedeploy after fix: Correct the configuration and redeploy. This will prevent the Conflict error during deployment. +- For more information refer [ACR Data Loss Prevention](https://learn.microsoft.com/en-us/azure/container-registry/data-loss-prevention) document. +
+
+AccountProvisioningStateInvalid + +- The AccountProvisioningStateInvalid error occurs when you try to use resources while they are still in the Accepted provisioning state. +- This means the deployment has not yet fully completed. +- To avoid this error, wait until the provisioning state changes to Succeeded. +- Only use the resources once the deployment is fully completed. +
+
+DeploymentCanceled + +There might be multiple reasons for this error you can follow below steps to troubleshoot. + +1. Check deployment history + - Go to Azure Portal โ†’ Resource Group โ†’ Deployments. + - Look at the detailed error message for the deployment that was canceled โ€” this will show which resource failed and why. +2. Identify the root cause + - A DeploymentCanceled usually means: + - A dependent resource failed to deploy. + - A validation error occurred earlier. + - A manual cancellation was triggered. + - Expand the failed deployment logs for inner error messages. +3. Validate your template (ARM/Bicep) + Run: + ``` + az deployment group validate --resource-group --template-file main.bicep + ``` +4. Check resource limits/quotas + - Ensure you have not exceeded quotas (vCPUs, IPs, storage accounts, etc.), which can silently cause cancellation. +5. Fix the failed dependency + - If a specific resource shows BadRequest, Conflict, or ValidationError, resolve that first. + - Re-run the deployment after fixing the root cause. +6. Retry deployment +Once corrected, redeploy with: +` az deployment group create --resource-group --template-file main.bicep + ` +Essentially: DeploymentCanceled itself is just a wrapper error โ€” you need to check inner errors in the deployment logs to find the actual failure. +
+
+LocationNotAvailableForResourceType + +- You may encounter a LocationNotAvailableForResourceType error if you set the secondary location to 'Australia Central' in the main.bicep file. +- This happens because 'Australia Central' is not a supported region for that resource type. +- Always refer to the README file or Azure documentation to check the list of supported regions. +- Update the deployment with a valid supported region to resolve the issue. + +
+ +
+InvalidResourceLocation + +- You may encounter an InvalidResourceLocation error if you change the region for Cosmos DB or the Storage Account (secondary location) multiple times in the main.bicep file and redeploy. +- Azure resources like Cosmos DB and Storage Accounts do not support changing regions after deployment. +- If you need to change the region again, first delete the existing deployment. +- Then redeploy the resources with the updated region configuration. + +
+ +
+ +DeploymentActive + +- This issue occurs when a deployment is already in progress and another deployment is triggered in the same resource group, causing a DeploymentActive error. +- Cancel the ongoing deployment before starting a new one. +- Do not initiate a new deployment in the same resource group until the previous one is completed. +
+ +
+ResourceOperationFailure/ProvisioningDisabled + +- This error occurs when provisioning of a resource is restricted in the selected region. + It usually happens because the service is not available in that region or provisioning has been temporarily disabled. + +- Regions are restricted to guarantee compatibility with paired regions and replica locations for data redundancy and failover scenarios based on articles [Azure regions list](https://learn.microsoft.com/en-us/azure/reliability/regions-list) and [Reliability in Azure Cosmos DB for NoSQL](https://learn.microsoft.com/en-us/azure/reliability/reliability-cosmos-db-nosql). + +- If you need to use the same region, you can request a quota or provisioning exception. + Refer to [Quota Request](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/create-support-request-quota-increase) for more details. + +
+ +
+MaxNumberOfRegionalEnvironmentsInSubExceeded + +- This error occurs when you try to create more than the allowed number of **Azure Container App Environments (ACA Environments)** in the same region for a subscription. +- For example, in **Sweden Central**, only **1 Container App Environment** is allowed per subscription. + +The subscription 'xxxx-xxxx' cannot have more than 1 Container App Environments in Sweden Central. + +- To fix this, you can: + - Deploy the Container App Environment in a **different region**, OR + - Request a quota increase via Azure Support โ†’ [Quota Increase Request](https://go.microsoft.com/fwlink/?linkid=2208872) + +
+ +
+Unauthorized - Operation cannot be completed without additional quota + +- You can check your quota usage using `az vm list-usage`. + + ``` + az vm list-usage --location "" -o table + ``` + +- To Request more quota refer [VM Quota Request](https://techcommunity.microsoft.com/blog/startupsatmicrosoftblog/how-to-increase-quota-for-specific-types-of-azure-virtual-machines/3792394). + +
+ +
ParentResourceNotfound + + +- You can refer to the [Parent Resource Not found](https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-parent-resource?tabs=bicep) documentation if you encounter this error. + +
+ +
ResourceProviderError + +- This error occurs when the resource provider is not registered in your subscription. +- To register it, refer to [Register Resource Provider](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types) documentation. + +
+ +
Conflict - Cannot use the SKU Basic with File Change Audit for site. + +- This error happens because File Change Audit logs arenโ€™t supported on Basic SKU App Service Plans. + +- Upgrading to Premium/Isolated SKU (supports File Change Audit), or + +- Disabling File Change Audit in Diagnostic Settings if you must stay on Basic. +- Always cross-check the [supported log types](https://aka.ms/supported-log-types) + before adding diagnostic logs to your Bicep templates. + +
+ +
+ +AccountPropertyCannotBeUpdated + +- The property **`isHnsEnabled`** (Hierarchical Namespace for Data Lake Gen2) is **read-only** and can only be set during **storage account creation**. +- Once a storage account is created, this property **cannot be updated**. +- Trying to update it via ARM template, Bicep, CLI, or Portal will fail. + +- **Resolution** +- Create a **new storage account** with `isHnsEnabled=true` if you require hierarchical namespace. +- Migration may be needed if you already have data. +- Refer to [Storage Account Update Restrictions](https://aka.ms/storageaccountupdate) for more details. + +
+ +
+ +SpecialFeatureOrQuotaIdRequired + +This error occurs when your subscription does not have access to certain Azure OpenAI models. + +**Example error message:** +`SpecialFeatureOrQuotaIdRequired: The current subscription does not have access to this model 'Format:OpenAI,Name:o3,Version:2025-04-16'.` + +**Resolution:** +To gain access, submit a request using the official form: +๐Ÿ‘‰ [Azure OpenAI Model Access Request](https://customervoice.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR7en2Ais5pxKtso_Pz4b1_xUQ1VGQUEzRlBIMVU2UFlHSFpSNkpOR0paRSQlQCN0PWcu) + +Youโ€™ll need to use this form if you require access to the following restricted models: +- gpt-5 +- o3 +- o3-pro +- deep research +- reasoning summary +- gpt-image-1 + +Once your request is approved, redeploy your resource. + +
+ +๐Ÿ’ก Note: If you encounter any other issues, you can refer to the [Common Deployment Errors](https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/common-deployment-errors) documentation. +If the problem persists, you can also raise an bug in our [Github Issues](https://github.com/microsoft/Container-Migration-Solution-Accelerator/issues) for further support. diff --git a/docs/images/portal_home_resource_groups.png b/docs/images/portal_home_resource_groups.png new file mode 100644 index 00000000..cb3ce189 Binary files /dev/null and b/docs/images/portal_home_resource_groups.png differ diff --git a/docs/images/portal_resource_group_delete.png b/docs/images/portal_resource_group_delete.png new file mode 100644 index 00000000..c435ecf1 Binary files /dev/null and b/docs/images/portal_resource_group_delete.png differ diff --git a/docs/images/portal_resource_groups_search.png b/docs/images/portal_resource_groups_search.png new file mode 100644 index 00000000..d3a245df Binary files /dev/null and b/docs/images/portal_resource_groups_search.png differ diff --git a/docs/images/portal_resource_groups_select.png b/docs/images/portal_resource_groups_select.png new file mode 100644 index 00000000..ee230f53 Binary files /dev/null and b/docs/images/portal_resource_groups_select.png differ diff --git a/docs/images/portal_services_resource_groups.png b/docs/images/portal_services_resource_groups.png new file mode 100644 index 00000000..67b058bc Binary files /dev/null and b/docs/images/portal_services_resource_groups.png differ diff --git a/docs/images/portal_web_app_delete.png b/docs/images/portal_web_app_delete.png new file mode 100644 index 00000000..24bf593d Binary files /dev/null and b/docs/images/portal_web_app_delete.png differ