1
##[debug]check path : d:\a\_tasks\PublishBuildArtifacts_2ff763a7-ce83-4e1f-bc89-0ae63477cebe\1.158.3\task.json
##[debug]adding resource file: d:\a\_tasks\PublishBuildArtifacts_2ff763a7-ce83-4e1f-bc89-0ae63477cebe\1.158.3\task.json
##[debug]system.culture=en-US
##[debug]PathtoPublish=d:\a\1\a
##[debug]check path : d:\a\1\a
##[debug]ArtifactName=drop
##[debug]ArtifactType=Container
##[debug]system.hostType=build
##[warning]Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.

Want to create artifact for Asp.net web forms website, but no files are being added to artifacts. Hence, artifact is not generating. Want to deploy it on Azure Web App service.

1 Answers1

0

According to your description, you are building a legacy "WebSite" (Asp.net Web Forms Stie) project type which is deprecated now while the "Asp.Net" template in the Azure DevOps definition is used for "Web App" project type.

Check the difference here: ASP.NET Web Site or ASP.NET Web Application? And for website project, there is no need to build them since they are automatically compiled on web server, you just need to deploy the source file to server directly. I also recommend you to use "Web App" to create your project since "Web Site" is deprecated.

Well, back to your question. For the Asp.net web forms website you need to update the pipeline (build definition) by adding a "Copy Files" task to copy the WebSite from its folder (source folder) to $(build.artifactstagingdirectory) to publish the artifacts.

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • But, in that case zip file will be not created. Only project files will be copied in artifact as it is. – Komal Nimje Jul 13 '20 at 08:48
  • Yeah, that's the expected behavior with `Asp.net Web Forms Stie` used . So, we recommend you to use "Web App" to create your project. As mentioned in the reply, the `Asp.Net` template Azure DevOps definition is used for "`Web App`" project type. – Andy Li-MSFT Jul 13 '20 at 09:27
  • Can we deploy Asp.net web forms website using that artifact which contains only files, not zip file using Azure Release Pipeline? – Komal Nimje Jul 13 '20 at 10:00
  • You can try using the [Windows Machine File Copy task](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/windows-machine-file-copy?view=azure-devops) to copy sources to the target website folder directly. For example copy the sources to `%SystemDrive%\inetpub\wwwroot` for the default website. – Andy Li-MSFT Jul 14 '20 at 10:12
  • @KomalNimje Have you resolved the issue by following the suggestions? Any update here? – Andy Li-MSFT Jul 21 '20 at 02:22
  • No. Facing the same issue. – Komal Nimje Jul 22 '20 at 06:35
  • @KomalNimje Have you tried to copy the sources files by using the [Windows Machine File Copy task](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/windows-machine-file-copy?view=azure-devops)? – Andy Li-MSFT Jul 24 '20 at 09:26
  • Yes, I did. I'm getting "You do not have permission to view this directory or page." this error. – Komal Nimje Jul 25 '20 at 16:47
  • @KomalNimje So, that's another permission issue. You need to use the user account which has the permission to access the published directory for the website in the Windows Machine File Copy task. For example, if you want to publish the website to www\interput , then the user account needs the read and write permission to access the www\interput directory in the target machine. – Andy Li-MSFT Jul 27 '20 at 02:22
  • I'm deploying it to Azure Web App Service. – Komal Nimje Jul 27 '20 at 06:56