giip

Azure Resource Group Management API Reference

API specification for listing, upserting, and deleting mappings between a project (CSN) and Azure resource groups (RGs). These are the same APIs used by the Azure Resource Group Management page.

🔌 Go to Azure Resource Group Management →

📋 Overview

The CSN↔Azure RG mapping APIs are dispatched through the giipApi endpoint via a text command. Authentication uses an AK (byAK): the server resolves the user with @ak → dbo.lwGetUSNbyat(@ak) and then verifies membership of the target CSN (tCorpUserRel/tCorpUser). Non-members receive 403.

  • Endpoint: POST https://giipfaw.azurewebsites.net/api/giipApi
  • Content-Type: application/x-www-form-urlencoded
  • Main form fields: text (command + parameter names), jsondata (parameter values as JSON), auth key
  • Binding rule: the order of parameter names in text = SP parameter order (positional); values are matched by key from jsondata.

🔍 Commands

1. List mappings — AzureRgListpApiAzureRgListbyAK

Lists the RG mappings for CSNs the current user can access.

  • text: AzureRgList csn
  • jsondata: { "csn": <CSN> } (omit for all CSNs the user belongs to)
  • Returns: rows of carSn, cSn, carResourceGroup, carSubscriptionId, carSubscriptionName, carLSsn, carNote, carStatus, carRegdt, or Proc_MSG='403|...' if unauthorized

2. Upsert a mapping — AzureRgPutpApiAzureRgPutbyAK

Registers a new mapping or updates an existing one (upsert).

  • text: AzureRgPut csn carResourceGroup carSubscriptionId carSubscriptionName carLSsn carNote carSn
  • jsondata: { "csn":<CSN>, "carResourceGroup":"rg-...", "carSubscriptionId":"...", "carSubscriptionName":"...", "carLSsn":<lssn|null>, "carNote":"...", "carSn":<set when updating> }
  • Rule: with carSn → update; without it → upsert keyed by (cSn, carResourceGroup) unique
  • Returns: Proc_MSG 200|OK / 400|... / 403|... / 404|Not found

3. Delete a mapping — AzureRgDelpApiAzureRgDelbyAK

Deletes a single mapping by carSn.

  • text: AzureRgDel carSn
  • jsondata: { "carSn": <carSn> }
  • Returns: Proc_MSG 200|OK / 403|... / 404|Not found

🛠️ Examples (cURL)

# 1) List RG mappings for CSN 47
curl -X POST "https://giipfaw.azurewebsites.net/api/giipApi" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     --data-urlencode 'text=AzureRgList csn' \
     --data-urlencode 'jsondata={"csn":47}' \
     --data-urlencode 'ak=YOUR_AK'

# 2) Register a new RG mapping
curl -X POST "https://giipfaw.azurewebsites.net/api/giipApi" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     --data-urlencode 'text=AzureRgPut csn carResourceGroup carSubscriptionId carSubscriptionName carLSsn carNote carSn' \
     --data-urlencode 'jsondata={"csn":47,"carResourceGroup":"rg-example-prod","carSubscriptionName":"prod-sub","carNote":"prod RG"}' \
     --data-urlencode 'ak=YOUR_AK'

💡 Notes

  • run.ps1 unchanged: these APIs work by adding only three SPs (pApiAzureRgListbyAK/pApiAzureRgPutbyAK/pApiAzureRgDelbyAK). The protected run.ps1 is never modified.
  • Within a CSN, the RG name is unique (UNIQUE(cSn, carResourceGroup)). Calling AzureRgPut with the same name and no carSn updates the existing row.
  • carLSsn is a cost-source hint used by the Azure Cost integration (this version provides mapping-based filtering/subtotals).

Troubleshooting

SymptomCauseFix
`Proc_MSG='403...'` returnedCaller is not a member of the target CSN
AzureRgPut returns 400Missing required value (csn/carResourceGroup)Always include csn and carResourceGroup
An existing mapping is updated unexpectedlyRe-registering the same (csn, RG) without carSnUse a new RG name to create; specify carSn to update
jsondata parse errorJSON quote escaping errorSend jsondata as valid, correctly escaped JSON
RstVal/Proc_MSG is not 200Parameter/permission issueCheck the cause code in the API Result Codes guide

Version: 1.0 Last updated: 2026-07-24 Source: giipv3/public/help/api-azure-rg.en.md


Related documents: