Is there any way to get azure Resource ID for azure storage using azure storage connection string with rest API or any other programmatically in c#.
I need subscriptionId and resourceGroupName of the storage account
Is there any way to get azure Resource ID for azure storage using azure storage connection string with rest API or any other programmatically in c#.
I need subscriptionId and resourceGroupName of the storage account
Is there any way to get azure Resource ID for azure storage using azure storage connection string with rest API or any other programmatically in c#.
Using the connection string, it is not possible to get the resource id for a storage account. With connection string, you can perform data related operations on the storage account (also known as data plane operations). For resource id, you would need to perform management operation on the storage account (also known as control plane operations).
To get the resource id, you would need to use Storage Resource Provider REST API
. The SDK you would want to use is Azure.ResourceManager.Storage
.
However if you know the your Azure Subscription id, the name of the resource group where your storage account is and (obviously) the name of your storage account, you can construct the resource id using the following convention:
/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.Storage/storageAccounts/{storage-account-name}