Azure / ng-deploy-azure

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

feat(auth): allow to login to specific tenant #96

Closed rgammans closed 2 years ago

rgammans commented 3 years ago

Pull Request Template

Description

This allows login to a 'non default' tenant and hence deployment to resources therein.

I have access to a subscription in my client's tenant account, as well as my own, and need to deployment tasks to those resourced targets.

The existing TENANT_ID environment variable used by CI mode is no respected for ordinary logins.

Type of change

Please delete options that are not relevant.

How to Test

Use an Azure account with access to subscriptions from multiple tenants.

Attempt to deploy to the non - default tenant subscription. (Check failure)

$ng deploy To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code 12345678 to authenticate. Error when trying to deploy: The access token is from the wrong issuer 'https://sts.windows.net//'. It must match the tenant 'https://sts.windows.net//' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later.

$export TENANT_ID= $ng deploy To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code 12345678 to authenticate. Preparing for deployment preparing static deploy [===========================] 27/27 files uploaded | 100% done | 26.4s | eta: 0.0s

deploying static site see your deployed site at https://my-static/site.web.core.windows.net/

Closing issues

I haven't raised this a seperate issue.