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

本博客介绍了如何利用.NET 6和GitHub Actions部署TodoList应用到Azure Container Instance(ACI)。文章详细阐述了创建Azure SQL Server、Azure Container Registry、配置GitHub Secrets以及编写Actions配置的过程,并提供了验证部署成功的方法。此外,还探讨了Azure Container Apps作为一种容器化服务部署的选项。


最低0.47元/天 解锁文章
716

被折叠的 条评论
为什么被折叠?



