-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quickstart for Track 2 preview management libraries and update root readme for track 2 #11384
Conversation
1. Login into your azure account | ||
2. Select azure active directory in the left sidebar | ||
3. Click "App Registrations" | ||
4. Select the application which you have created |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or create a new one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed these steps and added a link to the official doc for more detailed content
Get Client Secret | ||
^^^^^^^^^^^^^^^^^ | ||
|
||
1. Login into your azure account |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess according to the branding guidelines all instances of Azure should be capitalized. As well as Azure Active Directory etc
7. Copy and store the key value. You won’t be able to retrieve it after | ||
you leave this page. | ||
|
||
Get Tenant ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move it before secret as this is the same set of instructions as Client ID so people don't need to navigate between tabs back and forth
|
||
To set the following environment variables on your development system: | ||
|
||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the instructions are different depending on OS, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point, instructions added for Windows
Now that the environment is setup, all you need to do is to create an | ||
authenticated client. Our default option is to use | ||
**DefaultAzureCredentials** and in this guide we have picked | ||
**Resource** as our target service. To authenticate to Azure and create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a sentence saying that " but you can set it up similarly for any other service that you are using"
:: | ||
|
||
delete_async_op = resource_client.resource_groups.begin_delete(group_name) | ||
delete_async_op.wait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this document going to appear as a README for mgmt plane? If yes might be worth adding links to:
- more samples
- troubleshooting
- contributing section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we are working on the samples part, when it's setup i'll add link to the samples here.
For troubleshooting and contributing sections, are there existing places we can point to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For both of these sections check what we have in the main readme. Troubleshooting could encourage posting an issue, link to ref docs, stack overflow. Contributing is just a copy paste:
Contributing
For details on contributing to this repository, see the contributing guide.
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 repositories using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could add appropriate links to reference for resource group, that would teach people how to find appropriate section in python reference.
However for now we could add links to latest versions and later remember to change it to bx version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks Zim, I will add links once track 2 api references are updated
3. Click "App Registrations" | ||
4. Select the application which you have created | ||
5. Copy "Application (client) ID" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "Subscription -> Access Control -> Add Role Assignment"?
@@ -33,6 +33,17 @@ You can find the [most up to date list of all of the new packages on our page](h | |||
|
|||
Last stable versions of packages that have been provided for usage with Azure and are production-ready. These libraries provide you with similar functionalities to the Preview ones as they allow you to use and consume existing resources and interact with them, for example: upload a blob. They might not implement the [guidelines](https://azure.github.io/azure-sdk/python_introduction.html) or have the same feature set as the Novemeber releases. They do however offer wider coverage of services. | |||
|
|||
### Management: New Releases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also have to update the links in the Packages Available to point to these sections instead (L20-22)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, strange, I thought I updated these, thanks for spotting :)
README.md
Outdated
For a complete list of management libraries which enable you to provision and manage Azure resources, please check [here](https://azure.github.io/azure-sdk/releases/latest/all/python.html). They might not have the same feature set as the new releases but they do offer wider coverage of services. | ||
Management libraries can be identified by namespaces that start with `azure-mgmt-`, e.g. `azure-mgmt-compute` | ||
|
||
|
||
### Management |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section should be deleted and content merged with the sections above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
import azure.mgmt.resource | ||
import azure.mgmt.network | ||
import azure.mgmt.compute | ||
from azure.identity import DefaultAzureCredential; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove ;
from azure.identity import DefaultAzureCredential; | ||
... | ||
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID") | ||
credentials = DefaultAzureCredential() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shoudl use the singular form for clarity
resource_client = azure.mgmt.resource.ResourceManagementClient(credential=credentials, subscription_id=subscription_id) | ||
|
||
More information and different authentication approaches using Azure Identity can be found in | ||
`this document <https://docs.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python>`__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation is to always remove the "en-us" part of the URL, so the url can be localized depending of customer country automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
:: | ||
|
||
delete_async_op = resource_client.resource_groups.begin_delete(group_name) | ||
delete_async_op.wd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wd? guess wait() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, should be copy paste error
|
||
:: | ||
|
||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why an empty # ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Remove extra section Add pointer to new sections
Add troubleshooting and contributing sections
Update troubleshooting sections
|
||
### Management: Previous Versions | ||
For a complete list of management libraries which enable you to provision and manage Azure resources, please check [here](https://azure.github.io/azure-sdk/releases/latest/all/python.html). They might not have the same feature set as the new releases but they do offer wider coverage of services. | ||
Management libraries can be identified by namespaces that start with `azure-mgmt-`, e.g. `azure-mgmt-compute` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we also have something about "Preview Versions" (I mean our bx versions)? And perhaps in general "preview versions"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is covered in "Management: New Releases" section on this page
- **Client ID** | ||
- **Client Secret** | ||
- **Tenant ID** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also thinking that we could add alternative of using Azure CLI as well. Maybe simpler for some users. Just "az login" and the same examples should work considering we use default credentials?
|
||
Windows (Note: Administrator access is required) | ||
|
||
1. Open the Control Panel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be also done in command line:
set AZURE_CLIENT_ID=
however maybe via control panel is better as it will be persistent.
:: | ||
|
||
import azure.mgmt.resource | ||
import azure.mgmt.network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for simplicity of example, we probably don't need network and compute here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
|
||
:: | ||
|
||
location = "mylocation" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would change "mylocation" to some real location for instance "westus2"
if somebody is novice, they might try to put for instance "Warsaw" ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good point
* [doc] add description about asynchronous client. * update description.
…into regenerate_certs * 'master' of https://github.com/Azure/azure-sdk-for-python: [text analytics] remove duplicate platform info in user agent (Azure#12123) [form recognizer] remove duplicate platform info in user agent (Azure#12124) fix broken links (Azure#12100) Document "<unchanged>" for DataSourceCredentials.connectionString if it is empty (Azure#12129) Let the transport handles bad urls (Azure#12106) Remove Unneeded Reference to repository resource (Azure#11929) enable logging for tests (Azure#12110) fix network in batch testcase (Azure#12114) update test recording for appservice (Azure#12116) Add test for connection monitor and fix test api version. (Azure#12113) Minor root readme and mgmt quickstart update for Track 2 mgmt sdk (Azure#12112) Quickstart for Track 2 preview management libraries and update root readme for track 2 (Azure#11384) Seg fault fix (Azure#11933)
…into regenerate_keys * 'master' of https://github.com/Azure/azure-sdk-for-python: [text analytics] remove duplicate platform info in user agent (Azure#12123) [form recognizer] remove duplicate platform info in user agent (Azure#12124) fix broken links (Azure#12100) Document "<unchanged>" for DataSourceCredentials.connectionString if it is empty (Azure#12129) Let the transport handles bad urls (Azure#12106) Remove Unneeded Reference to repository resource (Azure#11929) enable logging for tests (Azure#12110) fix network in batch testcase (Azure#12114) update test recording for appservice (Azure#12116) Add test for connection monitor and fix test api version. (Azure#12113) Minor root readme and mgmt quickstart update for Track 2 mgmt sdk (Azure#12112) Quickstart for Track 2 preview management libraries and update root readme for track 2 (Azure#11384) Seg fault fix (Azure#11933)
…into regenerate_secrets * 'master' of https://github.com/Azure/azure-sdk-for-python: (39 commits) [text analytics] remove duplicate platform info in user agent (Azure#12123) [form recognizer] remove duplicate platform info in user agent (Azure#12124) fix broken links (Azure#12100) Document "<unchanged>" for DataSourceCredentials.connectionString if it is empty (Azure#12129) Let the transport handles bad urls (Azure#12106) Remove Unneeded Reference to repository resource (Azure#11929) enable logging for tests (Azure#12110) fix network in batch testcase (Azure#12114) update test recording for appservice (Azure#12116) Add test for connection monitor and fix test api version. (Azure#12113) Minor root readme and mgmt quickstart update for Track 2 mgmt sdk (Azure#12112) Quickstart for Track 2 preview management libraries and update root readme for track 2 (Azure#11384) Seg fault fix (Azure#11933) [formrecognizer] update formrecognizer links to new aka.ms naming (Azure#12079) changes in samples tests (Azure#12090) readme & sample updates (Azure#12095) Update Key Vault minimum azure-core to 1.4.0 (Azure#12074) [formrecognizer] test parity with other languages (Azure#12059) syncing missing changelog items (Azure#12089) updating doc references (Azure#12086) ...
This is the quickstart for Track 2 Python Management library thats going to be in public preview, creating this PR as part of release preparation.
This document will be later translated to a document on docs.microsoft.com