azure / ng-deploy-azure Goto Github PK
View Code? Open in Web Editor NEWDeploy Angular apps to Azure using the Angular CLI
License: MIT License
Deploy Angular apps to Azure using the Angular CLI
License: MIT License
As part of schematics, it would be nice to also add a "deploy": "ng run <name>:deploy"
npm script to follow usual nodejs project conventions.
This is also a good thing to have when you don't have a global ng cli install, as you can directly use the local install this way, not needing to change anything on your env to deploy.
Please delete options that are not relevant.
Describe the bug
When trying to run a continuous deployment process (eg. from GitHub Actions), the interactive login mode blocks the CI.
Additional context (copy of internal discussion)
Wassim Chegham 4 days ago
Last time I investigated this, I hit an issue regarding the login process while trying to deploy from the Github Action. TBH, I was expecting this! So the issue is that we are using an interactive login method interactiveLoginWithAuthResponse
on @azure/ng-deploy
.
I was thinking we should switch to a loginWithServicePrincipalSecretWithAuthResponsez
login method when we are in a CI environment. See https://github.com/Azure/ms-rest-nodeauth#service-principal-and-secret-based-login
Then, in the pipeline or CI config, we should create and use Github secrets like this:
- name: deploy to Azure
env:
AZURE_SERVICE_PRINCIPAL: ${{ secrets.AZURE_SERVICE_PRINCIPAL }}
AZURE_SERVICE_PRINCIPAL_PASSWORD: ${{ secrets.AZURE_SERVICE_PRINCIPAL_PASSWORD }}
AZURE_TENANT: ${{ secrets.AZURE_TENANT }}
run: |
ng run angular-demo-app:deploy --service-principal -u $AZURE_SERVICE_PRINCIPAL -p $AZURE_SERVICE_PRINCIPAL_PASSWORD --tenant $AZURE_TENANT
I had this feature on my todo list for some time now. I'd be happy to send a PR, I just need to find some time to work on it.
Wassim Chegham 4 days ago
I forgot to mention that prior to this, we need to create a SP. We can do it from the CLI:
az ad sp create-for-rbac --name GithubActionDeployToAzure
which will give us the following content
{
"appId": "aa1307xx-11xx-41xx-8bxx-e4xxbd2xxb52",
"displayName": "GithubActionDeployToAzure",
"name": "http://GithubActionDeployToAzure",
"password": "e0xx8cxx-xxxx-xxxx-xxx-xxbxx56xxcxx",
"tenant": "72xx88xx-86xx-41xx-91xx-xx7xx0xxdbxx"
}
Need to clear
npm run test:jest
for the tests to workDescribe the bug
This is more of a feature request than a bug.
It's not possible to use Azure's managed identity feature for login (MSI). I noticed that the library used for authentication, @azure/ms-rest-nodeauth
actually supports MSI login, but this lib does not make use of it. I tried to modify the source of ng-deploy-azure to call that functionality, but because the dependency uses a very old version of ms-rest-nodeauth, it tries to authenticate to MSI an approach that is now deprecated (uses localhost instead of IMDS -- https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/howto-migrate-vm-extension).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
I was mainly looking for this feature because we want to use this package in our CI, but we don't want hardcoded user/passwords (i.e. service principal client ID and secret) written into our code or configs. An alternative would be to use an SP that is backed by a certificate in Azure Keystore but you don't support that either.
When you first add deploy with inactive subscription you got
You don't have any active subscriptions. Head to https://azure.com/free and sign in. From there you can create a new subscription and then you can come back and try again.
Then activate account (old one)
After this ng add @azure/ng-deploy
just stuck to
You don't have any active subscriptions. Head to https://azure.com/free and sign in. From there you can create a new subscription and then you can come back and try again.
Though subscription already active.
Had to move to firebase (
Describe the bug
The text in the READMe says ng add @azure/ng-deploy@beta, should be ng add @azure/ng-deploy
To Reproduce
Steps to reproduce the behavior:
Expected behavior
should be ng add @Azure/ng-deploy-team
We would like to publish a feature/preview site to azure storage for each pull request. The process would be
Deploy angular to azure blob storage
Create comment in Azure Devops / GitHub with preview url
Update deployment on new pushes
Delete storage account when PR get's merged
Maybe this can be a build task for azure devops / github actions?
Please delete options that are not relevant.
I would like to contribute here but I would need some support :)
This library facilitates versioning and helps to publish to NPM
https://www.npmjs.com/package/release-it
Please delete options that are not relevant.
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).
Please add yourself as the assignee
Please add relevant projects so this issue can be properly tracked.
I'd like to avoid building automatically and deploying directly from a path, ideally I'd like to get an error if the path to be deployed is not existing or empty.
So I followed what is described in the README:
Another option is to skip build, and deploy directly from a specific location. To do this, delete the target and configuration from azure.json, and provide a path with a value relative to the root of the project.
Prequisite: I first built with the configuration I need & "ng add ng-deploy-azure" run
If I only add "path", "ng run hello-world:deploy" is deploying without building as expected:
Example azure.json
{
"hosting": [
{
"app": {
"project": "hello-world",
"target": "build",
"configuration": "production"
"path": "public/static/hello-world"
},
"azureHosting": {
...
}
}
]
}
But if I follow exactly what is described, I mean removing target & config, to avoid the automatic build, I got the following error message:
Error when trying to deploy:
Azure hosting config is missing some details. Please run "ng add ng-deploy-azure" and select a storage account.
Example azure.json
{
"hosting": [
{
"app": {
"project": "hello-world",
"path": "public/static/hello-world"
},
"azureHosting": {
...
}
}
]
}
I'd like to know what should I keep and what I can remove from this file to achieve my goal : deploying without building and getting an error if the app has not been built before (path empty or not existing)?
I think that the README should be updated.
Thanks for your help
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Please delete options that are not relevant.
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).
Please add yourself as the assignee
Please add relevant projects so this issue can be properly tracked.
using azure-pipeline.yaml
file preferably.
It would be nice to add a command to re-run the azure.json
config process (login/subscription/resource group...) without having to do ng add
again or edit the config file manually.
Please delete options that are not relevant.
Describe the bug
I am using Angular 9 RC0, so this may not be supported (yet), but essentially I can't get any of this plugin to work without the title error message appearing. Even the azureLogout
command fails.
To Reproduce
Follow precisely the instructions on the readme for this plugin, but with Angular 9 up to and including step 4: Deploy your project to Azure
.
The command fails with the following error:
An unhandled exception occurred: Project target does not exist.
Expected behavior
No error.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
When I try to deploy I get this message.
I have already created the ressource group name and ressource.
Error when trying to deploy:
<?xml version="1.0" encoding="utf-8"?><Error><Code>ContainerNotFound</Code><Message>The specified container does not exist.
RequestId:fxxxxxxxxxx23-7770-7e14e5000000
Time:2019-10-09T07:06:04.9834123Z</Message></Error>
Should I create a container ? how should I call it? I don't see any container in azure.json
I get this error when trying to deploy after login to azure on console:
The Resource 'Microsoft.Storage/storageAccounts/appstatic' under resource group 'app-static-deploy' was not found.
here's my azure.json config
{
"hosting": [
{
"app": {
"project": "app",
"target": "build",
"configuration": "production",
"path": "dist"
},
"azureHosting": {
"subscription": "xxxxxxxx",
"resourceGroupName": "app-static-deploy",
"account": "appstatic"
}
}
]
}```
Describe the bug
I am trying to deploy a sample angular app as per the instructions given here.
To Reproduce
Steps to reproduce the behavior:
npm install -g @angular/cli@8 # Install the Angular CLI
ng new iam-spa --routing=true --style=css # Generate a new Angular app
cd <app-path> # 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)
ng serve
to launch the app and see if it is created alright.ng add @azure/ng-deploy
ng run iam-spa:deploy
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):
Please let me know what I am missing. Thanks much!
Walking through the Quick Start I get the
NOT SUPPORTED: keyword "id", use "$id" for schema ID error
when I ng add @azure/ng-deploy
To Reproduce
Steps to reproduce the behavior:
Go through the quickstart step by step
Here's my angular/OS version info
Angular CLI: 14.2.1
Node: 16.14.0
Package Manager: npm 8.3.1
OS: win32 x64
Angular:
...
@angular-devkit/architect 0.1402.1 (cli-only)
@angular-devkit/core 14.2.1 (cli-only)
@angular-devkit/schematics 14.2.1 (cli-only)
@schematics/angular 14.2.1 (cli-only)
I am getting this strange issue where on copying blobs from one storage account to other, the content type of blob changes which I believe is failing my logic app.
So in Storage A, I have a blob with content type as application/octet-stream which a .txt file, if I copy this file to my storage account B using storage explorer, the content type changes to text/plain; charset=utf-8
Problem now I am having is with application/octet-stream as I designed my logic app with my storage explorer B and now changing the connection string to Storage Explorer A , my logic app is returning application/octet-stream which i believe is giving me error as specific container not found in logic app Copy Blob activity.
So i would like to know why this behavior. Is there some way we can fix the content type of a storage account?
add to contribution file
Please delete options that are not relevant.
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).
Please add yourself as the assignee
Please add relevant projects so this issue can be properly tracked.
this is about creating a doc that shows how we release code and ensure it ends up in NPM
Please delete options that are not relevant.
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).
Please add yourself as the assignee
Please add relevant projects so this issue can be properly tracked.
Describe the bug
Attempted to install by running
ng add @azure/ng-deploy
Install failed.
First saw error messages that needed python 2.7. Installed that.
Then saw error messages that needed windows SDK 8.1. Installed that.
Now getting error message:
TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified. [D:\my-app\node_modules\get-cursor-position\build\pos.vcxproj
]
I give up :(
To Reproduce
ng add @azure/ng-deploy
Expected behavior
package should be added
Desktop:
Additional context
Angular cli 8.3.1
Describe the bug
The e2e test crashes because it can't find the dir. This happens when the path includes spaces.
Error: 'Could not install from ".." as it does not contain a package.json file.'
To Reproduce
Steps to reproduce the behavior:
my projects
npm i
npm run test:e2e
Expected behavior
The tests should run on the project wherever it is (path with spaces).
It would be nice if we had the option to connect to an existing storage account using a connection string. Sometimes, front end developers do not have direct access to the Azure subscription (e.g. the subscription is managed from another person's email in the organization) and are not able to specify it during the ng-deploy configuration process. Instead, the person that has the subscription under control (e.g. the backend developer or the devops engineer) issues a Shared Access Signature connection string and provides it in order to connect to the storage account.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
ng new hello-world --defaults
cd hello-world
ng add @azure/ng-deploy
ng run hello-world:deploy
The app builds and then deploys.
Now change something in the app. Then run ...
ng run hello-world:deploy
Browser to the site in Azure. Notice that what is deployed does not contain your changes. It appears that the deploy command is not building if something already exists in the dist/
folder.
Expected behavior
I expected that the deploy command would have always re-built the angular app first or never rebuild it. Options:
ng build --prod
I like 1 or 3.
Thoughts?
Describe the bug
When invoking ng add
using an existing resource group and storage account, ng deploy
will fail with the following error:
Error when trying to deploy:
<?xml version="1.0" encoding="utf-8"?><Error><Code>ContainerNotFound</Code><Message>The specified container does not exist.
RequestId:0a02c7fb-101e-0133-3bf5-7229ae000000
Time:2019-09-24T16:33:50.0066513Z</Message></Error>
To Reproduce
Steps to reproduce the behavior:
ng add @azure/ng-deploy --resourceGroup existing-rg--account existingstorage
ng deploy
We currently set noImplicitAny
to false
. This may not be ideal. Another option is to fix the typings below locally. Or to fix them in the library's github repo with a PR.
Putting this here so we do not forget
> [email protected] build /Users/papa/_git/ng-deploy-azure
> tsc -p tsconfig.json
src/builders/actions/deploy.ts:19:30 - error TS7016: Could not find a declaration file for module 'ascii-progress'. '/Users/papa/_git/ng-deploy-azure/node_modules/ascii-progress/index.js' implicitly has an 'any' type.
Try `npm install @types/ascii-progress` if it exists or add a new declaration (.d.ts) file containing `declare module 'ascii-progress';`
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @azure/[email protected]
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/@azure/ng-deploy/out/ng-add/schema.json b/node_modules/@azure/ng-deploy/out/ng-add/schema.json
index 8d84a0a..086381c 100644
--- a/node_modules/@azure/ng-deploy/out/ng-add/schema.json
+++ b/node_modules/@azure/ng-deploy/out/ng-add/schema.json
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/schema",
- "id": "azure-deploy-schematic-ng-add",
+ "$id": "azure-deploy-schematic-ng-add",
"title": "Azure Deploy ng-add schematic",
"type": "object",
"properties": {
This issue body was partially generated by patch-package.
Describe the bug
On the deploy command, only files that exist in dist// are uploaded to Azure, and not folders. This bug specifically affects the assets folder, which is added to the dist folder on build.
To Reproduce
Steps to reproduce the behavior:
ng add @azure/ng-deploy
ng build --prod
ng run <project-name>:deploy
<img src="assets/pic.jpg">
in one of the components, the image will be broken on the deployed site.Expected behavior
The assets folder and its content should exist in the file list in $web.
Images and other assets should be available on the deployed website.
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
Right now, the ng-deploy-azure system doesn't support specifying alternative Azure Environments (such as sovereign clouds, like AzureUSGovernment or AzureGermanCloud)
Please add configuration in azure.json to support specifying other clouds. This also implies that authentication can be done against other clouds, and the Azure Storage URL suffixes can be modified to support other clouds.
There are important files that Microsoft projects should all have that are not present in this repository. A pull request has been opened to add the missing file(s). When the pr is merged this issue will be closed automatically.
Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.
The hosting property in azure.json is already designed as an enumerable data structure, however only a single configuration can currently be deployed at a time. I.e if I have multiple configs defined in azure.json, only the first has any impact.
Value:
Deploy same project with various build-configurations
Solution:
Change getAzureHostingConfig to return an array of hosting configs rather than finding the first match. Then run deploy on each configuration.
Please delete options that are not relevant.
Describe the bug
Azure ng-deploy fails to find my Visual Studio Enterprise Azure subscription (that I have been using for some time and have many things deployed to)
Ran ng add @azure/ng-deploy
Got expected
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXXXX to authenticate.
Clicked the link, entered the code. Browser claimed success. Closed browser, saw following message:
You don't have any active subscriptions. Head to https://azure.com/free and sign in. From there you can create a new subscription and then you can come back and try again.
Running it again it doesn't even bother trying to connect, just shows no subscription message immediately. Trying -m flag and passing various params didnt help either.
In contrast the VS Code extension for Azure Storage recommended by the readme has no problem. I am able to see and browse my storage containers.
Expected behavior
Should be able to find my subscription and allow me to deploy.
Desktop (please complete the following information):
Additional context
Angular cli 8.3.2
Describe the bug
When running the e2e test, the script uses az
- the Azure CLI to clean up the resources. However, we can't expect all developers of ng deploy
to have the Azure CLI installed. The cleanup should be done using the resources that are already available - the SDKs that are used in the project.
Error: ./scripts/test.sh: line 44: az.cmd: command not found
To Reproduce
Steps to reproduce the behavior:
az
to see that it's not available)npm run test:e2e
Expected behavior
3 - the test script should not crash.
4 - the link should not be available.
Currently files are deployed on blob storage directly, making a default Angular website generated by ng CLI available, but with some limitations:
index.html
file is working through a workaround: 404 errors redirects to root document, but ideally this should be done using some URL rewriting rulesAll these points could be addressed by configuring Azure CDN on top of the static website.
Though as this incurs additional charges for the deployed website, maybe we would like to make this extra layer optional, prompting the user during initial setup?
Please delete options that are not relevant.
Describe the bug
if you scaffold an Angular project with uppercase characters in it it will error out. Example ExampleApp
will not work. The reason is the part of the project name is used to generate an account name.
You get an error looking something like this: {"error":{"code":"AccountNameInvalid","message":"ExampleAppstatic is not a valid storage account name. Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only."}}', headers: HttpHeaders { _headersMap: [Object] }
Fix: ensure project name is lowercased before being used as part of account name. Also ensure project name is capped if needed as it must not be longer than 24 characters (Project name + static).
Expected behavior
should be able to handle upper as well as lower case project names and if the project name is longer than 18 characters we need to cap it (project name - static
)
Describe the bug
ng add @azure/ng-deploy
automatically chooses a storage account name based on the project name when the user initializes it and signs in. Sometimes, that storage account name can conflict with an existing storage account (the name must be globally unique).
Initialization does not immediately make the user aware that they do not own the storage account in question, and the init fails silently. The user is told:
Account {{StorageAccountName}} already exist on subscription, using existing account.
In my case, the storage account name in question was not mine (and not in any of my subscriptions). I am working from an existing code sample.
When the user attempts to deploy the application (ng deploy
), the following error is displayed:
The resource 'Microsoft.Storage/storageAccounts/{{StorageAccountName}}' under resource group '{{ResourceGroup}}' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
To Reproduce
Steps to reproduce the behavior:
Choose a project name that causes a conflict with an existing storage account name. For example, name your project angular9-todo-app
, so that initializing ng-deploy
will set it up to connect to the existing storage account angular9todoappstatic
. Make sure that storage account is not owned/accessible by you.
add ng-deploy with ng add @azure/ng-deploy
sign in
(storage account and other dependencies are created automatically)
✔ Creating resource group {{ResourceGroup}} at West US (westus)
Account {{StorageAccountName}} already exist on subscription, using existing account
CREATE azure.json (410 bytes)
UPDATE angular.json (5475 bytes
Deploy the app with ng deploy
Preparing for deployment
Error when trying to deploy:
The Resource 'Microsoft.Storage/{{StorageAccountName}}' under resource group '{{ResourceGroup}}' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Expected behavior
Either of the following behaviours would be nice:
Desktop (please complete the following information):
Additional context
N/A
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:
Expected behavior
ng run <project-name>:deploy
should deploy my project compiled in the directory specified in azure.json.hosting[0].app.path
.
Screenshots
Desktop (please complete the following information):
Describe the bug
When adding @azure/ng-deploy to an angular project v9, we get the following error:
Cannot read the output path (architect.build.options.outputPath) of project "bazel-angular" in angular.json
To Reproduce
Steps to reproduce the behavior:
Expected behavior
@azure/ng-deploy should support the new angular v9 builder API.
Related issue #85
This will ensure the build pipeline run unit tests that upon:
This is an update to the Azure DevOps config file
Please delete options that are not relevant.
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).
Please add yourself as the assignee
Please add relevant projects so this issue can be properly tracked.
Describe the bug
Call ng add. Resource group is created and spinner gets stuck early on. Having tracked down the issue it's in the checkNameAvailability()
function. The function is meant to validate a name and needs to respond true
if name is available and false
if not. Currently, it gets stuck in a loop of false
responses
Suggested code fix is
return async (account: string) => {
spinner.start();
const availability = await client.storageAccounts.checkNameAvailability(account);
if (!availability.nameAvailable && warn) {
spinner.fail(availability.message || 'chosen name is not available');
return false;
} else {
spinner.stop();
return true;
}
};
}
Expected behavior
Expect azure.json
to be generated
azure.json
entry to .gitignore
Describe the bug
Account name needs to be unique per subscription
To Reproduce
deploy a quickstart twice and the second time it should complain about account name collision
Expected behavior
should use existing storage account the second time around
Once we have this in azure pipeline, we can add greenkeeper.io to make PRs and test them for npm version and security updates.
This is about understanding how users use the product so we can focus on the right parts to add features to/improve
Please delete options that are not relevant.
Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).
Please add yourself as the assignee
Please add relevant projects so this issue can be properly tracked.
Many of the Azure logic used in this tool (like login, subscription selection, resource group selection/creation, etc) could be extracted in a separate library, independant from the Angular schematics/builds.
By doing this, it could help bootstrapping other tools, like a standalone CLI to do the same deployment logic for React/Vue projects.
Please delete options that are not relevant.
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
Describe the bug
After upgrading to Angular 13, ng deploy no longer works. I get the following error
An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Deploy should be successful
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.