ストレージ アカウントの冗長性レベルを変更するために、アカウント移行要求をトリガーできます。 この移行では、信頼性と可用性を向上させるために、ゾーン冗長以外のストレージ アカウントをゾーン冗長アカウントに更新するか、またはその逆に更新します。 ゾーン冗長ストレージ (ZRS) は、プライマリ リージョンの 3 つの Azure 可用性ゾーン間でストレージ アカウントを同期的にレプリケートします。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration?api-version=2023-01-01
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
accountName
|
path |
True
|
string
|
指定したリソース グループ内のストレージ アカウントの名前。 ストレージ アカウント名の長さは 3 ~ 24 文字で、数字と小文字のみを使用する必要があります。
Regex pattern: ^[a-z0-9]+$
|
resourceGroupName
|
path |
True
|
string
|
ユーザーのサブスクリプション内のリソース グループの名前。 名前の大文字と小文字は区別されます。
Regex pattern: ^[-\w\._\(\)]+$
|
subscriptionId
|
path |
True
|
string
|
ターゲット サブスクリプションの ID。
|
api-version
|
query |
True
|
string
|
この操作に使用する API バージョン。
|
要求本文
名前 |
必須 |
型 |
説明 |
properties.targetSkuName
|
True
|
SkuName
|
アカウントのターゲット SKU 名
|
name
|
|
string
|
現在の値は、顧客が開始した移行の "既定値" です
|
type
|
|
string
|
'accountMigrations' である ARM コントラクトの SrpAccountMigrationType
|
応答
名前 |
型 |
説明 |
200 OK
|
|
OK -- 要求が移行要求を検証するためだけにある場合に返され、実際には移行は開始されません。現在、リージョン間の移行に適用できます。
|
202 Accepted
|
|
受け入れ済み -- 移行要求が受け入れられます。操作は非同期的に完了します。
Headers
Location: string
|
Other Status Codes
|
ErrorResponse
|
操作に失敗した理由を説明するエラー応答。
|
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名前 |
説明 |
user_impersonation
|
ユーザー アカウントの借用
|
例
StorageAccountPostMigration
Sample Request
POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/startAccountMigration?api-version=2023-01-01
{
"properties": {
"targetSkuName": "Standard_ZRS"
}
}
import com.azure.resourcemanager.storage.fluent.models.StorageAccountMigrationInner;
import com.azure.resourcemanager.storage.models.SkuName;
/** Samples for StorageAccounts CustomerInitiatedMigration. */
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountPostMigration.
* json
*/
/**
* Sample code: StorageAccountPostMigration.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void storageAccountPostMigration(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getStorageAccounts().customerInitiatedMigration(
"resource-group-name", "accountname",
new StorageAccountMigrationInner().withTargetSkuName(SkuName.STANDARD_ZRS),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python storage_account_post_migration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
client.storage_accounts.begin_customer_initiated_migration(
resource_group_name="resource-group-name",
account_name="accountname",
parameters={"properties": {"targetSkuName": "Standard_ZRS"}},
).result()
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountPostMigration.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0baf811c3c76c87b3c127d098519bd97141222dd/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountPostMigration.json
func ExampleAccountsClient_BeginCustomerInitiatedMigration() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armstorage.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAccountsClient().BeginCustomerInitiatedMigration(ctx, "resource-group-name", "accountname", armstorage.AccountMigration{
StorageAccountMigrationDetails: &armstorage.AccountMigrationProperties{
TargetSKUName: to.Ptr(armstorage.SKUNameStandardZRS),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.
*
* @summary Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountPostMigration.json
*/
async function storageAccountPostMigration() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "resource-group-name";
const accountName = "accountname";
const parameters = { targetSkuName: "Standard_ZRS" };
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.storageAccounts.beginCustomerInitiatedMigrationAndWait(
resourceGroupName,
accountName,
parameters
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
location: https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Storage/locations/eastus/operationResults/00000000-0000-0000-0000-000000000000?api-version=2022-09-01
定義
ErrorResponse
ストレージ リソース プロバイダーからのエラー応答。
ErrorResponseBody
エラー応答本文コントラクト。
名前 |
型 |
説明 |
code
|
string
|
エラーの識別子。 コードは不変であり、プログラムによって使用されることを意図しています。
|
message
|
string
|
ユーザー インターフェイスでの表示に適したエラーを説明するメッセージ。
|
migrationStatus
移行の現在の状態
名前 |
型 |
説明 |
Complete
|
string
|
|
Failed
|
string
|
|
InProgress
|
string
|
|
Invalid
|
string
|
|
SubmittedForConversion
|
string
|
|
SkuName
SKU 名。 アカウントの作成に必要です。更新の場合は省略可能です。 以前のバージョンでは、SKU 名は accountType と呼ばれることに注意してください。
名前 |
型 |
説明 |
Premium_LRS
|
string
|
|
Premium_ZRS
|
string
|
|
Standard_GRS
|
string
|
|
Standard_GZRS
|
string
|
|
Standard_LRS
|
string
|
|
Standard_RAGRS
|
string
|
|
Standard_RAGZRS
|
string
|
|
Standard_ZRS
|
string
|
|
StorageAccountMigration
現在の SKU またはリージョンを更新するために、進行中またはエンキューされたストレージ アカウントの移行に関連付けられているパラメーターまたは状態。
名前 |
型 |
説明 |
id
|
string
|
移行リソース ID
|
name
|
string
|
現在の値は、顧客が開始した移行の "既定値" です
|
properties.migrationFailedDetailedReason
|
string
|
移行エラーの理由
|
properties.migrationFailedReason
|
string
|
移行エラーのエラー コード
|
properties.migrationStatus
|
migrationStatus
|
移行の現在の状態
|
properties.targetSkuName
|
SkuName
|
アカウントのターゲット SKU 名
|
type
|
string
|
'accountMigrations' である ARM コントラクトの SrpAccountMigrationType
|