Skip to content

Instantly share code, notes, and snippets.

@PlagueHO
Last active July 12, 2017 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PlagueHO/aa3604e4d820768a7ec79164187adbb2 to your computer and use it in GitHub Desktop.
Save PlagueHO/aa3604e4d820768a7ec79164187adbb2 to your computer and use it in GitHub Desktop.
Example showing how to call the Publish-AzureRMWebappProject cmdlet to publish an Azure Web App using a Service Principal in PowerShell
$SubscriptionId = '3a54931f-5351-4ec4-9cf8-518e03257eff' # Not real
$TenantId = 'eef4615a-8a57-4519-99ea-e2a8bad20f82' # Not real
$Password = 'MyP@ssword99' # Not real
$Username = 'a3716a34-ae63-4ab8-8fb7-1e5f15ec3975' # Not real
$passwordSecure = ConvertTo-SecureString -String $Password -AsPlainText -Force
$Credential = New-Object -TypeName PSCredential ($Username, $passwordSecure)
.\Publish-AzureRMWebappProject `
-Credential $Credential `
-SubscriptionId $SubscriptionId `
-TenantId $TenantId `
-WebAppPath 'C:\Users\Dan\Source\MyAwesomeWebApp\debug\netcoreapp1.1\publish' `
-ResourceGroupName 'MyAwesomeWebApp' `
-WebAppServiceName 'WebApp' `
-SlotName 'offline' `
-Verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment