Azure Gov -Storage Account related wierdness

Daniel Klobnak 256 Reputation points
2021-03-04T01:19:56.703+00:00

Why walk when one can run?
So first question - nube - is there a way to determine if a resource is 'classic' versus managed? Easily.

Here is the fun part, get yourself a cocktail or a pillow. If nothing else this is my notes.

Situation: customer had stood up a Commercial Azure Tenant etc. Now they need to put it in a Gov tenant.

KEY THING: this is moving between Tenants (one being Gov). I stress this as a lot of info out there seems to confuse tenants with subscriptions. I have seen where one can migrate subscriptions (and I assume by extension the related (some) resources) between tenants, but with the Gov, no Bueno.

As I found out MS Migrate and ASR are not supported for these types of operations. Migrate does not have an option between Azure tenants (which I find nuts), and ASR does not support - so if someone has some links or advise about setting ASR up to do this, but will want to tear down shortly after, that would be great.

SO, I did locate some ideas about exporting VHDs (not snapshots) and then using AZcopy to upload to storage on the Gov tenant. Of course, the AZcopy command has changed a bit, so - like every other step - there was a bit of nonsense.

Today I was working from a few ideas on creating a PowerShell script to create the Virtual Machines based on the hard drives I copied over.

So as I worked through the elements, etc. I came across a few challenges, as there have been some changes to the commands, but so far so good. The focus has been on developing the script.

BUT Crazy when attempting to create the Azure disks from the file in the blob. Basically, as I worked through some of the steps, and progressed I was hit with a new required argument for imports, which is to include the StorageAccountID. Outlined here:
https://learn.microsoft.com/en-us/rest/api/compute/disks/createorupdate

Now is a good time to mention everything I was doing was through the PowerShell provided by the tenant versus a local instance of PowerShell. So, one would expect MS own PowerShell to be as properly UpToDate as possible.

I also was using an account which is an owner of the subscription/tenant/etc.

I also was comparing results against the commercial tenant for the commands, which acted properly.

Basically whenever I would run
Get-AzStorageAccount
I would receive an error:

----------

Get-AzStorageAccount: The resource type 'storageAccounts' could not be found in the namespace 'Microsoft.Storage' for api version '2021-01-01'. The supported api-versions are '2020-08-01-preview,2019-06-01,2019-04-01,2018-11-01,2018-07-01,2018-03-01-preview,2018-02-01,2017-10-01,2017-06-01,2016-12-01,2016-07-01,2016-05-01,2016-01-01,2015-06-15,2015-05-01-preview'.

----------

Now: I confirmed via JSON that the containers within the Storage Account was using API 2017-10-01 which is listed as supported (Unless the API reference is associated with the instance of powershell – which I could not determine – so if there is something to check, appreciate it.

I did confirm that module Az.Storage was loaded. I could locate the command within the module.

The Az.Storage (and the other module) versions matched between the two tenants. Version 3.4.0.

I confirmed I was in the correct Context – there is only one subscription with the tenant, but validated.
Referring to
https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/error-not-found

I validated the desired Storage Container was associated with the License, the Resource Group, and location etc. On paper all looks great.

When I run get-azresource against the RG the items are listed.

Thinking it may be something else, I attempted to run
Set-AzCurrentStorageAccount -ResourceGroupName "WindChillDeployment" -AccountName "azgstorageaccount01"
This time the error is

----------

Set-AzCurrentStorageAccount: No registered resource provider found for location 'usgovvirginia' and API version '2021-01-01' for type 'storageAccounts'. The supported api-versions are '2020-08-01-preview, 2019-06-01, 2019-04-01, 2018-11-01, 2018-07-01, 2018-03-01-preview, 2018-02-01, 2017-10-01, 2017-06-01, 2016-12-01, 2016-07-01, 2016-05-01, 2016-01-01, 2015-06-15, 2015-05-01-preview'. The supported locations are 'usgoviowa, usgovvirginia, usgovtexas, usgovarizona, usdodeast, usdodcentral'.

----------

The location concerned me, as I had to rebuild a whole new RG for a different location already as one of the locations (the closest to us physically) did not include Compute SKUs for MS servers (what?!?). Anyway:
https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/error-register-resource-provider
discusses a few items.
First
Get-AzResourceProvider -ListAvailable
And I see that

----------

ProviderNamespace : Microsoft.Storage
RegistrationState : Registered
ResourceTypes : {deletedAccounts, locations/deletedAccounts, storageAccounts, storageAccounts/listAccountSas, storageAccounts/listServiceSas, operations, usages, checkNameAvailability, locations/checkNameAvailability, locations, locations/asyncoperations, locations/usages, locations/deleteVirtualNetworkOrSubnets, storageAccounts/blobServices, storageAccounts/tableServices, storageAccounts/queueServices, storageAccounts/fileServices}
Locations : {USGov Iowa, USGov Virginia, USGov Texas, USGov Arizona}

----------

And
(Get-AzResourceProvider -ProviderNamespace Microsoft. Storage).ResourceTypes | Where-Object ResourceTypeName -eq storageaccounts).ApiVersions

