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

New-TestResources.ps1 -TestApplicationId should not be required #485

Closed
heaths opened this issue Apr 9, 2020 · 13 comments · Fixed by #1077
Closed

New-TestResources.ps1 -TestApplicationId should not be required #485

heaths opened this issue Apr 9, 2020 · 13 comments · Fixed by #1077
Assignees
Labels
EngSys This issue is impacting the engineering system.

Comments

@heaths
Copy link
Member

heaths commented Apr 9, 2020

Some resources don't use SPs other than to provision (which logging in takes care of), so we should not require the TestApplication* parameters.

@heaths
Copy link
Member Author

heaths commented Apr 13, 2020

Thinking about this more, maybe they are since they pass through to set environment variables. We need to think end-to-end to be sure.

@weshaggard
Copy link
Member

If if we do need these in some cases we should either take the SP directly and pull the values or even consider creating the SP on the behalf the users that need one.

@heaths
Copy link
Member Author

heaths commented Apr 17, 2020

Maybe, but this was optimized for CIs that have separate secret variables for tenant, client ID, and client secret. As long as we can log into with those values (should be able to - we are in the script) within the CI and pass the $sp returned variable, that should work.

@pakrym
Copy link
Contributor

pakrym commented Apr 20, 2020

Automatic SP creation would make local developer scenarios so much better!

@heaths
Copy link
Member Author

heaths commented Apr 21, 2020

What role should they have in an organization by default? We document a default, but someone knowledgeable in a constrained subscription could figure out what they need. It's questions like that why we left it up to the user and would need to be solved before we start creating SPs on behalf of users.

@pakrym
Copy link
Contributor

pakrym commented Apr 21, 2020

What role should they have in an organization by default

Owners of the test resource group, no organization wide permissions.

@weshaggard weshaggard self-assigned this Apr 22, 2020
@weshaggard
Copy link
Member

I'll take a look at this while looking at some other clean-up stuff.

@drwill-ms
Copy link

drwill-ms commented Jun 12, 2020

The Azure IoT SDK team asks for the ability to run this script without the ProvisionerApplicationId. We need to be able to run this script for our own test environments, and we should be able to run it with our own credentials, rather than create an app Id that has access to our sub.

@heaths
Copy link
Member Author

heaths commented Jun 12, 2020

You can run without the -ProvisionalApplicationId already. There's two parameter sets. Run help new-testresources.ps1 -syntax to see both.

@drwill-ms
Copy link

Looks like if I do that, I can't specify my subscription Id?

@heaths
Copy link
Member Author

heaths commented Jun 15, 2020

Pass it when you log in with Connect-AzAccount. That will be the account that is used for provisioning if not otherwise passed to the script.

@drwill-ms
Copy link

That works, thanks. Super weird that in one case subscription Id is explicit, and in the other it is inferred.

@heaths
Copy link
Member Author

heaths commented Jun 15, 2020

It's only used for provisioning, and one parameter set is to provide parameters for provisioning instead of relying on the currently logged in user. We use the former parameter set for CIs.

@weshaggard weshaggard added the EngSys This issue is impacting the engineering system. label Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EngSys This issue is impacting the engineering system.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants