Azure存储帐户位置变量/常量在哪里

时间:2019-12-24 09:16:30

标签: php azure azure-storage

我需要获取Azure存储帐户位置EG(西欧)以进行输出,但似乎无法在azure-storage-php项目中的任何位置找到它。

project location

1 个答案:

答案 0 :(得分:1)

如果您想获取位置,则有一种名为getStorageServiceProperties的获取帐户属性的方法,它将为您提供帐户地址。

但是在我的测试中,我发现它只能获得此sdk的经典存储帐户属性。如果您的帐户不是经典帐户,它将响应404 not found错误。

enter image description here

因此,如果您的帐户是经典帐户,则可以使用此方法,如果不行,则可以更改其他语言,例如dotnet,或者可以选择使用Rest API获取属性:Storage Accounts - Get Properties

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}?api-version=2019-06-01