Skip to content

Commit fd1af72

Browse files
fix: added tags in CAdeploy.yml file (#675)
* CI Pipeline fix for Client Advisor * added tags in CAdeploy.yml file * add my feature branch * tags changes updated in CAdeploy.yml file * added template name condition based * removed my feature branch from pipeline * Additional Troubleshooting steps
1 parent a1cdb97 commit fd1af72

File tree

7 files changed

+346
-11
lines changed

7 files changed

+346
-11
lines changed

.github/workflows/CAdeploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,13 @@ jobs:
141141
# Install azd (Azure Developer CLI) - required by process_sample_data.sh
142142
curl -fsSL https://aka.ms/install-azd.sh | bash
143143
144+
# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
145+
current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ")
146+
144147
DEPLOY_OUTPUT=$(az deployment group create \
145148
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
146149
--template-file infra/main.bicep \
147-
--parameters location=${{ env.AZURE_LOCATION }} azureAiServiceLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} containerImageTag=${{ env.IMAGE_TAG }} createdBy="Pipeline" \
150+
--parameters location=${{ env.AZURE_LOCATION }} azureAiServiceLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} containerImageTag=${{ env.IMAGE_TAG }} createdBy="Pipeline" tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}" \
148151
--query "properties.outputs" -o json)
149152
150153
echo "Deployment output: $DEPLOY_OUTPUT"

