<?xml version="1.0" encoding="utf-16"?><rss version="2.0"><channel><title>HueiFeng</title><description>冯辉,HueiFeng,.NET,.NET Core,Docker,k8s</description><link>https://hueifeng.azurewebsites.net/</link><pubDate>Tue, 07 Apr 2026 14:23:16 GMT</pubDate><copyright>(c) {year} Moonglade</copyright><generator>Moonglade v11.2-preview</generator><item><title>【Azure DevOps系列】Azure DevOps EFCore命令式脚本部署到SQL数据库</title><link>https://hueifeng.azurewebsites.net/post/2020/12/9/azure-devopsazure-devops-efcoresql</link><description>构建迁移脚本
为了构建迁移脚本，我们将需要使用EF Tools for Command Line Interface。这些工具在Microsoft.EntityFrameworkCore.Tools提供。
迁移脚本
现在我们将通过 dotnet ef migrations script –p path to your csproj with migrations -o $(Build.ArtifactStagingDirectory)\migrations\scripts.sql –i来迁移我们的脚本，在如下代码片段中我将脚本进行迁移出来并且输出到指定的路径 -o $(Build.ArtifactStagingDirectory)/migrations/scripts.sql中，	-i代表生成可用于任何迁移的数据库的脚本。
 - task: CmdLine@2 …</description><author>695979933@qq.com</author><category>Azure</category><category>DevOps</category><guid isPermaLink="false">BF6EB13E-F56A-4F9B-AB2E-5F930856FA9E</guid><pubDate>Wed, 09 Dec 2020 13:23:52 GMT</pubDate></item><item><title>【Azure DevOps系列】Azure DevOps多阶段构建</title><link>https://hueifeng.azurewebsites.net/post/2020/10/28/azureops-multi-stage-continuous-deploy</link><description>对于阶段的流水线其实是特别有用的，我们可以将构建、测试、或者说部署分为多个阶段进行处理。将您的应用程序部署到多个环境中，并从一个环境逐步过渡到另一个环境。例如，可以在CI中运行单元测试后自动部署到Dev环境，然后部署到运行集成测试的Test环境，然后手动部署到Production。
管道任务
这是一个最基础的管道任务，它在Microsoft托管代理上运行，同时他它采用ubuntu-16.04虚拟机镜像，执行后将会输出Hello world
pool:
  vmImage: 'ubuntu-16.04'
steps:
- bash: echo Hello world
当然我们可以对此进行修改成如下方式：
jobs:
- job: myJob
  timeoutInMinutes: 10
  pool:
    vmImage: 'ubuntu-16.04'
  steps:
  - …</description><author>695979933@qq.com</author><category>ASP.NET CORE</category><category>DevOps</category><guid isPermaLink="false">737F4DF2-11C3-4A15-8FC1-846DC0C8BE65</guid><pubDate>Wed, 28 Oct 2020 01:43:10 GMT</pubDate></item><item><title>【Azure DevOps系列】Azure DevOps使用Docker将.NET应用程序部署在云服务器</title><link>https://hueifeng.azurewebsites.net/post/2020/10/22/azure-devops-docker-to-deploy-dotnet-on-cloudservers</link><description>Docker持续集成
本章我们要实现的是通过我们往代码仓库push代码后，我们将每次的push进行一次docker自动化打包发布到docker hub中，发布到之后我将进行部署环节，我们将通过ssh方式将我们的.NET应用程序pull并run到我们的云服务器上。
Dockerfile 如下所示:
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr. …</description><author>695979933@qq.com</author><category>.NET</category><category>DevOps</category><guid isPermaLink="false">2B689DB7-E188-4F5A-8E66-CB5D73B227F1</guid><pubDate>Thu, 22 Oct 2020 05:02:46 GMT</pubDate></item><item><title>【Azure DevOps系列】如何在Azure DevOps上构建Docker镜像（一）</title><link>https://hueifeng.azurewebsites.net/post/2020/10/14/how-to-build-docker-image-on-azuredevops</link><description>创建Pipeline
trigger:
- master

pool:
  vmImage: 'windows-latest'

steps:
- task: DotNetCoreCLI@2
  inputs:
    command: 'restore'

- task: DotNetCoreCLI@2
  inputs:
    command: 'build'

- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: true
通过如下任务从源文件夹存档文件，支持多种标准存档格式，包括.zip,.jar,.war,.ear,.tar,.7z等
- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: '$(Build. …</description><author>695979933@qq.com</author><category>Docker</category><category>DevOps</category><guid isPermaLink="false">E53060F6-BB3A-4DA6-8481-FAC194F4C3BD</guid><pubDate>Wed, 14 Oct 2020 11:41:00 GMT</pubDate></item><item><title>【Azure DevOps系列】Azure DevOps构建并发布.NET5应用程序</title><link>https://hueifeng.azurewebsites.net/post/2020/9/24/azure-devopsazure-devopsnet5</link><description>Azure App Service
独立部署
在Azure App Service中我们可以通过独立部署进行部署我们的.NET5应用程序，因为它不会依赖目标系统上的环境，并且所有组件（包括librarys和运行时）都与该应用程序一起使用，并且与其他应用程序进行隔离，这样其实我们更好的去控制应用程序运行的版本。
1、选择要发布的项目，鼠标右键单击项目，然后选择发布，会出现如下内容:
file
2、接下来我们可以选择Linux应用服务或Windows应用服务
file
3、最后我们点击完成后选择部署模式此处选择独立模式
file
接下来我们发布应用程序即可
框架依赖
目前在Azure App Service中并没有为我们提供默认的.net5运行时环境，那么我们如何以框架依赖的形式使用.net5呢？看如下步骤
1、点击左侧的扩展
file
2、选择.NET5运行时，如下图所示
file
这样我们 …</description><author>695979933@qq.com</author><category>.NET5</category><category>DevOps</category><category>ASP.NET Core 5.0</category><guid isPermaLink="false">BC9BC236-E12C-4543-9A4D-EED64487CD3A</guid><pubDate>Thu, 24 Sep 2020 14:44:54 GMT</pubDate></item><item><title>【Azure DevOps系列】使ASP.NET Core应用程序托管到Azure Web App Service</title><link>https://hueifeng.azurewebsites.net/post/2020/9/11/aspnet-core-azuredevops-web-app-service</link><description>使用Azure DevOps Project设置ASP.NET项目
file
我们需要先在Azure面板中创建一个Azure WebApp服务，此处步骤我将省略，然后点击部署中心如下图所示：
file
此处我选择的是Azure Repos，当然大家也可以选择Github、Local Git、FTP
file
我们需要提前在Azure DevOps中提前创建好应用程序，我这边已经提前创建好了名称为Blog
.
file
创建完后我们会在Azure DevOps Pipeline中看到默认为我们生成的管道信息，他是一个构建刚才那个应用程序并发布的过程。这个过程还是挺方便的，省去了我们一些的配置直接将这些给我们配置好，当然CD其实也配置好了，最终这个应用程序会发布到我们在在这之前创建的Azure WebApp中。
file
file
通过如下该图我们可以看到已经可以访问通了，虽然
为错误页面其实 …</description><author>695979933@qq.com</author><category>ASP.NET CORE</category><category>DevOps</category><guid isPermaLink="false">0BE62125-0712-47DC-9D8D-BFD63C74483B</guid><pubDate>Fri, 11 Sep 2020 04:59:08 GMT</pubDate></item><item><title>【Azure DevOps系列】Azure DevOps构建并发布Nuget程序包</title><link>https://hueifeng.azurewebsites.net/post/2020/9/7/azure-devops-nuget-publish</link><description>在Azure DevOps中，管道可以用来构建解决方案，O(∩_∩)O哈哈~快万能了，本章主要介绍如何创建Nuget包并且将其发布到Nuget服务器的过程。
file
前面我创建了一个非常简单的类库，这边我不做过多叙述，接下来我们需要进行编辑csproj文件，当我们创建Nuget包时，我们将使用dotnet pack命令。这于传统的Nuget cli稍微有点不同，在传统的Nuget CLI中，我们创建nuspec文件并针对nuspec运行nuget pack。dotnet pack命令将从csproj创建一个nuspec文件，然后将代码打包到一个nupkg文件中，需要将一些关键信息添加到csproj文件中，以确保它可以正确的创建Nuget包。首先我们需要一个PackageId，这将是Nuget包本身的名称，根据我们要发布的位置这个名称必须是唯一的，接下来是Version，它将是已发布的软件 …</description><author>695979933@qq.com</author><category>.NET</category><category>ASP.NET CORE</category><category>DevOps</category><guid isPermaLink="false">F3D9499D-7988-4642-A900-663CF4860C83</guid><pubDate>Mon, 07 Sep 2020 01:01:46 GMT</pubDate></item><item><title>【Azure DevOps系列】Azure DevOps生成代码覆盖率</title><link>https://hueifeng.azurewebsites.net/post/2020/8/31/azure-devopsazure-devops-generation-coverage</link><description>前言
在做单元测试时，代码覆盖率可以作为我们衡量代码质量的一个指标，本章我们将使用Azure DevOps帮助我们生成代码覆盖率的结果.Azure DevOps构建管道还是具有代码覆盖率选项的，在Visual Studio测试平台在已经集成了Coverlet格式的数据收集器，它其实并不难，它是可以开箱即用的。获取Coverlet格式报告几乎都是可以拿命令行参数去解决的。
在单元测试项目中需要引入nuget包coverlet.collector，当然只需要在单元测试项目中引用他，下面这个代码片段是单元测试模板自动生成的，我只是引入了一个我自己的类库。
Project Sdk=Microsoft.NET.Sdk

  PropertyGroup
    TargetFrameworknetcoreapp3.1/TargetFramework
    IsPackablefalse/ …</description><author>695979933@qq.com</author><category>ASP.NET CORE</category><category>DevOps</category><guid isPermaLink="false">F60680D8-EDCC-4783-A123-9923DE9FB1E4</guid><pubDate>Mon, 31 Aug 2020 02:58:46 GMT</pubDate></item><item><title>【Azure DevOps系列】开始第一个Azure DevOps应用</title><link>https://hueifeng.azurewebsites.net/post/2020/8/25/start-the-first-azuredevops-application</link><description>前言
在上一章中对Azure DevOps做了一个简单介绍，本章我们将开始我们的Azure DevOps.
file
开启第一个DevOps应用
我们需要先从Azure DevOps这边进行注册相关账号。
注册账号打开Azure Pipelines,点击免费使用
azure pipelines
点击后进行注册或者登录Microsoft账号
创建项目
根据我们刚才创建的组织，然后访问组织页面进行创建项目
https://dev.azure.com/{yourorganization}
输入项目名称、输入项目描述以及选择项目可见程度即可
create project
创建完后我们会被重定向到如下页面
image
点击GitHub，点击后对Github仓库做一下授权即可，然后选择项目
进行选择一个默认模板配置，下面我选择ASP.NET Core
image
点击后能看到为我们默认创建的YAML文 …</description><author>695979933@qq.com</author><category>.NET</category><category>ASP.NET CORE MVC</category><category>DevOps</category><guid isPermaLink="false">359FF196-6014-4017-969C-3BD31D6D662C</guid><pubDate>Tue, 25 Aug 2020 09:34:59 GMT</pubDate></item><item><title>【Azure DevOps系列】什么是Azure DevOps</title><link>https://hueifeng.azurewebsites.net/post/2020/8/16/what-is-devops</link><description>DevOps
file
DevOps是一种重视“软件开发人员（Dev）”和“IT运维技术人员（Ops）”之间沟通合作的文化，它促进开发和运营团队之间的协作，以自动化和可重复的方式更快地将代码部署到生产中。
DevOps有助于提高组织提供应用程序和服务的速度。它使组织能够更好地为客户服务，并在市场中更有竞争力。
简而言之，DevOps可以定义为开发和IT运营的一致性，以及更好的沟通和协作。
Azure DevOps
file
Azure DevOps其实是VSTS（Visual Studio Team Service）更名后的名字。而VSTS是TFS（Team Foundation Server）的在线版本。所以Azure DevOps可以理解为是放在Azure云上的TFS，当然我们既可以使用在Azure云平台托管的服务（Azure DevOps Service），它可以是弹性可伸缩的，具有 …</description><author>695979933@qq.com</author><category>DevOps</category><guid isPermaLink="false">82FE8BE0-0CBE-4A55-B376-8ECE7B55534D</guid><pubDate>Sun, 16 Aug 2020 12:16:35 GMT</pubDate></item></channel></rss>