@@ -43,39 +43,45 @@ ERROR: Python is not installed or not in PATH
4343```
4444
4545** Solution** :
46- - Install Python 3.8+ from https://www.python.org/downloads/
46+
47+ - Install Python 3.8+ from < https://www.python.org/downloads/ >
4748- Ensure Python is added to your system PATH during installation
4849- Verify installation: ` python --version `
4950
5051## Virtual Environment Creation Failed
52+
5153```
5254ERROR: Failed to create virtual environment
5355```
5456
5557** Solution** :
58+
5659- Ensure you have write permissions to the ` src ` directory
5760- Try deleting existing ` venv ` folder: ` Remove-Item -Recurse -Force venv `
5861- Check if ` python -m venv ` works manually: ` python -m venv test_venv `
5962- On Windows, ensure your execution policy allows script execution
6063
6164## Package Installation Failed
65+
6266```
6367ERROR: Could not install packages due to an OSError
6468```
6569
6670** Solution** :
71+
6772- Update pip: ` python -m pip install --upgrade pip `
6873- Clear pip cache: ` pip cache purge `
6974- Try installing with ` --no-cache-dir ` : ` pip install --no-cache-dir -r requirements.txt `
7075- For Windows + pandas issues, use pre-built wheels by ensuring ` pandas>=2.2.2 ` in requirements.txt
7176
72-
7377## Not Logged into Azure CLI
78+
7479```
7580ERROR: Please run 'az login' to setup account
7681```
7782
7883** Solution** :
84+
7985``` powershell
8086# Login to Azure CLI
8187az login
@@ -88,18 +94,20 @@ az account set --subscription <subscription-id>
8894```
8995
9096## AAD Authentication Failed
97+
9198```
9299DefaultAzureCredential failed to retrieve a token
93100```
94101
95102** Solution** :
103+
961041 . Ensure you're logged into Azure CLI: ` az login `
971052 . Check your account has proper permissions
981063 . Verify the resource exists and you have access
991074 . Try clearing Azure credentials cache: ` az account clear ` then ` az login ` again
100108
101-
102109## Local Authorization Disabled Error
110+
103111```
104112ERROR: Local Authorization is disabled. Use an AAD token to authorize all requests.
105113```
@@ -128,6 +136,7 @@ az account set --subscription <subscription-id>
128136> If your Cosmos DB has public network access disabled, your local machine or Codespace VM cannot connect.
129137
130138** Solution via Azure Portal** :
139+
131140- Navigate to your Cosmos DB account in the Azure portal
132141- Select ** Networking** from the Settings menu
133142- Ensure ** Public network access** is set to ** All networks**
@@ -136,6 +145,7 @@ az account set --subscription <subscription-id>
136145- Try running the script again
137146
138147** Solution via Azure CLI** :
148+
139149``` powershell
140150az cosmosdb update \
141151 --name <cosmos-account-name> \
@@ -146,10 +156,12 @@ az cosmosdb update \
146156- Insufficient Permissions: Your Azure account needs appropriate role assignments on the Cosmos DB account.
147157
148158** Required roles** :
159+
149160- ` Cosmos DB Built-in Data Contributor ` (for read/write access)
150161- Or ` Contributor ` at the resource group level
151162
152163** Solution via Azure CLI** :
164+
153165``` powershell
154166# Get your user object ID
155167$userId = (az ad signed-in-user show --query id -o tsv)
@@ -164,18 +176,20 @@ az cosmosdb sql role assignment create \
164176```
165177
166178## Connection Timeout
179+
167180```
168181ERROR: Request timeout
169182```
170183
171184** Solution** :
185+
172186- Check your network connection
173187- Verify Cosmos DB firewall settings allow your IP address
174188- Ensure public network access is enabled (see above)
175- - Check if Azure services are experiencing outages: https://status.azure.com/
176-
189+ - Check if Azure services are experiencing outages: < https://status.azure.com/ >
177190
178191## CSV File Not Found
192+
179193```
180194WARNING: CSV data file not found at data/updated_product_catalog(in).csv
181195```
@@ -188,45 +202,53 @@ curl -o src/data/updated_product_catalog(in).csv https://raw.githubusercontent.c
188202```
189203
190204## CSV Parsing Error
205+
191206```
192207ERROR: Error tokenizing data. C error: Expected X fields, saw Y
193208```
194209
195210** Solution** :
211+
196212- Ensure CSV fields with commas are properly quoted
197213- Check for special characters or encoding issues
198214- Verify the CSV has the correct number of columns (6): ProductID, ProductName, ProductCategory, ProductDescription, Price, ImageUrl
199215- Try opening the CSV in a text editor to check for formatting issues
200216
201217## Environment File Missing
218+
202219```
203220ERROR: .env file not found
204221```
205222
206223** Solution** :
224+
207225``` bash
208226# Run Terraform to generate the .env file
209227cd terraform-infrastructure
210228terraform apply -auto-approve
211229```
212230
213231## Failed to Authenticate to Cosmos DB
232+
214233```
215234ERROR: Failed to authenticate to Cosmos DB using DefaultAzureCredential and no valid COSMOS_DB_KEY was provided
216235```
217236
218237** Solution** :
238+
219239- Ensure your ` .env ` file is properly generated with correct keys
220240- Run ` terraform apply ` again if needed
221241- Check that ` COSMOS_DB_ENDPOINT ` and ` COSMOS_DB_KEY ` are set correctly in ` .env `
222242- The script will automatically try AAD authentication first, then fall back to key-based auth
223243
224244## Resource Already Exists
245+
225246```
226247ERROR: A resource with the ID already exists
227248```
228249
229250** Solution** :
251+
230252- Import the existing resource: ` terraform import <resource_type>.<name> <azure_resource_id> `
231253- Or destroy and recreate: ` terraform destroy ` then ` terraform apply `
232254- Check for resources in other resource groups with the same name
@@ -238,6 +260,7 @@ ERROR: The client does not have authorization to perform action
238260```
239261
240262** Solution** :
263+
241264- Ensure your Azure account has ` Contributor ` or ` Owner ` role on the subscription or resource group
242265- Check if specific Azure policies are blocking resource creation
243266- Contact your Azure administrator to grant necessary permissions
@@ -249,6 +272,7 @@ ERROR: Error configuring the backend "azurerm"
249272```
250273
251274** Solution** :
275+
252276- Verify your Azure credentials are configured: ` az login `
253277- Check that the specified subscription exists and you have access
254278- Ensure the backend storage account and container exist (if using remote state)
@@ -260,6 +284,7 @@ ERROR: Error acquiring the state lock
260284```
261285
262286** Solution** :
287+
263288``` bash
264289# Force unlock (use with caution)
265290terraform force-unlock < lock-id>
@@ -272,18 +297,21 @@ terraform force-unlock <lock-id>
272297For more detailed error information:
273298
274299** Azure CLI** :
300+
275301``` powershell
276302az <command> --debug
277303```
278304
279305** Python Scripts** :
280306Set environment variable before running:
307+
281308``` powershell
282309$env:AZURE_LOG_LEVEL = "DEBUG"
283310python pipelines/script.py
284311```
285312
286313** Terraform** :
314+
287315``` bash
288316export TF_LOG=DEBUG
289317terraform apply
0 commit comments