none
ForbiddenError: The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.

    Question

  • I have a Microsoft Account that has co-admin permissions on several Azure Subscriptions under different Directories. 

    I'm using Azure Powershell v 0.9.8.1

    In this script:

    #region Input
    $SubscriptionName      = 'MySubscription-Production'
    $StorSimpleManagerName = 'MySSManager'
    $RegistrationKey       = 'Private7d16dc3c1a4abcd'
    $TargetDeviceName      = '8100-ssa1'
    #endregion
    
    #region Initialize
    Clear-AzureProfile -Force -Verbose
    Add-AzureAccount # Enter your account credentials to login to your Azure subscription
    Get-AzureSubscription # optional to list the Azure subscriptions that you're a Co-administrator or Service administrator on
    Select-AzureSubscription -SubscriptionName $SubscriptionName 
    
    Get-AzureStorSimpleResource # Optional to list your StorSimple Manager objects 
    Select-AzureStorSimpleResource -ResourceName $StorSimpleManagerName -RegistrationKey $RegistrationKey
    #endregion

    The Get-AzureStorSimpleResource and Select-AzureStorSimpleResource cmdlets give the errors:

    I have used clear-azureprofile and manually deleted the contents of the folder C:\Users\samb\AppData\Roaming\Windows Azure Powershell but that did not help. 

    ============================================================

    Also, tried using a certificate to authenticate as in this script:

    #requires -version 4
    #requires -modules Azure
    
    #region Input
    $SubscriptionName      = 'Mysubscription-Production'
    $StorSimpleManagerName = 'MySSManager'
    $RegistrationKey       = 'Private5667d16dc3c1a4abcd'
    $TargetDeviceName      = '8100-SS2'
    $SubscriptionID        = '394nonyaf1-ad8ebb1167fc'
    #endregion
    
    #region Initialize
    $certName = 'SamB-Production'
    $Cert = Get-ChildItem -Path Cert:\CurrentUser\My | Where { $_.Subject -like “CN=$certName” }
    Set-AzureSubscription -SubscriptionName $SubscriptionName -SubscriptionId $SubscriptionID -Certificate $Cert
    
    Select-AzureSubscription -SubscriptionName $SubscriptionName 
    Get-AzureSubscription | Format-Table SubscriptionName, IsDefault, IsCurrent, SubscriptionID -AutoSize
        # confirms that I have the correct current and default subscription
    
    Get-AzureStorSimpleResource # Optional to list your StorSimple Manager objects 
    Select-AzureStorSimpleResource -ResourceName $StorSimpleManagerName -RegistrationKey $RegistrationKey
    #endregion
    
    Get-AzureAccount

    In this case, only one subscription is showing but same error:


    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________ Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx



    • Edited by Sam Boutros Monday, October 19, 2015 7:14 PM
    Monday, October 19, 2015 6:44 PM

All replies

  • cricket.. lol

    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________ Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

    Tuesday, October 20, 2015 2:25 PM
  • Hi Sam,

    I can't read the error messages at all. Is there another way you can provide that information?

    Thanks,

    Robin

    Wednesday, October 21, 2015 10:52 PM
  • Can you see the pics in these links better:

    https://superwidgets.files.wordpress.com/2015/09/azure1.jpg

    https://superwidgets.files.wordpress.com/2015/09/azure2.jpg


    Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable) _________________________________________________________________________________ Powershell: Learn it before it's an emergency http://technet.microsoft.com/en-us/scriptcenter/powershell.aspx http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx

    Thursday, October 22, 2015 1:29 AM