none
Cannot access any resources created in the preview portal with Azure PowerShell

    Question

  • Has anyone else had this problem?

    I have 2 storage accounts. 1 was created using the old portal and shows as "Storage Accounts (Classic)" in the Preview Portal. The 2nd was created earlier this week using the Preview portal. This Storage account shows up as "Storage Accounts" in the Preview portal. Both of these storage accounts are in the same subscription and the same geographic location (EAST US 2).

    My issue is I cannot access this new storage account using Azure PowerShell. I am trying to upload a VHD and I keep getting a message telling me "ResourceNotFound: The storage account 'storageaccountname' was not found."

    I assure you the storage account is created and there are vhds in it that are actively running VMs. I can upload the VHD to storage account 1 perfectly fine. Just not the newly created storage account.

    When I run Get-AzureStorageAccount, I only see my OLD storage account.

    Can anyone shed some light on why this would be happening? 

    Thursday, October 22, 2015 9:03 PM

Answers

  • Hi Coors1234,

    What version of the PowerShell cmdlets are you running? You have to use the v1 (classic) cmdlets to access the v1 resources, and the v2 (arm) cmdlets to access the v2 (arm) resources.

    Prior to 1.0.0.0, you had to use Switch-AzureMode to switch to the ARM version of the cmdlets. By default, it showed the v1 (Azure Service Management) assets, which are now referred to as "Classic". To see the v2 resources, you had to Switch-Azure-Mode AzureResourceManager.

    If you are running 1.0.0.0 or higher, to see the ARM resources you have to use the cmdlets that use "AzureRm" instead of just "Azure". For example, New-AzureRmStorageAccount or Get-AzureRmStorageAccount access the "v2" resources. To use the classic resources, you had to use the original cmdlets New-AzureStorageAccount and Get-AzureStorageAccount .

    Hope this helps.

    Robin

    Thursday, October 22, 2015 11:36 PM

All replies

  • Hi Coors1234,

    What version of the PowerShell cmdlets are you running? You have to use the v1 (classic) cmdlets to access the v1 resources, and the v2 (arm) cmdlets to access the v2 (arm) resources.

    Prior to 1.0.0.0, you had to use Switch-AzureMode to switch to the ARM version of the cmdlets. By default, it showed the v1 (Azure Service Management) assets, which are now referred to as "Classic". To see the v2 resources, you had to Switch-Azure-Mode AzureResourceManager.

    If you are running 1.0.0.0 or higher, to see the ARM resources you have to use the cmdlets that use "AzureRm" instead of just "Azure". For example, New-AzureRmStorageAccount or Get-AzureRmStorageAccount access the "v2" resources. To use the classic resources, you had to use the original cmdlets New-AzureStorageAccount and Get-AzureStorageAccount .

    Hope this helps.

    Robin

    Thursday, October 22, 2015 11:36 PM
  • Thank you Robin. This is exactly what I needed.
    Monday, October 26, 2015 2:35 PM
  • In order to use Preview Portal Resources [aka Resource Manager Resources] You have to change your powershell to point use resource manager using:

    Switch-AzureMode -Name AzureResourceManager

    once finished, you can change back using

    Switch-AzureMode -Name AzureServiceManagement

    If this does not solve your problem then check out Azure Subscriptions with PowerShell https://gallery.technet.microsoft.com/Azure-Subscriptions-with-be76827a

    Dan Stolts | ITProGuru | Microsoft | http://ITProGuru.com | @ITProGuru


    Dan Stolts (ITProGuru)

    Monday, October 26, 2015 6:11 PM