Module 3 - 微软云 Azure - Web Apps

1. Create new Web application in the Azure Portal

Azure Portal -> App Services -> Add -> Web App。

在这个过程中,Azure Portal 会要求你创建一个 Resource Group(资源组),在资源组里面,你会看到 App Service, App Service Plan, Application Insights(Optional)。

2. Deploy your application from Visual Studio to Azure by using deployment slot

首先在个人电脑上安装 Microsfot Visual Studio Community 2019;

然后按照教程 在Azure中创建ASP.net Core Web App 一步一步操作即可。

完成之后,在 Azure Portal 选中你所创建的 App Service,再选择 Deployment Slot,再选择 Add Slot,即可创建一个Slot(插槽)。

比如说,你可以为 Dev、SIT、UAT、PreProd(Staging)、PROD、BCP等分别创建不同的插槽。插槽的妙处在于你可以在类似生产的环境进行验证之后,然后对 Staging 和 Production 的内容进行交换(Swap)。

Add Slot

3. Move you project to Version Control system (Git or TFS) and set up Continuous Deployment process from your VC system to Azure

我选择的仓库托管中心是 GitHub,所以首先确保在 github.com 拥有自己的账号。

并且在个人电脑上安装 Git 的客户端。确保可以在本地磁盘打开 Git Bash。

Git 中 SSH key 生成步骤  按照该文章的说明,运行 ssh-keygen -t rsa -C "youremail@example.com" 在 ~/.ssh 目录下生成私钥 id_rsa 和公钥  id_rsa.pub,

并且需要把公钥的内容配置到 GitHub 网站。

在 GitHub 上新建一个仓库,名字和我的 Visual Studio 的项目的名字一致 myFirstAzureWebApp。

然后在本地磁盘的 myFirstAzureWebApp 项目文件夹下打开 Git Bash,

通过以下命令建立 本地库 和 远程库 之间的联系。

echo "# myFirstAzureWebApp" >> README.md
git init
git status
git add --all
git commit -m "first commit" -a
git remote add origin git@github.com:kingmax-chan/myFirstAzureWebApp.git
git push -u origin master

以后的新增开发一般通过 git status, git add, git commit, git push 等命令,就可以满足基本需求。

在 GitHub 授权给 Azure App Service。

通过 Azure Portal -> App Services -> Deployment Center -> Source Control -> Build Provider -> Configure -> Summary,

可以建立 GitHub 的特定代码库 到 Azure的特定App Service 或 Web App 之间的联系。

建立本地库--》远程库--》Azure Web Serice 的联系之后,以后每次在本地进行 git push 操作,都会向远程库推送,进而触发Azure中对应的App Service的 Build 和 Deploy 的操作。

而这一系列的动作,除了 git push,都是自动进行的。

Deployment Center ---> Source Control

Deployment Center ---> Build Provider

Deployment Center ---> Configure

Deployment Center ---> Summary

最新文章

  1. 利用Hexo搭建个人博客-博客发布篇
  2. curl开源库编译
  3. C#知识点有必要知会
  4. WeUI 为微信 Web 服务量身设计-h5前端框架
  5. javascript中标签与break和continue的配合使用
  6. 【阿里云产品公测】以开发者角度看ACE服务『ACE应用构建指南』
  7. IOS拖动
  8. Kafka 设计与原理详解
  9. 为Google Reader守夜。。。
  10. 解析rss和atom文件出现乱码问题
  11. 值得关注的 10 个 Python 英文博客
  12. 搭建 Linux 下 GitLab 服务器(转)
  13. IIFE(立即执行函数表达式)
  14. Java——类和对象
  15. python网络爬虫笔记(六)
  16. python之数据库内置方法以及pymysql的使用
  17. activemq 控制面板里的 Number Of Pending Messages、 Messages Enqueued、Messages Dequeued含
  18. JavaScript console控制台调试 post
  19. BZOJ3672: [Noi2014]购票【CDQ分治】【点分治】【斜率优化DP】
  20. session更换存储,实现在多台服务器共享

热门文章

  1. oc调用swift的打包.a / framework 不成功?!
  2. RN页面获取组件位置和大小的方法
  3. [BZOJ4913][SDOI2017]遗忘的集合
  4. net core体系-web应用程序-4asp.net core2.0 项目实战(任务管理系统)-2项目搭建
  5. npm那些事儿
  6. Jquery中事件的重复绑定
  7. 【BZOJ4842】[Neerc2016]Delight for a Cat 线性规划+费用流
  8. linux 文件属性(转)
  9. 编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习5
  10. 使用Callable接口创建线程和使用线程池的方式创建线程