Azure / Azure/azure-rest-api-specs
[Workloads.SAPVirtualInstance] The validation of MountFileShareConfiguration.id is incorrect
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
Hi team,
Though the last segment of Storage file share resource manager ID is defined as "/shares/" in [azure-rest-api-spec](https://github.com/Azure/azure-rest-api-specs/blob/ad997e99eccc15b7ab4cd66ae3f1f9534a1e2628/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/file.json#L234) but it's incorrect since the backend service is using "/fileshares/". I assume the last segment of Storage file share resource manager ID should be updated to "/fileshares/" in azure-rest-api-spec. Actually, there already is an [GH issue](https://github.com/Azure/azure-rest-api-specs/issues/24568) for tracking it.
In Workloads.SAPVirtualInstance API, there is a property called [MountFileShareConfiguration.id](https://github.com/Azure/azure-rest-api-specs/blob/ad997e99eccc15b7ab4cd66ae3f1f9534a1e2628/specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/SAPVirtualInstance.json#L2986) and it requires the resource manager ID of the Storage file share. But backend service always complains that the resource manager ID of the Storage file share is incorrect when I passed the resource manager ID of Storage file share with the last segment "/fileshares/" and service API throws below error message. I guess that the validation of MountFileShareConfiguration.id at the backend service is based on the definition of Storage file share resource manager ID in [azure-rest-api-spec](https://github.com/Azure/azure-rest-api-specs/blob/ad997e99eccc15b7ab4cd66ae3f1f9534a1e2628/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/file.json#L234). Hence, when the definition of Storage file share resource manager ID in [azure-rest-api-spec](https://github.com/Azure/azure-rest-api-specs/blob/ad997e99eccc15b7ab4cd66ae3f1f9534a1e2628/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/file.json#L234) is incorrect, then the validation of MountFileShareConfiguration.id is also incorrect. So I tried to update the last segment from "/fileshares/" to "/shares/" of Storage file share resource manager ID and set MountFileShareConfiguration.id to this updated Storage file share resource manager ID. Then I found the SAP Virtual Instance with Mount is created successfully without error. So I assume the validation of MountFileShareConfiguration.id needs to be updated to leverage "/fileshares/" not "/shares/" to align with the backend service, right? Thanks.
Error Message returned by service API:
```
Error: creating Sap Virtual Instance (Subscription: "xx-xx-xx-xx"
│ Resource Group Name: "acctestRG-sapvis-test02863"
│ Sap Virtual Instance Name: "X89"): unexpected status 400 with error: InvalidParameter:
│ An invalid parameter mountconfig.Id with value /subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-sapvis-test02863/providers/Microsoft.Storage/storageAccounts/acctestsatest02863/fileServices/default/fileshares/acctestsharetest02863 was passed.
│ Possible Causes: The operation failed due to an invalid input parameter.
│ Recommended Action: Review the input payload and retry the operation. If the issue persists, contact support.
```
Contributor guide
Research direction
Start with specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/file.json at the file-share resource ID definition, then inspect specification/workloads/resource-manager/Microsoft.Workloads/stable/2023-04-01/SAPVirtualInstance.json at MountFileShareConfiguration.id. Review the related Azure REST API Specs issue 24568 and confirm which segment the service validates. Done means the specification and backend validation agree on the accepted resource ID format.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100