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

backend/azurerm: Restore Azure Stack Hub support #28613

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sebtelko
Copy link

@sebtelko sebtelko commented May 5, 2021

This PR restores support for Azure Stack Hub in the azurerm remote
backend. It seems that support was first broken by #26463 and then
later in #28181 the storage package was updated to an API profile
incompatible with Azure Stack Hub.

I've removed the mention of stack as a possible value for
environment in the backend configuration documentation, it fails with
a validation error and doesn't seem to be in use.

Resolves #28581.

NOTE: As is, this PR might break some of the changes that was done in #28181 to resolve #20831. I've simply verified that the azurerm backend works against Azure Stack Hub with the given changes.

This commit restores support for Azure Stack Hub in the azurerm remote
backend. It seems that support was first broken by hashicorp#26463 and then
later in hashicorp#28181 the storage package was updated to an API profile
incompatible with Azure Stack Hub.

I've removed the mention of `stack` as a possible value for
environment in the backend configuration documentation, it fails with
a validation error and doesn't seem to be in use.

Resolves hashicorp#28581.
@hashicorp-cla
Copy link

hashicorp-cla commented May 5, 2021

CLA assistant check
All committers have signed the CLA.

storageProps.AccountPropertiesCreateParameters = &armStorage.AccountPropertiesCreateParameters{
AllowSharedKeyAccess: &allowSharedKeyAccess,
}
storageProps.AccountPropertiesCreateParameters = &armStorage.AccountPropertiesCreateParameters{}
Copy link
Author

@sebtelko sebtelko May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just removed this field, as it's not available in the older API profile. It doesn't seem to affect whether the test passes.

@mrp02000
Copy link

Is there any info on whether or not this will be merged? I can confirm that this fixed the issue for me on an Azure Stack Hub device.

@@ -203,7 +203,7 @@ The following configuration options are supported:

* `key` - (Required) The name of the Blob used to retrieve/store Terraform's State file inside the Storage Container.

* `environment` - (Optional) The Azure Environment which should be used. This can also be sourced from the `ARM_ENVIRONMENT` environment variable. Possible values are `public`, `china`, `german`, `stack` and `usgovernment`. Defaults to `public`.
* `environment` - (Optional) The Azure Environment which should be used. This can also be sourced from the `ARM_ENVIRONMENT` environment variable. Possible values are `public`, `china`, `german` and `usgovernment`. Defaults to `public`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe keep "stack" in the docs if support is being restored?

@TheOnlyWei
Copy link

Will this also fix the Hashicorp Packer tool that is experiencing similar issues with Packer connecting to Azure Public Cloud by default instead of the local Azure Stack Hub?
https://github.com/hashicorp/packer-plugin-azure/blob/78a8c92327cb8b4eae79352a384c3702955f002c/builder/azure/common/client/config.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure Stack Hub & Backend Configuration AzureRM backend support for AD auth (no need for keys)
5 participants