问题
I am using Deploy azure app service to slot build step in Team Services, I want to be able to build my solution with PackageAsSingleFile set to False. However when I try to release the package with path to the artifact created I get "No packages found with specified pattern".
Do I need to create two artifacts, one as zip file and one as a package of files to be able to do what I want? I have tried different path to folders, but I get same error no matter.
回答1:
Refer to these steps:
- NuGet Installer task to restore package
- Visual Studio Build task (Solution: ***.sln; Visual Studio Version: Visual Studio 2015; MSBuild Arguments: /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl="$(build.artifactstagingdirectory)\"; Platform: $(BuildPlatform); Configuration: $(BuildConfiguration))
- Publish Build Artifacts (Path to Publish: $(build.artifactstagingdirectory); Artifact Name: drop; Artifact Type: Server)
- Edit/create Release definition
- Link artifact to previous build
- Azure App Service Deploy (Package or Folder: $(System.DefaultWorkingDirectory)/**/drop)
- Uncheck Publish using Web Deploy option
回答2:
I used zip file, and Azure App Services Deploy task can be execute successfully.
For the related build definition, you can use below tasks:
Copy Files task:
Source Folder: $(Build.SourcesDirectory)
.
Contents: the project you want to deploy to Azure, such as ASPNETCoreProj\**
.
Target Folder: $(Build.ArtifactStagingDirectory)
.
Archive Files task:
Root folder (or file) to archive: $(Build.ArtifactStagingDirectory)
.
Archive type: zip
.
Archive file to create: $(Build.ArtifactStagingDirectory)/project.zip
.
Publish Build Artifacts task:
Path to Publish: $(Build.ArtifactStagingDirectory)
.
Artifact Name: drop
.
In the release definition, you can specify Package or folder as $(System.DefaultWorkingDirectory)\**\*.zip
in Azure App Services Deploy task.
来源:https://stackoverflow.com/questions/44803475/no-packages-found-with-specified-pattern