我想为 Blazor Web 客户端应用程序项目设置 CI/CD 以将内容复制到 Azure Blob 存储。以下是 CI 任务
- task: VSBuild@1
displayName: 'Build MyBlazor Web'
inputs:
solution: ./MyBlazorWeb/MyBlazorWeb.sln
vsVersion: 16.0
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
configuration: Release
restoreNugetPackages: true
- task: DotNetCoreCLI@2
displayName: 'Publishing MyBlazor Web...'
inputs:
command: publish
publishWebProjects: true
projects: ./MyBlazorWeb/MyBlazorWeb/MyBlazorWeb.csproj
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)/drop/MyBlazorWeb'
artifactName: MyBlazor
zipAfterPublish: false
- publish: $(Build.ArtifactStagingDirectory)
artifact: drop
下面是我的 CD 任务
- task: AzureFileCopy@2
displayName: 'Copy MyBlazorWeb to Static Web Site'
inputs:
SourcePath: '$(build.artifactStagingDirectory)/drop/MyBlazorWeb'
azureSubscription: '$(subscription)'
Destination: AzureBlob
storage: '$(storage-account-name)'
ContainerName: '$web'
AZCopy 抛出以下错误
解析源位置“D:\a\1\a\drop\MyBlazorWeb”时出错:无法使用文件模式 * 枚举目录 D:\a\1\a\drop\MyBlazorWeb\。该系统找不到指定的路径。(HRESULT 例外:0x80070003)有关更多详细信息,请键入“AzCopy /?:Source”或使用详细选项 /V。
我是否遗漏了任何其他任务或没有使用正确的源路径?如果这些任务/步骤不正确,如何在 Azure 存储中托管 Blazor webassembly?