Gets the status of the ongoing migration for the specified storage account.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/default?api-version=2023-05-01
URI Parameters
Name |
In |
Required |
Type |
Description |
accountName
|
path |
True
|
string
|
The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
Regex pattern: ^[a-z0-9]+$
|
migrationName
|
path |
True
|
MigrationName
|
The name of the Storage Account Migration. It should always be 'default'
Regex pattern: ^[a-z][a-z0-9]*$
|
resourceGroupName
|
path |
True
|
string
|
The name of the resource group within the user's subscription. The name is case insensitive.
Regex pattern: ^[-\w\._\(\)]+$
|
subscriptionId
|
path |
True
|
string
|
The ID of the target subscription.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Responses
Name |
Type |
Description |
200 OK
|
StorageAccountMigration
|
OK -- Get the details of the ongoing or completed migration successfully.
|
Other Status Codes
|
ErrorResponse
|
Error response describing why the operation failed.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
StorageAccountGetMigrationFailed
Sample request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default?api-version=2023-05-01
import com.azure.resourcemanager.storage.models.MigrationName;
/**
* Samples for StorageAccounts GetCustomerInitiatedMigration.
*/
public final class Main {
/*
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/
* StorageAccountGetMigrationFailed.json
*/
/**
* Sample code: StorageAccountGetMigrationFailed.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void storageAccountGetMigrationFailed(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getStorageAccounts()
.getCustomerInitiatedMigrationWithResponse("resource-group-name", "accountname", MigrationName.DEFAULT,
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 typing import TYPE_CHECKING, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python storage_account_get_migration_failed.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}",
)
response = client.storage_accounts.get_customer_initiated_migration(
resource_group_name="resource-group-name",
account_name="accountname",
migration_name="default",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationFailed.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/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/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationFailed.json
func ExampleAccountsClient_GetCustomerInitiatedMigration_storageAccountGetMigrationFailed() {
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)
}
res, err := clientFactory.NewAccountsClient().GetCustomerInitiatedMigration(ctx, "resource-group-name", "accountname", armstorage.MigrationNameDefault, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AccountMigration = armstorage.AccountMigration{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/accountMigrations"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default"),
// StorageAccountMigrationDetails: &armstorage.AccountMigrationProperties{
// MigrationFailedDetailedReason: to.Ptr("ZRS is not supported for accounts with archive data."),
// MigrationFailedReason: to.Ptr("ZrsNotSupportedForAccountWithArchiveData"),
// MigrationStatus: to.Ptr(armstorage.MigrationStatusFailed),
// TargetSKUName: to.Ptr(armstorage.SKUNameStandardZRS),
// },
// }
}
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 Gets the status of the ongoing migration for the specified storage account.
*
* @summary Gets the status of the ongoing migration for the specified storage account.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationFailed.json
*/
async function storageAccountGetMigrationFailed() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "resource-group-name";
const accountName = "accountname";
const migrationName = "default";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.storageAccounts.getCustomerInitiatedMigration(
resourceGroupName,
accountName,
migrationName,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationFailed.json
// this example is just showing the usage of "StorageAccounts_GetCustomerInitiatedMigration" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://zcusa.951200.xyz/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this StorageAccountResource created on azure
// for more information of creating StorageAccountResource, please refer to the document of StorageAccountResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "resource-group-name";
string accountName = "accountname";
ResourceIdentifier storageAccountResourceId = StorageAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
StorageAccountResource storageAccount = client.GetStorageAccountResource(storageAccountResourceId);
// get the collection of this StorageAccountMigrationResource
StorageAccountMigrationCollection collection = storageAccount.GetStorageAccountMigrations();
// invoke the operation
StorageAccountMigrationName migrationName = StorageAccountMigrationName.Default;
NullableResponse<StorageAccountMigrationResource> response = await collection.GetIfExistsAsync(migrationName);
StorageAccountMigrationResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
StorageAccountMigrationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
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
{
"id": "/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default",
"name": "default",
"type": "Microsoft.Storage/storageAccounts/accountMigrations",
"properties": {
"targetSkuName": "Standard_ZRS",
"migrationStatus": "Failed",
"migrationFailedReason": "ZrsNotSupportedForAccountWithArchiveData",
"migrationFailedDetailedReason": "ZRS is not supported for accounts with archive data."
}
}
StorageAccountGetMigrationInProgress
Sample request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default?api-version=2023-05-01
import com.azure.resourcemanager.storage.models.MigrationName;
/**
* Samples for StorageAccounts GetCustomerInitiatedMigration.
*/
public final class Main {
/*
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/
* StorageAccountGetMigrationInProgress.json
*/
/**
* Sample code: StorageAccountGetMigrationInProgress.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void storageAccountGetMigrationInProgress(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getStorageAccounts()
.getCustomerInitiatedMigrationWithResponse("resource-group-name", "accountname", MigrationName.DEFAULT,
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 typing import TYPE_CHECKING, Union
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python storage_account_get_migration_in_progress.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}",
)
response = client.storage_accounts.get_customer_initiated_migration(
resource_group_name="resource-group-name",
account_name="accountname",
migration_name="default",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationInProgress.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/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/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationInProgress.json
func ExampleAccountsClient_GetCustomerInitiatedMigration_storageAccountGetMigrationInProgress() {
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)
}
res, err := clientFactory.NewAccountsClient().GetCustomerInitiatedMigration(ctx, "resource-group-name", "accountname", armstorage.MigrationNameDefault, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.AccountMigration = armstorage.AccountMigration{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/accountMigrations"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default"),
// StorageAccountMigrationDetails: &armstorage.AccountMigrationProperties{
// MigrationStatus: to.Ptr(armstorage.MigrationStatusInProgress),
// TargetSKUName: to.Ptr(armstorage.SKUNameStandardZRS),
// },
// }
}
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 Gets the status of the ongoing migration for the specified storage account.
*
* @summary Gets the status of the ongoing migration for the specified storage account.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationInProgress.json
*/
async function storageAccountGetMigrationInProgress() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "resource-group-name";
const accountName = "accountname";
const migrationName = "default";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.storageAccounts.getCustomerInitiatedMigration(
resourceGroupName,
accountName,
migrationName,
);
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
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/StorageAccountGetMigrationInProgress.json
// this example is just showing the usage of "StorageAccounts_GetCustomerInitiatedMigration" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://zcusa.951200.xyz/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this StorageAccountResource created on azure
// for more information of creating StorageAccountResource, please refer to the document of StorageAccountResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "resource-group-name";
string accountName = "accountname";
ResourceIdentifier storageAccountResourceId = StorageAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
StorageAccountResource storageAccount = client.GetStorageAccountResource(storageAccountResourceId);
// get the collection of this StorageAccountMigrationResource
StorageAccountMigrationCollection collection = storageAccount.GetStorageAccountMigrations();
// invoke the operation
StorageAccountMigrationName migrationName = StorageAccountMigrationName.Default;
NullableResponse<StorageAccountMigrationResource> response = await collection.GetIfExistsAsync(migrationName);
StorageAccountMigrationResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine($"Succeeded with null as result");
}
else
{
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
StorageAccountMigrationData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
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
{
"id": "/subscriptions/{subscription-id}/resourceGroups/resource-group-name/providers/Microsoft.Storage/storageAccounts/accountname/accountMigrations/default",
"name": "default",
"type": "Microsoft.Storage/storageAccounts/accountMigrations",
"properties": {
"targetSkuName": "Standard_ZRS",
"migrationStatus": "InProgress"
}
}
Definitions
Name |
Description |
ErrorResponse
|
An error response from the storage resource provider.
|
ErrorResponseBody
|
Error response body contract.
|
MigrationName
|
The name of the Storage Account Migration. It should always be 'default'
|
migrationStatus
|
Current status of migration
|
SkuName
|
The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.
|
StorageAccountMigration
|
The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region.
|
ErrorResponse
An error response from the storage resource provider.
Name |
Type |
Description |
error
|
ErrorResponseBody
|
Azure Storage Resource Provider error response body.
|
ErrorResponseBody
Error response body contract.
Name |
Type |
Description |
code
|
string
|
An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
|
message
|
string
|
A message describing the error, intended to be suitable for display in a user interface.
|
MigrationName
The name of the Storage Account Migration. It should always be 'default'
Name |
Type |
Description |
default
|
string
|
|
migrationStatus
Current status of migration
Name |
Type |
Description |
Complete
|
string
|
|
Failed
|
string
|
|
InProgress
|
string
|
|
Invalid
|
string
|
|
SubmittedForConversion
|
string
|
|
SkuName
The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.
Name |
Type |
Description |
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
The parameters or status associated with an ongoing or enqueued storage account migration in order to update its current SKU or region.
Name |
Type |
Description |
id
|
string
|
Migration Resource Id
|
name
|
string
|
current value is 'default' for customer initiated migration
|
properties.migrationFailedDetailedReason
|
string
|
Reason for migration failure
|
properties.migrationFailedReason
|
string
|
Error code for migration failure
|
properties.migrationStatus
|
migrationStatus
|
Current status of migration
|
properties.targetSkuName
|
SkuName
|
Target sku name for the account
|
type
|
string
|
SrpAccountMigrationType in ARM contract which is 'accountMigrations'
|