Error while setting alert conditions for azure budget via powershell

Welcome Forums General PowerShell Q&A Error while setting alert conditions for azure budget via powershell

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
2 months, 2 weeks ago.

  • Author
    Posts
  • #164307

    Participant
    Topics: 4
    Replies: 6
    Points: 25
    Rank: Member

    Hi,

    I am writing a script to set azure consumption budget and notification alert to subscription owner.
    Everything is working fine except setting up an action group.

    Below is the command i am using

    set-azurermconsumptionbudget -name Azureconsumption -notificationkey actual_greaterthan_80_percent -contactgroup 'Budget- 2019' -contactemail XXXX@domain.com,xxxx@domain.com

    Set-AzureRmConsumptionBudget : Operation returned an invalid status code 'Unauthorized'

    At line:1 char:1

    Can any one tell me the proper format or the solution to this?

     

    Thanks,

    Shesha

  • #164361
    Naw

    Participant
    Topics: 4
    Replies: 42
    Points: 74
    Rank: Member

    Have you tried something like this?

    Set-AzureRmConsumptionBudget -Name  Azureconsumption -NotificationKey actual_greaterthan_80_percent -NotificationEnabled -NotificationThreshold 90 -ContactEmail xxxx@domain.com,janesmith@contoso.com -ContactRole Owner,Reader,Contributor
    
    • #164692

      Participant
      Topics: 4
      Replies: 6
      Points: 25
      Rank: Member

      No luck,

      I am still getting the "unauthorized" error

       

      Thanks,

      Shesh

You must be logged in to reply to this topic.