Skip to content

Commit 1e03df0

Browse files
authored
Add missing headers to azure-attestation\README.md (#33981)
1 parent da38772 commit 1e03df0

File tree

1 file changed

+60
-4
lines changed
  • sdk/attestation/azure-mgmt-attestation

1 file changed

+60
-4
lines changed

sdk/attestation/azure-mgmt-attestation/README.md

+60-4
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,77 @@ For a more complete view of Azure libraries, see the [azure sdk python release](
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
# Usage
11+
## Getting Started
1212

13+
### Prerequsites
14+
```shell
15+
pip install azure-identity
16+
pip install azure-mgmt-attestation
17+
```
18+
19+
Before running the examples, please set the values of the client ID, tenant ID and client secret
20+
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
21+
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
22+
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
1323

24+
25+
### Resources
1426
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
1527

1628
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
1729
Code samples for this package can be found at [Attestation Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
1830
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
1931

2032

21-
# Provide Feedback
33+
## Examples
34+
35+
### List Attestation Providers
36+
```python
37+
from azure.core.exceptions import ClientAuthenticationError
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.attestation import AttestationManagementClient
40+
41+
client = AttestationManagementClient(
42+
credential=DefaultAzureCredential(),
43+
subscription_id="00000000-0000-0000-0000-000000000000",
44+
)
45+
46+
response = client.attestation_providers.list()
47+
print(response)
48+
```
49+
50+
## Troubleshooting
51+
52+
### CredentialUnavailableError
53+
The CredentialUnavailableError is a specific error type derived from ClientAuthenticationError. This error type is used to indicate that the credential can't authenticate in the current environment, due to missing required configuration or setup. This error is also used as an indication for chained credential types, such as DefaultAzureCredential and ChainedTokenCredential, that the chained credential should continue to attempt other credential types later in the chain.
54+
55+
### Permission issues
56+
Service client calls that result in HttpResponseError with a StatusCode of 401 or 403 often indicate the caller doesn't have sufficient permissions for the specified API. Check the [service documentation](https://learn.microsoft.com/azure/attestation/) to determine which RBAC roles are needed for the specific request, and ensure the authenticated user or service principal have been granted the appropriate roles on the resource.
57+
58+
## Next Steps
2259

2360
If you encounter any bugs or have suggestions, please file an issue in the
2461
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
25-
section of the project.
26-
62+
section of the project.
2763

2864
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-attestation%2FREADME.png)
65+
66+
67+
## Contributing
68+
69+
This project welcomes contributions and suggestions. Most contributions require
70+
you to agree to a Contributor License Agreement (CLA) declaring that you have
71+
the right to, and actually do, grant us the rights to use your contribution.
72+
For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
73+
74+
When you submit a pull request, a CLA-bot will automatically determine whether
75+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
76+
comment). Simply follow the instructions provided by the bot. You will only
77+
need to do this once across all repos using our CLA.
78+
79+
This project has adopted the
80+
[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
81+
For more information, see the
82+
[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
83+
or contact [[email protected]](mailto:[email protected]) with any
84+
additional questions or comments.

0 commit comments

Comments
 (0)