Skip to content

Conversation

@dtrejod
Copy link
Contributor

@dtrejod dtrejod commented Aug 21, 2024

Problem

This go-common is used by https://github.com/webdevops/azure-metrics-exporter in order to collect metrics from azure and make them available to Prometheus. Today this wrapper around the azure sdk does not support Azure's secret region.

https://azure.microsoft.com/en-us/explore/global-infrastructure/government/national-security

Proposal

This PR attempts to add preliminary support for the secret region. I can't share the exact endpoints but in effort to support this new region we can reuse some functionality already present in this repo for reading in secret endpoints via the AZURE_CLOUD_CONFIG envvar.

Adds support for interpreting azure secret cloud from the AZURE_ENVIRONMENT variable. When using the secret cloud region you will need to additionally pass in AZURE_CLOUD_CONFIG similar to private azure cloud since the secret region endpoints themselves are considered PROPIN by Microsoft.

Notes for reviewer

This only adds support for the Azure secret region. There is a TS region as well but i'm purposefully leaving that out of this PR for now since I'm not sure what the AZURE_ENVIRONMENT envvar for this region is expected to be myself yet.
https://azure.microsoft.com/en-us/blog/azure-government-top-secret-now-generally-available-for-us-national-security-missions/

Adds support for interpreting azure secret cloud from the
AZURE_ENVIRONMENT variable. When using the secret cloud region you will
need to additionally pass in AZURE_CLOUD_CONFIG similar to private azure
cloud since the secret region endpoints themselves are considered PROPIN
by Microsoft.
Comment on lines -52 to -57
| `AZURE_ENVIRONMENT` | Description |
|------------------------|----------------------------------------------------------------------------------------------|
| `AzurePublicCloud` | Default Azure cloud, using https://portal.azure.com |
| `AzureChinaCloud` | Azure cloud in China, using https://porta.azure.cn |
| `AzureGovernmentCloud` | US Government Azure cloud |
| `AzurePrivateCloud` | Private on-premise installation of Azure Cloud, needs additional configuration for endpoints |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated this table to better match the logic in the below switch statement where we match on "aliased" versions of the envvar.

https://github.com/dtrejod/go-common/blob/dt/azure-secret/azuresdk/cloudconfig/cloudconfig.go#L21

@dtrejod
Copy link
Contributor Author

dtrejod commented Aug 28, 2024

@mblaschke is it possible to get a review of this contribution PR?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants