Python微信订餐小程序课程视频
https://edu.youkuaiyun.com/course/detail/36074
Python实战量化交易理财系统
https://edu.youkuaiyun.com/course/detail/35475
系列导航及源代码
需求和目标
在这个系列的最后一节中,我们将使用GitHub Actions将TodoList应用部署到Azure Container Instance上。
实现
为了确保部署的应用能够正确运行,我们需要做以下几件事:
创建Azure SQL Server实例
选择最便宜的数据库规格就可以了,新建一个ResourceGroup名为todolist
,并新建数据库实例,获得连接字符串:
创建Azure Container Registry
用于构建好的镜像上传和部署
设置GitHub Secrets
首先创建Service Principle认证:
groupId=$(az group show \
--name todolist \
--query id --output tsv)
az ad sp create-for-rbac \
--scope $groupId \
--role Contributor \
--sdk-auth
# 会得到类似下面的输出
{
"clientId": "xxxx6ddc-xxxx-xxxx-xxx-ef78a99dxxxx",
"clientSecret": "xxxx79dc-xxxx-xxxx-xxxx-aaaaaec5xxxx",
"subscriptionId": "xxxx251c-xxxx-xxxx-xxxx-bf99a306xxxx",
"tenantId": "xxxx88bf-xxxx-xxxx-xxxx-2d7cd011xxxx",
"activeDirectoryEndpointUrl": "https://login.microsoftonl