Abort live Migration of storage account to enable Hns
POST https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration?api-version=2023-01-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]+$
|
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
|
|
OK -- Returned when the storage account migration to hierarchical namespace is aborted.
|
202 Accepted
|
|
Accepted -- Abort hierarchical namespace migration request accepted; operation will complete asynchronously.
|
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
StorageAccountAbortHierarchicalNamespaceMigration
Sample Request
POST https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/res4228/providers/Microsoft.Storage/storageAccounts/sto2434/aborthnsonmigration?api-version=2023-01-01
/** Samples for StorageAccounts AbortHierarchicalNamespaceMigration. */
public final class Main {
/*
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/
* StorageAccountAbortHierarchicalNamespaceMigration.json
*/
/**
* Sample code: StorageAccountAbortHierarchicalNamespaceMigration.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void
storageAccountAbortHierarchicalNamespaceMigration(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getStorageAccounts()
.abortHierarchicalNamespaceMigration("res4228", "sto2434", 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_abort_hierarchical_namespace_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_abort_hierarchical_namespace_migration(
resource_group_name="res4228",
account_name="sto2434",
).result()
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountAbortHierarchicalNamespaceMigration.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/0baf811c3c76c87b3c127d098519bd97141222dd/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountAbortHierarchicalNamespaceMigration.json
func ExampleAccountsClient_BeginAbortHierarchicalNamespaceMigration() {
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().BeginAbortHierarchicalNamespaceMigration(ctx, "res4228", "sto2434", 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 Abort live Migration of storage account to enable Hns
*
* @summary Abort live Migration of storage account to enable Hns
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/StorageAccountAbortHierarchicalNamespaceMigration.json
*/
async function storageAccountAbortHierarchicalNamespaceMigration() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res4228";
const accountName = "sto2434";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.storageAccounts.beginAbortHierarchicalNamespaceMigrationAndWait(
resourceGroupName,
accountName
);
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://endpoint:port/subscriptions/{subscription-id}/providers/Microsoft.Storage/locations/{location}/asyncoperations/{operationid}?monitor=true&api-version=2022-09-01
Definitions
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.
|