Lists the API (though not the '2021-01-01' listed in the error (but again not sure what that is referencing, as it is not the Containers).).

So I am open to ideas and thoughts. I will say that ResourceProvider Microsoft.ClassicStorage is not registered, but I can not determine how to determine if something created within last week is Storage or Classic Storage.

Anyway, thank you for your time.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,679 questions
Azure Migrate
Azure Migrate
A central hub of Azure cloud migration services and tools to discover, assess, and migrate workloads to the cloud.
717 questions
Azure Site Recovery
Azure Site Recovery
An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.
631 questions
0 comments No comments
{count} votes

Accepted answer
  1. Daniel Klobnak 256 Reputation points
    2021-03-18T17:23:58.97+00:00

    To all: very belated reply. My apologies. As the issue identified was also being reported by other Azure users in this forum thread I(many who had not experienced the issue previously), it became obvious that it was not specific to our Tenant but a backend issue within Azure. The focus turned to the migration of environment between the commercial and government tenant (successful).
    Sure enough, the commands work properly now.

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Sumarigo-MSFT 43,486 Reputation points Microsoft Employee
    2021-03-04T12:54:13.677+00:00

    @Daniel Klobnak Welcome to Microsoft Q&A, Thank you for posting your query!

    I wish to engage with you offline for a closer look and provide a quick and specialized assistance, please send an email with subject line “Attn:subm” to AzCommunity[at]Microsoft[dot]com referencing this thread and the Azure subscription ID, I will follow-up with you. Once again, apologies for any inconvenience with this issue.

    Thanks for your patience and co-operation.

    --------------------------------------------------------------------------------------------------------------------------------------

    Please don’t forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  2. Daniel Klobnak 256 Reputation points
    2021-03-04T14:23:43.57+00:00

    Thank you! I just sent email as outlined - subject is
    Attn:subm Azure Gov - Storage Account

    Thanks again.

    0 comments No comments

  3. Mihai Mircea 1 Reputation point
    2021-03-05T09:56:00.117+00:00

    I'm hitting the same error, but via Azure CLI:

    az storage account list --subscription <sub id> --resource-group <rg name>
    
    
    
    The resource type 'storageAccounts' could not be found in the namespace 'Microsoft.Storage' for api version '2021-01-01'. The supported api-versions are '2020-08-01-preview,2019-06-01,2019-04-01,2018-11-01,2018-07-01,2018-03-01-preview,2018-02-01,2017-10-01,2017-06-01,2016-12-01,2016-07-01,2016-05-01,2016-01-01,2015-06-15,2015-05-01-preview'.
    

  4. Mihai Mircea 1 Reputation point
    2021-03-08T08:37:14.423+00:00

    @Daniel Klobnak Us Government Cloud
    Did not try with PowerShell.

    0 comments No comments