I have looked around and with the thousands of commands in the Azure and AzureRM commandlets in PowerShell, I'm still not sure how to do this.
What I have working so far:
- Installed Azure and AzureRM modules and imported them to the script
- Generated the "*.publishsettings" file from the get-AzurePublishSettingsFile command
- Imported the "*.publishsettings" file
- Can acccess the website with the "Stop-AzureWebsite" and "Start-AzureWebsite" commandlets
What I need to do:
- create a new deployment and push files to the app-service site.
Notes: I do not have a Visual Studio project and .csproj file configs. I simply want to take the contents of a folder and push that to the website.
Any help would be useful as the documentation is really bad on details and there are thousands of commands in PowerShell to go through.
Unfortunately the accepted answer gave me the following error:
This StackOverflow answer suggests to use
Get-AzureRmWebApp
instead, but this introduces some challenges with authentication. After some searching I found the following article which explained exactly what I needed: an approach to do a publish to Azure without any human interaction.Please see a very simplified version of the script below.
You could check this blog:Deploy an App Service using Azure PowerShell to a Deployment Slot.
The above link (https://blogs.msdn.microsoft.com/benjaminperkins/2016/10/01/deploy-an-app-service-using-azure-powershell-to-a-deployment-slot/)talks about a GIT based deployment. OP wanted something from a folder.
Check this one out -
Create an Azure Website with PowerShell and FTP