Why are Azure Resource Groups associated with a specific region? - azure

I'm new to Azure architecture and am trying to understand why Azure Resource Groups, which are logical deployment buckets for applications built on Azure, are associated with a region when they are defined.
At first I thought it was to provide global distribution for disaster recovery or geographic redundancy, but then I realized that a single Resource Group can contain web apps in different regions, which can provide those features via Traffic Manager. I suppose that using separate Resource Groups would help better identify which resources are in which region, but other than for organizational purposes, I can't understand what the region definition for Resource Groups implies.
(edit: removed general advice query to be more focused)

The main reason for specifying the location of a resource group is to specify a location for data/metadata for the deployment to be stored in... It also makes the API consistent (think of the paths in REST API calls) but the primary reason is storage during deployment.
The location of the resources in the group is independent/not related to the location of the group itself.

When creating a resource group, you need to provide a location for that resource group. You may be wondering, "Why does a resource group need a location? And, if the resources can have different locations than the resource group, why does the resource group location matter at all?" The resource group stores metadata about the resources. Therefore, when you specify a location for the resource group, you are specifying where that metadata is stored. For compliance reasons, you may need to ensure that your data is stored in a particular region.
https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview

The meta data (definition) of the Azure resource group needs to be stored somewhere. hence the location. However, resources inside a resource group are location independent and can be placed in a different region\location.
Do note that dependencies between resources can exist. A Virtual machine in West Europe obviously needs a storage account in West Europe as well, but a SQL database in the same resource group can exist in West US.

Resource groups are basically for you to decide which resources in your application you want to manage together and by manage I mean you want to deploy, manage, and monitor them as a group so at a high level you do not see them as separate components.
In general in a big ecosystem, Azure resource groups are the ones that you do not see those components(resources) in them as separate entities, instead you see them as related and interdependent parts of a single entity so you put them in one Resource Group so that using the Azure Resource Group Manager tool You can deploy, update or delete all of the resources for your application in a single, coordinated operation.
You use a template for deployment and that template can work for different environments such as testing, staging and production. You can clarify billing for your organization by viewing the rolled-up costs for the entire group.
You can find more details on Azure Resource Manager here which I believe will help you better understand the idea behind the Azure Resource Groups:
https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/

Everything in Azure relates to a physical location/Datacenter, and ARM is no different. A little while ago, not every Datacenter supported ARM, so the reason for choosing made even more sense. Now, like any other Azure resource, the decision is for the user to make, often based on their required proximity to the end user and/or legal geographic requirements.

It appears there is no obvious way to determine what region a resource group is in after it has been created. This has caused me grief per the discussion here, when I ran into problems with CDN metadata conflicts. I had to start over. Now I name my resource groups with the region. e.g.: my-resourcegroup-westus

Related

How can you find all related/dependent resources in Azure?

I am working on a script to collect all resources and put them into one resource group - however, the command in Powershell used for moving resources works on a resource group by resource group basis. This means that if there are dependent/related resources in different resource groups, the command fails.
The alternative, then, is to group resources by their relation to one another and move them using some other method (probably manually through the portal/REST API.)
How can one then go through a list of resources in a subscription and group them by their dependency/relations?
IMHO one of the reason to introduce resource group is to try avoid such situation / scenario i.e., as per this Azure document, a resource group is a container that holds related resources for an Azure solution.
I believe a straight forward way or feature (to get list of dependent / related resources that are sitting in different resource groups in a subscription and group them by their dependency/relations) is currently not available or not supported. But I see this feature request raised in UserVoice / feedback forum as a related one so if interested, you may upvote it or create a new feedback in there. In general, responsible Azure product / feature team would triage / start checking feasibility and prioritizing a received feedback based on various factors like number of votes a feedback receives, feasibility, open prioritized backlog items, etc.
On the other hand, as a workaround to accomplish this requirement for now, I suggest to try coming up with an automation (to get list of dependent / related resources that are sitting in different resource groups in a subscription and group them by their dependency/relations) by leveraging Azure Platform logs (and fetching those logs at a particular time window of operation) as those logs provide detailed diagnostic and auditing information for Azure resources and the Azure platform they depend on.
Other related references:
Move resources to a new resource group or subscription
Move operation support for resources
Troubleshoot moving Azure resources to new resource group or subscription

