-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Package mode] add new flag
--package-mode
(#1154)
- Loading branch information
Showing
270 changed files
with
5,358 additions
and
3,017 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Release History | ||
|
||
## 1.0.0b1 (1970-01-01) | ||
|
||
- Initial version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Copyright (c) Microsoft Corporation. | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
include *.md | ||
include LICENSE | ||
recursive-include tests *.py | ||
recursive-include samples *.py *.md | ||
{%- for init_name in init_names %} | ||
include {{ init_name }} | ||
{%- endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{% if package_mode == "mgmtplane" -%} | ||
# Microsoft Azure SDK for Python | ||
|
||
This is the Microsoft {{package_pprint_name}} Client Library. | ||
This package has been tested with Python 3.6+. | ||
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). | ||
|
||
# Usage | ||
|
||
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) | ||
|
||
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure) | ||
Code samples for this package can be found at [{{package_pprint_name}}](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. | ||
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) | ||
|
||
# Provide Feedback | ||
|
||
If you encounter any bugs or have suggestions, please file an issue in the | ||
[Issues](https://github.com/Azure/azure-sdk-for-python/issues) | ||
section of the project. | ||
|
||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2F{{package_name}}%2FREADME.png) | ||
{% else %} | ||
# {{ package_pprint_name }} client library for Python | ||
<!-- write necessary description of service --> | ||
|
||
## Getting started | ||
|
||
### Installating the package | ||
|
||
```bash | ||
python -m pip install {{ package_name }} | ||
``` | ||
|
||
#### Prequisites | ||
|
||
- Python 3.6 or later is required to use this package. | ||
- You need an [Azure subscription][azure_sub] to use this package. | ||
- An existing {{ package_pprint_name }} instance. | ||
|
||
{%- if token_credential %} | ||
#### Create with an Azure Active Directory Credential | ||
To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], | ||
provide an instance of the desired credential type obtained from the | ||
[azure-identity][azure_identity_credentials] library. | ||
|
||
To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip] | ||
|
||
After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use. | ||
As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client: | ||
|
||
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: | ||
`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` | ||
|
||
Use the returned token credential to authenticate the client: | ||
|
||
```python | ||
>>> from {{ namespace }} import {{ client_name }} | ||
>>> from azure.identity import DefaultAzureCredential | ||
>>> client = {{ client_name }}(endpoint='<endpoint>', credential=DefaultAzureCredential()) | ||
``` | ||
|
||
## Examples | ||
|
||
```python | ||
>>> from {{ namespace }} import {{ client_name }} | ||
>>> from azure.identity import DefaultAzureCredential | ||
>>> from azure.core.exceptions import HttpResponseError | ||
|
||
>>> client = {{ client_name }}(endpoint='<endpoint>', credential=DefaultAzureCredential()) | ||
>>> try: | ||
<!-- write test code here --> | ||
except HttpResponseError as e: | ||
print('service responds error: {}'.format(e.response.json())) | ||
|
||
``` | ||
{%- endif %} | ||
|
||
## Contributing | ||
|
||
This project welcomes contributions and suggestions. Most contributions require | ||
you to agree to a Contributor License Agreement (CLA) declaring that you have | ||
the right to, and actually do, grant us the rights to use your contribution. | ||
For details, visit https://cla.microsoft.com. | ||
|
||
When you submit a pull request, a CLA-bot will automatically determine whether | ||
you need to provide a CLA and decorate the PR appropriately (e.g., label, | ||
comment). Simply follow the instructions provided by the bot. You will only | ||
need to do this once across all repos using our CLA. | ||
|
||
This project has adopted the | ||
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information, | ||
see the Code of Conduct FAQ or contact opencode@microsoft.com with any | ||
additional questions or comments. | ||
|
||
<!-- LINKS --> | ||
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ | ||
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token | ||
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials | ||
[azure_identity_pip]: https://pypi.org/project/azure-identity/ | ||
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential | ||
[pip]: https://pypi.org/project/pip/ | ||
[azure_sub]: https://azure.microsoft.com/free/ | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-e ../../../tools/azure-devtools | ||
-e ../../../tools/azure-sdk-tools | ||
../../core/azure-core | ||
{% if token_credential -%} | ||
../../identity/azure-identity | ||
{% endif -%} | ||
{% if azure_arm -%} | ||
../../core/azure-mgmt-core | ||
{% endif -%} | ||
aiohttp |
Oops, something went wrong.