From 01276db3fc5ca49811ac0195a12ed2a08c2e7149 Mon Sep 17 00:00:00 2001
From: Satheeshkumar Manoharan
 <11145865+infosatheesh2020@users.noreply.github.com>
Date: Fri, 15 Dec 2023 18:54:47 +0530
Subject: [PATCH 1/2] Update main.bicep

---
 infra/main.bicep | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/infra/main.bicep b/infra/main.bicep
index 832769272..532a88aaf 100644
--- a/infra/main.bicep
+++ b/infra/main.bicep
@@ -1,4 +1,4 @@
-targetScope = 'subscription'
+targetScope = 'resourceGroup'
 
 @minLength(1)
 @maxLength(64)
@@ -40,16 +40,8 @@ param resourceGroupName string = ''
 var resourceToken = toLower(uniqueString(subscription().id, name, location))
 var tags = { 'azd-env-name': name }
 
-// Organize resources in a resource group
-resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
-  name: !empty(resourceGroupName) ? resourceGroupName : 'rg-${name}'
-  location: location
-  tags: tags
-}
-
 module resources 'resources.bicep' = {
   name: 'all-resources'
-  scope: rg
   params: {
     name: name
     resourceToken: resourceToken

From b9756d2cdcb673793330eba5a2490d9a7760c8e2 Mon Sep 17 00:00:00 2001
From: Satheeshkumar Manoharan
 <11145865+infosatheesh2020@users.noreply.github.com>
Date: Wed, 20 Dec 2023 09:16:48 +0530
Subject: [PATCH 2/2] Update README.md

---
 README.md | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 805550ad5..33b983cd4 100644
--- a/README.md
+++ b/README.md
@@ -36,13 +36,15 @@ You can deploy the application using one of the following options:
 - [1. Azure Developer CLI](#azure-developer-cli)
 - [2. Azure Portal Deployment](#azure-portal-deployment)
 
-### 1. Azure Developer CLI
+### 1. Azure Developer CLI (Resource group scoped deployment)
 
 > **Important**
 > This section will create Azure resources and deploy the solution from your local environment using the Azure Developer CLI. Note that you do not need to clone this repo to complete these steps.
 
 1. Download the [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/overview)
-1. If you have not cloned this repo, run `azd init -t microsoft/azurechat`. If you have cloned this repo, just run 'azd init' from the repo root directory.
+1. Enable Resource Group scoping for `azd` based deployments to target the deployment scope to resource group from defalt subscription scope by executing `azd config set alpha.resourceGroupDeployments on`. Note that [this feature](https://learn.microsoft.com/azure/developer/azure-developer-cli/resource-group-scoped-deployments) is still in early stages of deveopment.
+1. Set the environment variables for pointing the deployment to the resource group by running `azd env set AZURE_RESOURCE_GROUP <existing-rg-name>`. In case you don't have existing resource groups, you can create one using [Azure portal](https://learn.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal#create-resource-groups) or [CLI](https://learn.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-cli#create-resource-groups).
+1. If you have not cloned this repo, run `azd init -t microsoft/azurechat`. If you have cloned this repo, just run `azd init` from the repo root directory.
 1. Run `azd up` to provision and deploy the application
 
 ### 2. Azure Portal Deployment