I am trying to generate the Azure Resource Name using Azure Naming tool API. The tool is deployed into Linux VM from CloudAdoptionFramework/ready/AzNamingTool at master · microsoft/CloudAdoptionFramework (github.com)Generating the names manually with the tool works good. But when i try to generate the name using the API, it gives error.
Request body ResourceNameRequest (json) - Resource Name Request data{ 'ResourceEnvironment': 'prd', 'ResourceInstance': '2', 'ResourceType': 'vm' } I get an error saying ResourceType field required. I tried changing the resource type to microsft.compute/virtualmachines , compute, virtual machine but did not work.
I observed the same issue with resource types like vmss, api, app, by referring the below document.Abbreviation examples for Azure resources - Cloud Adoption Framework | Microsoft Learn
Unsuccessful call :
------------------
Request body
{
"request": [
{
"resourceType": "vm",
"resourceUnitDept": "sud",
"resourceProjAppSvc": "spa",
"resourceFunction": "func",
"resourceEnvironment": "dev",
"resourceLocation": "ac",
"resourceInstance": "1"
},
{
"resourceId": 0,
"createdBy": "string"
}
]
}
Server response
Error: Bad Request
{ "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title": "One or more validation errors occurred.", "status": 400, "traceId": "00-537c088c754bd9824432d838b540bf35-5fa99721639c3c36-00", "errors": { "ResourceType": [ "The ResourceType field is required." ] } }
Successful call :
==========
Request body :
{
"ResourceEnvironment": "prd",
"ResourceInstance": "6",
"ResourceLocation": "eu",
"ResourceProjAppSvc": "spa",
"ResourceType": "redis"
}
Response body :
==========
{
"resourceName": "redis-spa-prd-eu-6",
"message": "",
"success": true,
"resourceNameDetails": {
"id": 7,
"createdOn": "2023-08-02T13:32:18.6596776+00:00",
"resourceName": "redis-spa-prd-eu-6",
"resourceTypeName": "Cache/Redis",
"components": [
[
"ResourceType",
"redis"
],
[
"ResourceProjAppSvc",
"spa"
],
[
"ResourceEnvironment",
"prd"
],
[
"ResourceLocation",
"eu"
],
[
"ResourceInstance",
"6"
]
],
"user": "API"
}
}
Tried changing the case of the ResourceType
field, but it still didn't work.
I'm struggling to locate the API documentation for the Azure Naming tool. Could someone please point me in the right direction or provide a link if available? Your assistance would be greatly appreciated.