Azure / ng-deploy-azure

Deploy Angular apps to Azure using the Angular CLI
MIT License
79 stars 37 forks source link

Target did not produce any files, or the path is incorrect. #74

Open patoncrispy opened 4 years ago

patoncrispy commented 4 years ago

Describe the bug I have configured my azure.json file with the correct values according to the AzureJSON interface (using the ng add @azure/ng-deploy command). When I try to run ng run <project-name>:deploy I get told that my path is empty (which it isn't). It then runs my build command and once again complains that my path is empty (which it isn't).

I also noticed that getFiles ignores directories https://github.com/Azure/ng-deploy-azure/blob/master/src/builders/actions/deploy.ts#L121. I have an assets folder in my build directory that should be included in the deployment.

My Angular application has multiple projects (app + libraries), if that bears any relevance.

To Reproduce Steps to reproduce the behavior:

  1. Create an angular app with projects.
  2. Try to deploy a project.

Expected behavior ng run <project-name>:deploy should deploy my project compiled in the directory specified in azure.json.hosting[0].app.path.

Screenshots

Screenshot 2019-09-12 at 14 43 34

Desktop (please complete the following information):

BernhardRode commented 4 years ago

Any news on this? =)

EDIT:

I had a look into my local setup. I'm using a default nx workspace and when i run a ng run portal:deploy i get the error. Digging into what is happening, i saw, that the getFiles() function is called with: { filesPath: '/Users/XXX/Development/XXX/apps/portal/dist/apps/portal' }

So it seems to create a wrong path from

projectRoot + the config path from azure.json

where it should use

workspaceRoot + the config path from azure.json

... when i change it locally, i get Azure errors.

I hope to find some time to dig into the issue, but maybe this helps =)

pierfreeman commented 3 years ago

gettint the same error when trying to deploy from a Nx workspace.

amandasimonds commented 2 years ago

I am getting the same error and this is the only place I have found someone with the same problem. I have the same set up as OP - multiple projects.

my azure.json:

{
  "hosting": [
    {
      "app": {
        "project": "project-name",
        "target": "build",
        "configuration": "production",
        "path": "dist/project-name"
      },
      "azureHosting": {
        "subscription": "subscription-number",
        "resourceGroupName": "project-name-static-deploy",
        "account": "projectnamestatic"
      }
    }
  ]
}

angular.json deploy object under the respected project:

 "deploy": {
          "builder": "@azure/ng-deploy:deploy",
          "options": {
            "host": "Azure",
            "type": "static",
            "config": "azure.json"
          }
        }

Any news on this? Can find hardly any information on this configuration. I followed this tutorial and thought it would be simple :/

I've built this app successfully and uploaded it to Azure websites. I was hoping to automate the process with ng-deploy.