问题描述
我环顾四周,并且在PowerShell中的Azure和AzureRM Commandlet中有成千上万的命令,我仍然不确定如何执行此操作.
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:
- 已安装Azure和AzureRM模块并将其导入到脚本中
- 通过get-AzurePublishSettingsFile命令生成"* .publishsettings"文件
- 导入了"* .publishsettings"文件
- 可以使用"Stop-AzureWebsite"和"Start-AzureWebsite"命令行访问该网站
我需要做什么:
- 创建一个新的部署,并将文件推送到应用程序服务站点.
注意:我没有Visual Studio项目和.csproj文件配置.我只想获取文件夹的内容并将其推送到网站.
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.
任何帮助都是有用的,因为该文档的细节确实很差,而且PowerShell中有成千上万的命令需要经过.
Any help would be useful as the documentation is really bad on details and there are thousands of commands in PowerShell to go through.
推荐答案
您可以检查博客:使用Azure PowerShell将App Service部署到部署槽中.
Get-AzurePublishSettingsFile
Import-AzurePublishSettingsFile .\Your-Publish-Settings-credentials.publishsettings
Get-AzureSubscription
Select-AzureSubscription -SubscriptionName "The Subscription Name containing the slot"
Set-AzureSubscription -SubscriptionId "ID of subscription"
$WebAppName = "standard(staging)"
Get-AzureWebsite -Name $WebAppName
Publish-AzureWebsiteProject -Name $WebAppName -Package "C:\PowerShell\standard.zip" -Slot "staging"
这篇关于如何使用PowerShell部署到Azure App Service?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!