如何使用 PowerShell 部署到 Azure 应用服务? [英] How do I deploy to Azure App Service with PowerShell?

查看:22
本文介绍了如何使用 PowerShell 部署到 Azure 应用服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我环顾四周,使用 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.

到目前为止我的工作:

  • 安装 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 将应用服务部署到部署槽.

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:PowerShellstandard.zip" -Slot "staging"

这篇关于如何使用 PowerShell 部署到 Azure 应用服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