docs/ACRBuildAndPushGuide.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Azure Container Registry (ACR) – Build & Push Guide
2+
3+
This guide provides step-by-step instructions to build and push Docker images for **WebApp** and **Backend** services into Azure Container Registry (ACR).
4+
5+
## 📋 Prerequisites
6+
Before starting, ensure you have:
7+
- An active [Azure Subscription](https://portal.azure.com/)
8+
- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) installed and logged in
9+
- [Docker Desktop](https://docs.docker.com/get-docker/) installed and running
10+
- Access to your Azure Container Registry (ACR)
11+
- To create an Azure Container Registry (ACR), you can refer to the following guides:
12+
13+
- [Create Container Registry using Azure CLI](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-azure-cli)
14+
15+
- [Create Container Registry using Azure Portal](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal?tabs=azure-cli)
16+
17+
- [Create Container Registry using PowerShell](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-powershell)
18+
19+
- [Create Container Registry using ARM Template](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-geo-replication-template)
20+
21+
- [Create Container Registry using Bicep](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-bicep?tabs=CLI)
22+
23+
---
24+
25+
Login to ACR :
26+
``` bash
27+
az acr login --name $ACR_NAME
28+
```
29+
30+
## 🚀 Build and Push Images
31+
32+
**Backend :**
33+
34+
```bash
35+
az acr login --name <containerregname>
36+
docker build --no-cache -f docker/Backend.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
37+
docker push <acrloginserver>/<repo>:<tagname>
38+
```
39+
40+
If you want to update image tag and image manually you can follow below steps:
41+
- Go to your **Container App** in the [Azure Portal](https://portal.azure.com/#home).
42+
- In the left menu, select **Containers**.
43+
- Under your container, update:
44+
45+
- Image source → Azure Container Registry / Docker Hub.
46+
47+
- Image name → myapp/backend.
48+
49+
- Tag → change to the new one you pushed (e.g., v2).
50+
51+
- Click **Save** → this will create a new revision automatically with the updated image.
52+
53+
![alt text](./images/ContainerApp.png)
54+
55+
**WebApp :**
56+
57+
```bash
58+
az acr login --name <containerregname>
59+
docker build --no-cache -f docker/Frontend.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
60+
docker push <acrloginserver>/<repo>:<tagname>
61+
```
62+
63+
If you want to update image tag and image manually you can follow below steps:
64+
- Go to your App Service in the [Azure Portal](https://portal.azure.com/#home).
65+
- In the left menu, select Deployment → Deployment Center
66+
- Under Container settings, you can configure:
67+
68+
- Image Source → (e.g., Azure Container Registry / Docker Hub / Other).
69+
70+
- Image Name → e.g., myapp/backend.
71+
72+
- Tag → e.g., v1.2.3.
73+
74+
![alt text](./images/AppServiceContainer.png)
75+
76+
77+
## ✅ Verification
78+
79+
Run the following command to verify that images were pushed successfully:
80+
```bash
81+
az acr repository list --name $ACR_NAME --output table
82+
```
83+
84+
You should see repositories in the output.
85+
86+
## 📝 Notes
87+
88+
- Always use meaningful tags (v1.0.0, staging, prod) instead of just latest.
89+
90+
- If you are pushing from a CI/CD pipeline, make sure the pipeline agent has access to Docker and ACR.
91+
92+
- For private images, ensure your services (e.g., Azure Container Apps, AKS, App Service) are configured with appropriate ACR pull permissions.
93+
94+

docs/TroubleShootingSteps.md

Lines changed: 245 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# 🛠️ Troubleshooting
32
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.
43

@@ -103,13 +102,13 @@ based on available quota you can deploy application otherwise, you can request f
103102
</details>
104103

105104
<details>
106-
<summary><b>DeploymentModelNotSupported</b></summary>
105+
<summary><b>DeploymentModelNotSupported/ ServiceModelDeprecated/ InvalidResourceProperties</b></summary>
107106

108107
- 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/openai/concepts/models?tabs=global-standard%2Cstandard-chat-completions) document.
109108

110109
</details>
111110
<details>
112-
<summary><b>LinkedInvalidPropertyId/ ResourceNotFound/DeploymentOutputEvaluationFailed/ CanNotRestoreANonExistingResource </b></summary>
111+
<summary><b>LinkedInvalidPropertyId/ ResourceNotFound/DeploymentOutputEvaluationFailed/ CanNotRestoreANonExistingResource / The language expression property array index is out of bounds</b></summary>
113112

114113
- Before using any resource ID, ensure it follows the correct format.
115114
- Verify that the resource ID you are passing actually exists.
@@ -128,6 +127,8 @@ based on available quota you can deploy application otherwise, you can request f
128127
```
129128
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{name}
130129
```
130+
- You may encounter the error `The language expression property array index '8' is out of bounds` if the resource ID is incomplete. Please ensure your resource ID is correct and contains all required information, as shown in sample resource IDs.
131+
131132
- 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)
132133

133134
</details>
@@ -318,10 +319,10 @@ The subscription 'xxxx-xxxx' cannot have more than 1 Container App Environments
318319
</details>
319320

320321
<details><summary><b>ResourceProviderError</b></summary>
321-
322-
- This error occurs when the resource provider is not registered in your subscription.
323-
- To register it, refer to [Register Resource Provider](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types) documentation.
324-
322+
323+
- This error occurs when the resource provider is not registered in your subscription.
324+
- To register it, refer to [Register Resource Provider](https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-register-resource-provider?tabs=azure-cli) documentation.
325+
325326
</details>
326327

327328
<details><summary><b>Conflict - Cannot use the SKU Basic with File Change Audit for site.</b></summary>
@@ -351,6 +352,242 @@ The subscription 'xxxx-xxxx' cannot have more than 1 Container App Environments
351352

352353
</details>
353354

355+
<details><summary><b>InvalidRequestContent</b></summary>
356+
357+
- The deployment values either include values that aren't recognized, or required values are missing. Confirm the values for your resource type.
358+
- You can refer [Invalid Request Content error](https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/common-deployment-errors#:~:text=InvalidRequestContent,Template%20reference) documentation.
359+
360+
</details>
361+
362+
<details><summary><b>ReadOnlyDisabledSubscription</b></summary>
363+
364+
- Depending on the type of the Azure Subscription, the expiration date might have been reached.
365+
366+
- You have to activate the Azure Subscription before creating any Azure resource.
367+
- You can refer [Reactivate a disabled Azure subscription](https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/subscription-disabled) Documentation.
368+
369+
</details>
370+
371+
372+
<details><summary><b>SkuNotAvailable</b></summary>
373+
374+
- You receive this error in the following scenarios:
375+
- When the resource SKU you've selected, such as VM size, isn't available for a location or zone.
376+
- If you're deploying an Azure Spot VM or Spot scale set instance, and there isn't any capacity for Azure Spot in this location. For more information, see Spot error messages.
377+
</details>
378+
379+
<details><summary><b>CrossTenantDeploymentNotPermitted</b></summary>
380+
381+
- Check tenant match: Ensure your deployment identity (user/SP) and the target resource group are in the same tenant.
382+
```
383+
az account show
384+
az group show --name <RG_NAME>
385+
```
386+
387+
- Verify pipeline/service principal: If using CI/CD, confirm the service principal belongs to the same tenant and has permissions on the resource group.
388+
389+
- Avoid cross-tenant references: Make sure your Bicep doesn’t reference subscriptions, resource groups, or resources in another tenant.
390+
391+
- Test minimal deployment: Deploy a simple resource to the same resource group to confirm identity and tenant are correct.
392+
393+
- Guest/external accounts: Avoid using guest users from other tenants; use native accounts or SPs in the tenant.
394+
395+
</details>
396+
397+
<details><summary><b>RequestDisallowedByPolicy </b></summary>
398+
399+
- This typically indicates that an Azure Policy is preventing the requested action due to policy restrictions in your subscription.
400+
401+
- For more details and guidance on resolving this issue, please refer to the official Microsoft documentation: [RequestDisallowedByPolicy](https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/create-upgrade-delete/error-code-requestdisallowedbypolicy)
402+
403+
</details>
404+
405+
<details>
406+
<summary><b>FlagMustBeSetForRestore/NameUnavailable/CustomDomainInUse</b></summary>
407+
408+
- This error occurs when you try to deploy a Cognitive Services resource that was **soft-deleted** earlier.
409+
- Azure requires you to explicitly set the **`restore` flag** to `true` if you want to recover the soft-deleted resource.
410+
- If you don’t want to restore the resource, you must **purge the deleted resource** first before redeploying.
411+
Example causes:
412+
- Trying to redeploy a Cognitive Services account with the same name as a previously deleted one.
413+
- The deleted resource still exists in a **soft-delete retention state**.
414+
**How to fix:**
415+
1. If you want to restore → add `"restore": true` in your template properties.
416+
2. If you want a fresh deployment → purge the resource using:
417+
```bash
418+
az cognitiveservices account purge \
419+
--name <resource-name> \
420+
--resource-group <resource-group> \
421+
--location <location>
422+
```
423+
For more details, refer to [Soft delete and resource restore](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/delete-resource-group?tabs=azure-powershell).
424+
</details>
425+
426+
<details>
427+
<summary><b>PrincipalNotFound</b></summary>
428+
429+
- This error occurs when the **principal ID** (Service Principal, User, or Group) specified in a role assignment or deployment does not exist in the Azure Active Directory tenant.
430+
- It can also happen due to **replication delays** right after creating a new principal.
431+
**Example causes:**
432+
- The specified **Object ID** is invalid or belongs to another tenant.
433+
- The principal was recently created but Azure AD has not yet replicated it.
434+
- Attempting to assign a role to a non-existing or deleted Service Principal/User/Group.
435+
**How to fix:**
436+
1. Verify that the **principal ID is correct** and exists in the same directory/tenant.
437+
```bash
438+
az ad sp show --id <object-id>
439+
```
440+
2. If the principal was just created, wait a few minutes and retry.
441+
3. Explicitly set the principalType property (ServicePrincipal, User, or Group) in your ARM/Bicep template to avoid replication delays.
442+
4. If the principal does not exist, create it again before assigning roles.
443+
For more details, see [Azure PrincipalType documentation](https://learn.microsoft.com/en-us/azure/role-based-access-control/troubleshooting?tabs=bicep)
444+
</details>
445+
<details>
446+
<summary><b>RedundancyConfigurationNotAvailableInRegion</b></summary>
447+
448+
- This issue happens when you try to create a **Storage Account** with a redundancy configuration (e.g., `Standard_GRS`) that is **not supported in the selected Azure region**.
449+
- Example: Creating a storage account with **GRS** in **italynorth** will fail with this error.
450+
```bash
451+
az storage account create -n mystorageacct123 -g myResourceGroup -l italynorth --sku Standard_GRS --kind StorageV2
452+
```
453+
- To check supported SKUs for your region:
454+
```bash
455+
az storage account list-skus -l italynorth -o table
456+
```
457+
Use a supported redundancy option (e.g., Standard_LRS) in the same region
458+
Or deploy the Storage Account in a region that supports your chosen redundancy.
459+
For more details, refer to [Azure Storage redundancy documentation](https://learn.microsoft.com/en-us/azure/storage/common/storage-redundancy?utm_source=chatgpt.com).
460+
</details>
461+
462+
<details> <summary><b>DeploymentNotFound</b></summary>
463+
464+
- This issue occurs when the user deletes a previous deployment along with the resource group (RG), and then redeploys the same RG with the same environment name but in a different location.
465+
466+
- To avoid the DeploymentNotFound error, Do not change the location when redeploying a deleted RG, or Use new names for the RG and environment during redeployment.
467+
</details>
468+
469+
<details><summary><b>DeploymentCanceled(user.canceled)</b></summary>
470+
471+
- Indicates the deployment was manually canceled by the user (Portal, CLI, or pipeline).
472+
473+
- Check deployment history and logs to confirm who/when it was canceled.
474+
475+
- If accidental, retry the deployment.
476+
477+
- For pipelines, ensure no automation or timeout is triggering cancellation.
478+
479+
- Use deployment locks or retry logic to prevent accidental cancellations.
480+
481+
</details>
482+
483+
<details><summary><b>ResourceGroupDeletionTimeout</b></summary>
484+
485+
- Some resources in the resource group may be stuck deleting or have dependencies; check RG resources and status.
486+
487+
- Ensure no resource locks or Azure Policies are blocking deletion.
488+
489+
- Retry deletion via CLI/PowerShell `(az group delete --name <RG_NAME> --yes --no-wait)`.
490+
491+
- Check Activity Log to identify failing resources; escalate to Azure Support if deletion is stuck.
492+
493+
</details>
494+
495+
<details>
496+
<summary><b>SubscriptionDoesNotHaveServer</b></summary>
497+
498+
- This issue happens when you try to reference an **Azure SQL Server** (`Microsoft.Sql/servers`) that does not exist in the selected subscription.
499+
- It can occur if:
500+
- The SQL server name is typed incorrectly.
501+
- The SQL server was **deleted** but is still being referenced.
502+
- You are working in the **wrong subscription context**.
503+
- The server exists in a **different subscription/tenant** where you don’t have access.
504+
505+
**Reproduce:**
506+
1. Run an Azure CLI command with a non-existent server name:
507+
```bash
508+
az sql db list --server sql-doesnotexist --resource-group myResourceGroup
509+
```
510+
511+
or
512+
513+
```bash
514+
az sql server show --name sql-caqfrhxr4i3hyj --resource-group myResourceGroup
515+
516+
```
517+
518+
Resolution:
519+
520+
Verify the SQL Server name exists in your subscription:
521+
522+
```bash
523+
az sql server list --output table
524+
```
525+
Make sure you are targeting the correct subscription:
526+
527+
```bash
528+
az account show
529+
az account set --subscription <subscription-id>
530+
```
531+
If the server was deleted, either restore it (if possible) or update references to use a valid existing server.
532+
533+
</details>
534+
535+
536+
<details><summary><b>DeploymentCanceled(user.canceled)</b></summary>
537+
538+
- Indicates the deployment was manually canceled by the user (Portal, CLI, or pipeline).
539+
540+
- Check deployment history and logs to confirm who/when it was canceled.
541+
542+
- If accidental, retry the deployment.
543+
544+
- For pipelines, ensure no automation or timeout is triggering cancellation.
545+
546+
- Use deployment locks or retry logic to prevent accidental cancellations.
547+
548+
</details>
549+
550+
<details><summary><b>BadRequest - DatabaseAccount is in a failed provisioning state because the previous attempt to create it was not successful</b></summary>
551+
552+
- This error occurs when a user attempts to redeploy a resource that previously failed to provision.
553+
554+
- To resolve the issue, delete the failed deployment first, then start a new deployment.
555+
556+
- For guidance on deleting a resource from a Resource Group, refer to the following link: [Delete an Azure Cosmos DB account](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/manage-with-powershell#delete-account:~:text=%3A%24enableMultiMaster-,Delete%20an%20Azure%20Cosmos%20DB%20account,-This%20command%20deletes)
557+
558+
</details>
559+
560+
<details>
561+
562+
<summary><b>SpecialFeatureOrQuotaIdRequired</b></summary>
563+
564+
This error occurs when your subscription does not have access to certain Azure OpenAI models.
565+
566+
**Example error message:**
567+
`SpecialFeatureOrQuotaIdRequired: The current subscription does not have access to this model 'Format:OpenAI,Name:o3,Version:2025-04-16'.`
568+
569+
**Resolution:**
570+
To gain access, submit a request using the official form:
571+
👉 [Azure OpenAI Model Access Request](https://customervoice.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR7en2Ais5pxKtso_Pz4b1_xUQ1VGQUEzRlBIMVU2UFlHSFpSNkpOR0paRSQlQCN0PWcu)
572+
573+
You’ll need to use this form if you require access to the following restricted models:
574+
- gpt-5
575+
- o3
576+
- o3-pro
577+
- deep research
578+
- reasoning summary
579+
- gpt-image-1
580+
581+
Once your request is approved, redeploy your resource.
582+
583+
</details>
584+
585+
<details>
586+
<summary><b>ContainerAppOperationError</b></summary>
587+
588+
- The error is likely due to an improperly built container image. For resolution steps, refer to the [Azure Container Registry (ACR) – Build & Push Guide](./ACRBuildAndPushGuide.md)
589+
590+
</details>
354591
355592
💡 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.
356-
If the problem persists, you can also raise an bug in our [BYOC-Client Advisor Github Issues](https://github.com/microsoft/Build-your-own-copilot-Solution-Accelerator/issues) for further support.
593+
If the problem persists, you can also raise an bug in our [MACAE Github Issues](https://github.com/microsoft/Multi-Agent-Custom-Automation-Engine-Solution-Accelerator/issues) for further support.
121 KB
Loading

docs/images/ContainerApp.png

94.6 KB
Loading

0 commit comments

Comments
 (0)