Azure / ng-deploy-azure

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

Deploy Failing in Continuous Integration Mode #94

Open bhoopaljanga opened 4 years ago

bhoopaljanga commented 4 years ago

Describe the bug ng-deploy working fine in interactive mode but when i try to deploy in CI mode its failing with

Get Token request returned http error: 400 and server response: {"error":"invalid_request","error_description":"AADSTS900023: Specified tenant identifier ''**-*-''' is neither a valid DNS name, nor a valid external domain

To Reproduce Steps to reproduce the behavior:

my packages are


"dependencies": {
    "@angular/animations": "8.2.12",
    "@angular/cdk": "~8.2.3",
    "@angular/common": "8.2.12",
    "@angular/compiler": "8.2.12",
    "@angular/core": "8.2.12",
    "@angular/forms": "8.2.12",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "8.2.12",
    "@angular/platform-browser-dynamic": "8.2.12",
    "@angular/platform-server": "8.2.12",
    "@angular/router": "8.2.12", 
    "@azure/ng-deploy": "^0.2.3"
}

and create Service Principal using the Azure CLI, will give you something like this

{ "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "displayName": "", "name": "http://", "password": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "tenant": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }

and I'm able to login with

az login --service-principal -u $CLIENT_ID -p $CLIENT_SECRET --tenant $TENANT_ID

But when trying to deploy with ng-deploy with CI = 1 (ng run myapp:deploy)

CI mode detected Checking for configuration... Using CLIENT_ID='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' Using CLIENT_SECRET='~*~**-*-**' Using TENANT_ID='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' Using AZURE_SUBSCRIPTION_ID='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' Configuration OK

Get Token request returned http error: 400 and server response: {"error":"invalid_request","error_description":"AADSTS900023: Specified tenant identifier ''xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'' is neither a valid DNS name, nor a valid external domain

Expected behavior

should deploy to CDN same as interactive mode

rakeshandrotula commented 4 years ago

Install the Angular CLI (v8.3.0 or greater) and check once.