"The requested content does not exist." 404 错误 Angular 静态网站 (Azure)

"The requested content does not exist." 404 error with an Angular Static Website (Azure)

我有一个 Azure 存储帐户,我在其中启用了静态网站。我已经通过 Azure Devops 管道发布并部署了我的 Angular 网站到存储帐户。

我以前也这样做过,还是出现同样的错误。添加useHash代码时,问题解决:

@NgModule({
  imports: [RouterModule.forRoot(routes, { useHash: true })],
  exports: [RouterModule]
})

但是这次还是出现Not Found的错误

我使用了 Azure 本身提供的 URL(见下文)。有解决办法吗?

编辑:

这是发布的 YAML:

steps:
- task: AzureFileCopy@3
  displayName: 'AzureBlob File Copy'
  inputs:
    SourcePath: '$(System.DefaultWorkingDirectory)/WebAppTest'
    azureSubscription: 'some resource group'
    Destination: AzureBlob
    storage: testsomestorage
    ContainerName: '$web'
    sasTokenTimeOutInMinutes: 240

在尝试了几种方法后,这个问题的修复很容易。 下面是工件存储位置的文件夹结构:

我选择了 WebAppTest (Build) 作为源路径,而不是下面的第二个 '****Frontend'

改完之后,网站终于可以用了。