crossplane-contrib / provider-upjet-azure

Official Azure Provider for Crossplane by Upbound.
Apache License 2.0
53 stars 69 forks source link

Azure Crossplane User Agent Detail #570

Open danielsollondon opened 8 months ago

danielsollondon commented 8 months ago

What problem are you facing?

It would be great to be able to know which client:identity is calling into my Azure subscription, this is what I see when using native Crossplane and TerraForm:

This is the UserAgent for CrossPlane using identity 1:

Go/go1.19.3 (amd64-linux) go-autorest/v14.2.1 hashicorp/go-azure-sdk/managedclusters/2022-09-02-preview HashiCorp Terraform/1.2.1 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev

This is the UserAgent for TF using identity 1:

Go/go1.17.5 (amd64-darwin) go-autorest/v14.2.1 Azure-SDK-For-Go/v62.3.0 resources/2020-06-01 HashiCorp Terraform/1.4.6 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/3.0.2..

How could Crossplane help solve your problem?

Would you be able to add some detail that Crossplane is the client, which provider, provider version, OS type, cpuArch in the UserAgent?

Thank you!

ulucinar commented 3 months ago

Hi @danielsollondon,

687 configures a partner ID (a9cee75d-8f11-42e4-bc19-953757f4ea3c) for this provider, which results in a UserAgent similar to the following as mentioned in the PR description:

HashiCorp/go-azure-sdk (Go-http-Client/1.1 capabilities/2023-11-01) HashiCorp Terraform/ (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev pid-a9cee75d-8f11-42e4-bc19-953757f4ea3c

If we register this UUID in the partner center, would this be sufficient for the attribution purposes?

Regarding the provider version, OS & CPU architecture, is there a specific syntax we need to follow? Would setting the UserAgent to something like the following (with a partner UUID) work?

HashiCorp/go-azure-sdk (Go-http-Client/1.1 capabilities/2023-11-01) HashiCorp Terraform/ (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev crossplane-provider-upjet-azure/v1.1.0 (arm64-darwin) pid-a9cee75d-8f11-42e4-bc19-953757f4ea3c

Or, without the partner UUID if we decide not to do it:

HashiCorp/go-azure-sdk (Go-http-Client/1.1 capabilities/2023-11-01) HashiCorp Terraform/ (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azurerm/dev crossplane-provider-upjet-azure/v1.1.0 (arm64-darwin)

And how can we test #687 to make sure it's working as expected, i.e., on the Azure side, we get something parsable with the desired information?

Thank you very much @danielsollondon.

ulucinar commented 3 months ago

Planning to merge #687 today but I want to keep this issue open to keep the conversion going. We can iterate on the implementation if we need any further enhancements/fixes and close this issue once we are satisfied with the implementation.