Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Environment Variable Rename [ENTRAID_APP_ID] #4234

Open
danmyhre opened this issue Sep 3, 2024 · 7 comments
Open

[FEATURE] Environment Variable Rename [ENTRAID_APP_ID] #4234

danmyhre opened this issue Sep 3, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@danmyhre
Copy link

danmyhre commented Sep 3, 2024

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Would like the client ID environment variable renamed. "ENTRAID_APP_ID" is not specific to this app and since this is a system wide variable, it should have a proper name.

For example:
PNPPOWERSHELL_CLIENTID (PNPPOWERSHELL_ is an already used prefix)
PnPClientId
PnPInteractiveClientId

Describe alternatives you've considered
n/a

Additional context
Related to new client ID process and single tenant app for interactive connections.

@danmyhre danmyhre added the enhancement New feature or request label Sep 3, 2024
@mbice
Copy link

mbice commented Sep 6, 2024

To add to this one.. Most of our developers are working across dozens of tenants at any given time. It would even better if we could add tenant specific client IDs to the environment variables. Otherwise I have to keep track of them somewhere and constantly be looking up the IDs when switching between tenants.

@ToddKlindt
Copy link
Contributor

I think if no -ClientID parameter is passed, and the ENTRAID_APP_ID environment variable is not defined, Connect-PnPOnline should look for an environment variable, or maybe a stored credential called host_ENTRAID_APP_ID and try that. So if I'm trying to connect to contoso.sharepoint.com then Connect-PnPOnline would look for contoso.sharepoint.com_ENTRAID_APP_ID, much like it looks now for stored credentials.

@nils-a
Copy link

nils-a commented Sep 11, 2024

Like @ToddKlindt I'm one who constantly switches between two (sometimes more) Tenants. So, having a single ClientID as an environment variable is a bit of a hassle. I always forget to change the value, and then I keep looking uncomprehendingly at the error page. This is currently impeding me quite a bit.

TBH it feels like this change was rushed a bit and not well thought through.

@gautamdsheth
Copy link
Collaborator

gautamdsheth commented Sep 26, 2024

Hello all,

Please checkout these new cmdlets that we added in the nightly builds. Should help ease this issue, would love to hear your feedback on this.

https://pnp.github.io/powershell/cmdlets/Set-PnPManagedAppId.html

https://pnp.github.io/powershell/cmdlets/Get-PnPManagedAppId.html

https://pnp.github.io/powershell/cmdlets/Remove-PnPManagedAppId.html

@mbice
Copy link

mbice commented Sep 26, 2024

@gautamdsheth this is a great addition, thanks!

One small thing I noticed, though, is that when adding a subdomain, it doesn't automatically work for the -admin site collection, so in order to add a tenant to ENV variables we have to run Set-PnPManagedAppId twice (once for tenant.sharepoint.com and another for tenant-admin.sharepoint.com). Would it be possible for the code to respect the single App ID for both variations of the subdomain?

Thanks again!

@ToddKlindt
Copy link
Contributor

@gautamdsheth this is a great addition, thanks!

One small thing I noticed, though, is that when adding a subdomain, it doesn't automatically work for the -admin site collection, so in order to add a tenant to ENV variables we have to run Set-PnPManagedAppId twice (once for tenant.sharepoint.com and another for tenant-admin.sharepoint.com). Would it be possible for the code to respect the single App ID for both variations of the subdomain?

Thanks again!

Not exactly the fix you're looking for, but I almost never connect to the -admin site. All the commands I use that need -admin automatically connect there regardless of where I am actually connected. Because of that I always connect to https://contoso, which would grab the ClientID.

@ToddKlindt
Copy link
Contributor

Hello all,

Please checkout these new cmdlets that we added in the nightly builds. Should help ease this issue, would love to hear your feedback on this.

https://pnp.github.io/powershell/cmdlets/Set-PnPManagedAppId.html

https://pnp.github.io/powershell/cmdlets/Get-PnPManagedAppId.html

https://pnp.github.io/powershell/cmdlets/Remove-PnPManagedAppId.html

This look great. I can't wait to try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants