Skip to content

Commit 1a1d83e

Browse files
sandeep-senchlowellgracewilcox
authored
Adding telemetry disclaimer (Azure#24552)
* Adding telemetry disclaimer * replacing AAD with Entra ID Co-authored-by: Charles Lowell <[email protected]> * making the steps more explicit Co-authored-by: Grace Wilcox <[email protected]> * fixing spacing * changing headings to msft standard * adding link to telemetry guidance * adding cred options to the sample * removing repeated options setting --------- Co-authored-by: Charles Lowell <[email protected]> Co-authored-by: Grace Wilcox <[email protected]>
1 parent 2f39355 commit 1a1d83e

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,55 @@ Security issues and bugs should be reported privately, via email, to the Microso
6868
* File an issue via [Github Issues](https://github.com/Azure/azure-sdk-for-go/issues)
6969
* Check [previous questions](https://stackoverflow.com/questions/tagged/azure+go) or ask new ones on StackOverflow using `azure` and `go` tags.
7070

71+
## Data Collection
72+
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described below. You can learn more about data collection and use in the help documentation and Microsoft’s [privacy statement](https://go.microsoft.com/fwlink/?LinkID=824704). For more information on the data collected by the Azure SDK, please visit the [Telemetry Guidelines](https://azure.github.io/azure-sdk/general_azurecore.html#telemetry-policy) page.
73+
74+
### Telemetry Configuration
75+
Telemetry collection is on by default.
76+
77+
To opt out, you can disable telemetry at client and credential construction. Set `Disabled` to true in `ClientOptions.Telemetry`. This will disable telemetry for all methods in the client. Do this for every new client and credential created.
78+
79+
The example below uses the `azblob` module. In your code, you can replace `azblob` with the package you are using.
80+
81+
```go
82+
package main
83+
84+
import (
85+
"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
86+
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
87+
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
88+
)
89+
90+
func main() {
91+
// set http client options
92+
clientOpts := policy.ClientOptions{
93+
Telemetry: policy.TelemetryOptions{
94+
Disabled: true,
95+
},
96+
}
97+
// set identity client options
98+
credOpts := azidentity.ManagedIdentityCredentialOptions{
99+
ClientOptions: clientOpts,
100+
}
101+
// set service client options
102+
azblobOpts := azblob.ClientOptions{
103+
ClientOptions: clientOpts,
104+
}
105+
106+
// authenticate with Microsoft Entra ID
107+
cred, err := azidentity.NewManagedIdentityCredential(&credOpts)
108+
// TODO: handle error
109+
110+
// create a client for the specified storage account
111+
client, err := azblob.NewClient(account, cred, &azblobOpts)
112+
// TODO: handle error
113+
// TODO: do something with the client
114+
}
115+
```
116+
> [!NOTE]
117+
> Please note that `AzureDeveloperCLICredential` and `AzureCLICredential` do not include `ClientOptions.Telemetry`. Therefore, it is unnecessary to set options in these credentials.
118+
119+
71120
## Community
72121

73122
* Chat with us in the **[#Azure SDK

0 commit comments

Comments
 (0)