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

provider/azurerm: avoid registering providers already registered, add option to disable #10991

Merged
merged 1 commit into from
Jan 2, 2017

Conversation

pmcatominey
Copy link
Contributor

@pmcatominey pmcatominey commented Jan 2, 2017

Fixes #10931.
Fixes #8824.

The provider now consults the Providers API to detect which providers are already
registered and uses this call to test the credentials

A new option skip_provider_registration / ARM_SKIP_PROVIDER_REGISTRATION is
now available to opt out of provider registration entirely.

The error message from the call used to test credentials has also been changed, this will give us better errors once Azure/go-autorest#101 makes it's way into the SDK. Example of current errors:

# Bad Client ID
* Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: autorest#WithErrorUnlessStatusCode: POST https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/token?api-version=1.0 failed with 400 Bad Request: StatusCode=400

# Bad Client Secret
* Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: autorest#WithErrorUnlessStatusCode: POST https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/token?api-version=1.0 failed with 401 Unauthorized: StatusCode=401

# Bad Subscription ID
* Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: resources.ProvidersClient#List: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="SubscriptionNotFound" Message="The subscription '00000000-0000-0000-0000-000000000000' could not be found."

# Bad Tenant ID
* Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: autorest#WithErrorUnlessStatusCode: POST https://login.microsoftonline.com/00000000-0000-0000-0000-000000000000/oauth2/token?api-version=1.0 failed with 400 Bad Request: StatusCode=400

… option to disable

The provider now consults the Providers API to detect which providers are already
registered and uses this call to test the credentials

A new option `skip_provider_registration` / `ARM_SKIP_PROVIDER_REGISTRATION` is
now available to opt out of provider registration entirely
@jen20
Copy link
Contributor

jen20 commented Jan 2, 2017

This looks like a good idea to me. 👍 for moving to the official SDK where practical - the current solution was always a hack.

@jen20 jen20 merged commit 98c3b16 into hashicorp:master Jan 2, 2017
@pmcatominey pmcatominey deleted the azurerm-provider-registration branch January 2, 2017 17:53
@jen20
Copy link
Contributor

jen20 commented Jan 2, 2017

Thanks @pmcatominey! I've resolved the conflicts and merged.

@ghost
Copy link

ghost commented Apr 18, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants