Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. param (
  2. [Parameter(Position=0,mandatory=$true)]
  3. [string] $AADAppID,
  4. [Parameter(Position=1,mandatory=$true)]
  5. [string] $AADKey,
  6. [Parameter(Position=2,mandatory=$true)]
  7. [string] $TenantId,
  8. [Parameter(Position=3,mandatory=$true)]
  9. [string] $ResourceGroupName,
  10. [Parameter(Position=4,mandatory=$true)]
  11. [string] $ServerName,
  12. [Parameter(Position=5,mandatory=$true)]
  13. [string] $RGLocation,
  14. [Parameter(Position=6,mandatory=$true)]
  15. [string] $WebAppName,
  16. [Parameter(Position=7,mandatory=$true)]
  17. [string] $SubscriptionName
  18. )
  19.  
  20. # Connect to Azure
  21.  
  22. $ssAADKey = ConvertTo-SecureString $AADKey -AsPlainText -Force
  23. $psCredential = New-Object System.Management.Automation.PSCredential($AADAppID, $ssAADKey)
  24.  
  25. Connect-AzureRmAccount -ServicePrincipal -Credential $psCredential -Subscription $SubscriptionName -TenantId $TenantId
  26.  
  27. $WebAppName = $WebAppName.Split(',')
  28.  
  29. Foreach ($servicename in $WebAppName)
  30. {
  31. write-host $servicename
  32.  
  33.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement