首页 > 系统相关 >Azure DevOps 发布.Net项目到Windows IIS站点之通过公网IP(账号、密码)

Azure DevOps 发布.Net项目到Windows IIS站点之通过公网IP(账号、密码)

时间:2023-11-13 22:14:47浏览次数:37  
标签:displayName name IIS Deploy Windows IP value Build stage

在Azure DevOps中 通过指定公网IP发布代码到指定目录

# ASP.NET Core (.NET Core 7.0)
# Build and test ASP.NET Core projects targeting .NET Core 7.0.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
  vmImage: 'windows-2022'

variables:
- group: GeexPublish
- name: my-user-variable
  value: $[variables.UserName] # uses runtime expression
- name: my-passed-variable
  value: $[variables.PassWord] # uses runtime expression
- name: buildConfiguration
  value: 'Release'
- name: publishFolder
  value: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId)'
- name: solution
  value: '**/Platform.Client.csproj'

stages:
- stage: Build
  displayName: Build stage
  jobs:
  - job: Build
    displayName: 'Build job'
    steps:
    - script: dotnet build --configuration $(buildConfiguration)
      displayName: 'Build solution'

    - script: dotnet publish --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)
      displayName: 'Publish solution'

    - task: PublishBuildArtifacts@1
      inputs:
        pathtoPublish: '$(Build.ArtifactStagingDirectory)'
        artifactName: 'drop'
        publishLocation: 'Container'


- stage: Deploy
  displayName: Deploy stage
  jobs:
  - job: DeployToIIS
    displayName: Deploy to IIS
    pool:
      vmImage: 'windows-2022'
    steps:
    - task: DownloadBuildArtifacts@0
      inputs:
        buildType: 'current'
        downloadType: 'single'
        artifactName: 'drop'
        downloadPath: '$(System.ArtifactsDirectory)'

    - script: choco install webdeploy -y
      displayName: 'Install Web Deploy'

    - script: |
        msdeploy -verb:sync ^
        -source:contentPath="$(System.ArtifactsDirectory)/drop" ^
        -dest:contentPath="D:xxxx\xxx",computerName="https://xxx.xxxx.xxx.xx:8172/msdeploy.axd",userName=$(my-user-variable),password=$(my-passed-variable),authType="Basic" ^
        -allowUntrusted
      displayName: 'Deploy to IIS'




标签:displayName,name,IIS,Deploy,Windows,IP,value,Build,stage
From: https://www.cnblogs.com/MrChuJiu/p/17830376.html

相关文章

  • Windows下安装Jenkins
    从官网下的最新的Jenkins,在安装时出现了:Service'Jenkins'(Jenkins)failedtostart.verifythatyouhavesufficientprivilegestostartsystemservices试过网上的各种方法都无效。最后找到了Jenkins的安装目录下有一个jenkins.err.log,打开后发现里面有一段话如下:Ru......
  • Azure DevOps 发布.Net项目到Windows IIS站点之Azure项目发布内网VM
    当你有一个需求,需要通过AzureDevOps发布到一个没有公网的VM的时候,你将需要使用以下脚本trigger:-masterpool:vmImage:'windows-2022'variables:-name:Build.ArtifactStagingDirectoryvalue:'$(Build.Repository.LocalPath)\artifacts'-name:buildConf......
  • 2023NOIP A层联测30 T1 草莓列车
    容易想到将询问离线下来,按\(v\)从大到小排序,这样后面的修改一定不会对前面的修改造成影响。然后可以用并查集把已修改过的点缩起来。注意到\(m\)会到\(2\times10^7\),应该使用基数排序,复杂度为\(\mathcalO(\frac{m\max{v_i}}{base}+m\alpha(n))\)。常数较大,卡卡常才能过......
  • 【Windows 开发环境配置】NVIDIA 篇
    CUDA从CUDAToolkitArchive下载相应版本的离线安装包,这里以11.7为例。打开安装包,在安装选项选择自定义模式,点击下一步。在自定义安装选项中,仅选择CUDA组件(其中Nsight相关组件用于代码调试与性能分析),若未安装显卡驱动,选择NVIDIAGeForceExperiencecomponents并点击下一步。......
  • NOIP模拟赛35T1T2
    T1KAMEN只能说一言难尽。60pt暴力模拟每一个石头往下掉的情况。在这里,我并没有打暴力,而是用set存储了每一列的X和O的石子分布情况。当前节点的位置在(x,y),寻找x列中比y大的第一个位置在ny(这里可以用upper_bound),那么石子在这一列能往下掉到的位置就是(x,ny-1)然后再判断能......
  • 【2023.11.13】NOIP2023模拟试题-33.md
    T1贪心地找到和最大的组的较大数删除是最优选择,因此开线段树维护全局最大数,并单点更新指定位置的值。参考代码展开代码#include<bits/stdc++.h>usingnamespacestd;#definefi(l,r)for(inti=l;i<=r;++i)#defineff(i,l,r)for(inti=l;i<=r;++i)#definelllonglon......
  • Error: install profile containers-default-0.50.1: generate default profile into
    Bug#2040082“errorparsingAppArmorversion”:Bugs:golang-github-containers-commonpackage:UbuntuBug#2040082“errorparsingAppArmorversion”:Bugs:golang-github-containers-commonpackage:Ubuntu......
  • coreybutler/nvm-windows 简单使用
    目录nvm是什么安装简单命令nvm是什么Windows电脑node.js管理器。可以方便node.js的安装与切换。最新版本1.1.11coreybutler/nvm-windows有一个更高star的nvm是nvm-sh/nvm,没仔细研究。安装非常简单,下载Releases下的安装包,一步步安装即可,选好安装的位置即可。最先下卸载本......
  • Windows系统CMD命令行添加或删除路由
    Windows系统CMD命令行添加或删除路由 原文地址:https://www.cnblogs.com/dianchaozhang/p/16985395.html1,按Win键输入“CMD”,右键“以管理员身份运行” 2,在CMD窗口输入“ipconfig”并按Enter键  3,找到自己的网卡对应的“默认网关”,执行如下命令添加路由: routeadd{......
  • 使用 npm config set script-shell 实现跨平台的脚本执行需求
    npmconfigsetscript-shellC:\\app\\Git20180223\\bin\\bash.exe这个命令的准确含义是设置npm的脚本(shell)执行环境为"C:\app\Git20180223\bin\bash.exe"。这个命令用于修改npm的配置,具体来说,它修改了npm的一个配置项,该配置项用于指定在执行npm脚本时使用的shell程序。在这个......