Skip to content

Commit 67455e4

Browse files
sandeep-senkristapraticopvaneckmccoyp
authored
Adding data collection disclosure to readme (Azure#40989)
* Adding data collection disclosure to readme * fixing credential name * updaing code samples * incorporating pauls suggestion * removing double import Co-authored-by: Krista Pratico <[email protected]> * correcting tabs Co-authored-by: Krista Pratico <[email protected]> * updating description and removing try catch * added missing new instance * updating import Co-authored-by: Paul Van Eck <[email protected]> * update typo Co-authored-by: McCoy Patiño <[email protected]> --------- Co-authored-by: Krista Pratico <[email protected]> Co-authored-by: Paul Van Eck <[email protected]> Co-authored-by: McCoy Patiño <[email protected]>
1 parent 34634fc commit 67455e4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,41 @@ Management libraries can be identified by namespaces that start with `azure-mgmt
5252
* File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-python/issues)
5353
* Check [previous questions](https://stackoverflow.com/questions/tagged/azure+python) or ask new ones on StackOverflow using `azure` and `python` tags.
5454

55+
56+
## Data Collection
57+
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.
58+
59+
### Telemetry Configuration
60+
Telemetry collection is on by default.
61+
62+
To opt out, you can disable telemetry at client construction. Define a `NoUserAgentPolicy` class that is a subclass of `UserAgentPolicy` with an `on_request` method that does nothing. Then pass instance of this class as kwargs `user_agent_policy=NoUserAgentPolicy()` during client creation. This will disable telemetry for all methods in the client. Do this for every new client.
63+
64+
The example below uses the `azure-storage-blob` package. In your code, you can replace `azure-storage-blob` with the package you are using.
65+
66+
```python
67+
import os
68+
from azure.identity import ManagedIdentityCredential
69+
from azure.storage.blob import BlobServiceClient
70+
from azure.core.pipeline.policies import UserAgentPolicy
71+
72+
73+
# Create your credential you want to use
74+
mi_credential = ManagedIdentityCredential()
75+
76+
account_url = "https://<storageaccountname>.blob.core.windows.net"
77+
78+
# Set up user-agent override
79+
class NoUserAgentPolicy(UserAgentPolicy):
80+
def on_request(self, request):
81+
pass
82+
83+
# Create the BlobServiceClient object
84+
blob_service_client = BlobServiceClient(account_url, credential=mi_credential, user_agent_policy=NoUserAgentPolicy())
85+
86+
container_client = blob_service_client.get_container_client(container=<container_name>)
87+
# TODO: do something with the container client like download blob to a file
88+
```
89+
5590
### Reporting security issues and security bugs
5691

5792
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <[email protected]>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://www.microsoft.com/msrc/faqs-report-an-issue).

0 commit comments

Comments
 (0)