Azure Storage Accounts: Get Storage Account Properties and Endpoints
See more Azure Storage Accounts Examples
Reads an account by subscription, resource group, and account name. Displays string resource IDs, service endpoints, provisioning state, and selected security settings. Missing or null policy properties are reported as unspecified rather than treated as false. Consult the relevant service default when interpreting these fields. Account properties do not include access keys and do not establish that this identity can access stored data.
These calls manage Azure resources at management.azure.com. They do not upload or download stored data. Supply a current Microsoft Entra access token for Azure Resource Manager in private qa_data/tokens/azureToken.json, with a nonempty access_token string. For v2 client credentials, request https://management.azure.com/.default; obtain a new token when it expires. A storage account key, SAS, Microsoft Graph token, or Storage data-plane token is not an ARM token. Never print the token or commit its file.
Azure RBAC must grant the caller the required management actions at the appropriate scope. An app registration alone does not grant resource access. Management permissions and blob/file data permissions are distinct. These examples target public Azure; sovereign clouds require the corresponding authority, ARM endpoint, token audience, and continuation-host validation.
Chilkat Xojo Plugin Downloads
Dim success As Boolean
success = False
// This example requires the Chilkat API to have been previously unlocked.
// See Global.UnlockBundle for sample code.
// This is Azure Resource Manager (the management plane), not a blob data request.
// Load an unexpired Microsoft Entra token whose audience is Azure Resource Manager.
// For the v2 token endpoint, request scope https://management.azure.com/.default.
// Keep the token file private and out of source control and public web directories.
Dim token As New Chilkat.JsonObject
token.Strict = True
success = token.LoadFile("qa_data/tokens/azureToken.json")
If (success <> True) Then
System.DebugLog("Could not load the private Azure Resource Manager token file.")
Return
End If
If ((token.JsonTypeOf("access_token") <> 1) Or (token.StringOfEquals("access_token","",True) = True)) Then
System.DebugLog("A nonempty access_token string is required.")
Return
End If
// Use your subscription ID as a string. The all-zero value is only a placeholder.
Dim subscriptionId As String
subscriptionId = "00000000-0000-0000-0000-000000000000"
Dim http As New Chilkat.Http
http.AuthToken = token.StringOf("access_token")
http.Accept = "application/json"
http.RequireSslCertVerify = True
http.FollowRedirects = False
http.ConnectTimeout = 30
http.ReadTimeout = 60
success = http.SetUrlVar("subscriptionId",subscriptionId)
If (success <> True) Then
System.DebugLog("Could not encode subscription ID.")
Return
End If
Dim response As New Chilkat.HttpResponse
Dim result As New Chilkat.JsonObject
result.Strict = True
Dim parsed As New Chilkat.Url
Dim resourceGroupName As String
resourceGroupName = "my-resource-group"
success = http.SetUrlVar("resourceGroupName",resourceGroupName)
If (success <> True) Then
System.DebugLog("Could not encode resource group.")
Return
End If
Dim accountName As String
accountName = "youruniquestorageaccount"
success = http.SetUrlVar("accountName",accountName)
If (success <> True) Then
System.DebugLog("Could not encode account name.")
Return
End If
Dim resourceUrl As String
resourceUrl = "https://management.azure.com/subscriptions/{$subscriptionId}/resourceGroups/{$resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{$accountName}?api-version=2026-09-01"
success = http.HttpNoBody("GET",resourceUrl,response)
If (response.StatusCode = 0) Then
System.DebugLog("No HTTP response. Inspect LastErrorText privately; it may contain credentials.")
Return
End If
If ((response.StatusCode <> 200)) Then
System.DebugLog("HTTP status: " + Str(response.StatusCode))
System.DebugLog("Request ID: " + response.GetHeaderField("x-ms-request-id"))
System.DebugLog("Retry-After: " + response.GetHeaderField("Retry-After"))
// Inspect the error body privately. Do not log tokens, headers, or full responses.
// For 401 check the token/audience; for 403 check Azure RBAC and policy.
// Honor Retry-After for 429 and use bounded backoff for transient failures.
Return
End If
If (success <> True) Then
System.DebugLog("The HTTP response could not be read completely.")
Return
End If
success = result.Load(response.BodyStr)
If (success <> True) Then
System.DebugLog("Expected a well-formed JSON response.")
Return
End If
If (result.JsonTypeOf("id") <> 1) Then
System.DebugLog("Missing or invalid id.")
Return
End If
If (result.JsonTypeOf("name") <> 1) Then
System.DebugLog("Missing or invalid name.")
Return
End If
If (result.JsonTypeOf("id") = 1) Then
System.DebugLog("Resource ID: " + result.StringOf("id"))
End If
If (result.JsonTypeOf("name") = 1) Then
System.DebugLog("Name: " + result.StringOf("name"))
End If
If (result.JsonTypeOf("location") = 1) Then
System.DebugLog("Location: " + result.StringOf("location"))
End If
If (result.JsonTypeOf("kind") = 1) Then
System.DebugLog("Kind: " + result.StringOf("kind"))
End If
If (result.JsonTypeOf("sku.name") = 1) Then
System.DebugLog("SKU: " + result.StringOf("sku.name"))
End If
If (result.JsonTypeOf("properties.provisioningState") = 1) Then
System.DebugLog("Provisioning state: " + result.StringOf("properties.provisioningState"))
End If
If (result.JsonTypeOf("properties.primaryEndpoints.blob") = 1) Then
System.DebugLog("Blob endpoint: " + result.StringOf("properties.primaryEndpoints.blob"))
End If
If (result.JsonTypeOf("properties.primaryEndpoints.file") = 1) Then
System.DebugLog("File endpoint: " + result.StringOf("properties.primaryEndpoints.file"))
End If
If (result.JsonTypeOf("properties.minimumTlsVersion") = 1) Then
System.DebugLog("Minimum TLS: " + result.StringOf("properties.minimumTlsVersion"))
End If
If (result.JsonTypeOf("properties.publicNetworkAccess") = 1) Then
System.DebugLog("Public network access: " + result.StringOf("properties.publicNetworkAccess"))
End If
If (result.JsonTypeOf("properties.supportsHttpsTrafficOnly") = 5) Then
System.DebugLog("HTTPS only: " + Str(result.BoolOf("properties.supportsHttpsTrafficOnly")))
Else
System.DebugLog("HTTPS only: not explicitly set; consult the service default.")
End If
If (result.JsonTypeOf("properties.allowBlobPublicAccess") = 5) Then
System.DebugLog("Anonymous blob access allowed: " + Str(result.BoolOf("properties.allowBlobPublicAccess")))
Else
System.DebugLog("Anonymous blob access allowed: not explicitly set; consult the service default.")
End If
If (result.JsonTypeOf("properties.allowSharedKeyAccess") = 5) Then
System.DebugLog("Shared Key allowed: " + Str(result.BoolOf("properties.allowSharedKeyAccess")))
Else
System.DebugLog("Shared Key allowed: not explicitly set; consult the service default.")
End If