Azure / Azure/ng-deploy-azure

Unable to deploy: An unhandled exception occurred: Project target does not exist.

Open
#101 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
79
Forks
47
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I am trying to deploy a sample angular app as per the instructions given [here](https://github.com/Azure/ng-deploy-azure).

**To Reproduce**
Steps to reproduce the behavior:
1. Follow the below steps as in to [this tutorial](https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-angular) create a new angular app
```
npm install -g @angular/cli@8 # Install the Angular CLI
ng new iam-spa --routing=true --style=css # Generate a new Angular app
cd # Change to the app directory
npm install @angular/material@8 @angular/cdk@8 # Install the Angular Material component library (optional, for UI)
npm install msal @azure/msal-angular # Install MSAL and MSAL Angular in your application
ng generate component home # To add a new page (such as a home or profile page)
```
2. Run `ng serve` to launch the app and see if it is created alright.
3. Add ng-deploy to your project
`ng add @azure/ng-deploy`
4. Deploy your project to Azure.
`ng run iam-spa:deploy`
5. When I run the above command, I am getting the below error:
> An unhandled exception occurred: Project target does not exist.
> See "C:\Users\username\AppData\Local\Temp\ng-QzVaez\angular-errors.log" for further details.

I tried the same steps by creating a new service-principal with role contributor and login with it. But, no luck. Please check

My Angular.json has:
`{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"iam-spa": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/iam-spa",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "iam-spa:build"
},
"configurations": {
"production": {
"browserTarget": "iam-spa:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "iam-spa:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "iam-spa:serve"
},
"configurations": {
"production": {
"devServerTarget": "iam-spa:serve:production"
}
}
}
}
}
},
"defaultProject": "iam-spa"
}`

**Expected behavior**
The app should be deployed into Azure

**Desktop (please complete the following information):**
- OS: [e.g. iOS] Windows 10
- Browser [e.g. chrome, safari] Chrome
- Version [e.g. 22]

Please let me know what I am missing. Thanks much!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.