What is the right way to create development and production environments for a network of servers in Azure?

I want to deploy multiple machines across various geographical regions to serve my application in a Development and Production environment; I'm coming from Google Cloud Platform where my solution would be to create 2 projects:
project-dev
project-prod
With that I have complete freedom of creating resources in any region/zone in either project/environment.
The closest thing to this I have found on Azure is Resource Groups, but those are tied to a specified region, which is not ideal for me. Is there a better way, rather than creating a resource group in EACH region I choose to deploy resources for both environments as follows:
project-dev-east-us
project-dev-west-us
project-dev-west-eu
project-dev-east-as
project-prod-east-us
project-prod-west-us
project-prod-west-eu
project-prod-east-as
Resource groups are tied to regions, but resource inside are not, so you can have resources from multiple regions in a single resource group. but resource group is like a folder on a hard drive. its just a way to logically organize things, nothing more.

Resource Group, Storage Account and Availability Set in Microsoft Azure

Recently I started to use Microsoft Azure Free Trial and I have gone through the link
I created a VM with the help of references. Also I read about Resource Group, Storage Account and Availability Set but I couldn’t understand the requirement and differences among all.
Please be kind to explain the requirement and differences among Resource Group, Storage Account and Availability Set.
In my opinion, these three resources are the logic resources, solutions for some requirement.
The Resource Group is the basic solution for you to manage other resources in the ARM module. As the definition shows:
A container that holds related resources for an Azure solution. The
resource group includes those resources that you want to manage as a
group. You decide how to allocate resources to resource groups based
on what makes the most sense for your organization
The Storage Account, you can also think it as a logic group for storage, a storage solution. It defines some types for different data requirement. And finally, the data still will be stored in the physical disk.
Azure Storage offers a massively scalable object store for data
objects, a file system service for the cloud, a messaging store for
reliable messaging, and a NoSQL store.
The Availability Set, it's a solution for the high availability. Create resources in the
Availability Set. It will help you avoid some accidents without downtime. Also, it can Prevent some erroneous operations from expanding with the update domain and fault domain. In one word, it provides redundancy to your application.
update
As you ask in the comment, first, when you create the VM, the resource group is necessary. But the Availability Set is not necessary, it just created for the high availability. You can create it or not, all dependant on your requirement.
For the storage account, there are two points I think you should pay attention to.
One is that the storage account is just for the unmanaged VM, to store the OS disk as a VHD file that you can manage it yourself. If you create a managed VM, the storage account is not needed to you.
Another is that the storage account also can store the logs, such as the diagnostic log. If you do not want to store the logs, the storage account is also not needed to you.
Note: If needed, you could just create one storage account to store the unmanaged VM OS disk and the logs as you want.

How can I create an architecture where I have multiple resource groups sharing one single database server on Azure?

I want to create one single database server for all the resource groups I have created. Earlier, I have used one database server for each resource group but now I wish to have only one server for all the resource groups.
I must say, I believe your former setup more closely follows best practices. Having one server for each resource group allows you to scale each one independent of each other and monitor/configure independently. But to answer your question, every resource in Azure must belong to a resource group. You can create a common resource group and create the SQL db/server under that. Other resources in other groups will still be able to access it.

What effect does selecting an app service location in Azure have on a web app?

I am creating a new web app in a new Azure account. I have set up a few resource groups for different geographical locations.
When I am creating the web app, I select the appropriate resource group but it also wants me to specify a service plan for the app.
I kinda get the difference between a resource group and service plan, but why is it forcing me to choose a geographical location for the service plan when I have already identified the one I want in the resource?
Am I right in thinking the web app will be physically located in the region selected for the resource? If so, what effect does selecting a different region for the service plan have?
A resource group is simply a naming/permissions/billing container. Like other Azure resources, you must choose a region for your resource group. However, this has zero to do with the region for the resources within the resource group.
An App Service Plan's region is where the web apps within that service plan will run. There are no rules that say it must be in the same region as the resource group (you can place either one in any region). Further: You do not need to colocate services within a resource group in the same region (though splitting them across region will have latency/bandwidth/cost implications).

Resources