3

Is there an absolute maximum length of Azure Resource IDs, independent of the resource type?

Some parts of the structure are fixed (like subscription id) and others like group and resource name have documented limits. But RP namespace and resource types seem to add some unknown into the mix.

/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}
silent
  • 14,494
  • 4
  • 46
  • 86
  • 1
    i dont think you will find an answer for this, remember there can be endless subresources – 4c74356b41 Feb 13 '23 at 15:52
  • Good point about the child resources. But still, I was wondering whether maybe there is a limit that is document somewhere because of some underlying storage limitation. So let's see if anybody comes up with something – silent Feb 13 '23 at 15:59
  • The resource IDs are part of a URL so there could be a limit on the URL length at some point? – juunas Feb 13 '23 at 18:01
  • If you are trying to store `resourceid` you can guesstimate the max char and every time before insert you may log the length checks. @juunas Although these look like part of URLs they are not. See [this](https://stackoverflow.com/questions/53192808/azure-resource-identifier-format-uri-url-or-urn). – Rajesh Swarnkar Mar 14 '23 at 10:18

1 Answers1

1

There is no official documentation which specifies the max character limit for Azure Resource ID.

Note: So this is not the answer, but an attempt to answer.

Fully qualified resource IDs for the resources have format as mentioned in docs:

/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

Also, this doc specifies the max allowed limits:

  • subscriptionId: 36
  • resourceGroupName: 90
  • longest entry for resourceProviderNamespace as per docs is: 45, but may be assume it to be 64 chars.
  • resourceType: These can't be guessed. Although there is command to list the types. And Assume it to be about 256 chars.
  • resourceName: 512 chars after a quick look at the docs.
fields Approx. chars
subscriptionId 36
resourceGroupName 90
resourceProviderNamespace 64
resourceType 256
resourceName 512
fixed chars 44
Total 1002

Warning: This is an educated guess. You're welcome to improve or quote the official figure, if available in future.

Rajesh Swarnkar
  • 601
  • 1
  • 6
  • 18