Skip to content
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

Merged
merged 13 commits into from
Jun 18, 2020

Conversation

nickzhums
Copy link
Contributor

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

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
Copy link
Contributor

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

Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

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:

::
Copy link
Contributor

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?

Copy link
Contributor Author

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

doc/sphinx/mgmt_preview_quickstart.rst Outdated Show resolved Hide resolved
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
Copy link
Contributor

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"

doc/sphinx/mgmt_preview_quickstart.rst Outdated Show resolved Hide resolved
::

delete_async_op = resource_client.resource_groups.begin_delete(group_name)
delete_async_op.wait()
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link

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.

Copy link
Contributor Author

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"

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"?

@nickzhums nickzhums changed the title Quickstart for Track 2 preview management libraries Quickstart for Track 2 preview management libraries and update root readme for track 2 May 14, 2020
@nickzhums nickzhums requested review from zikalino and kaerm May 14, 2020 09:23
@@ -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
Copy link
Contributor

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)

Copy link
Contributor Author

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
Copy link
Contributor

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

Copy link
Contributor Author

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;
Copy link
Member

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()
Copy link
Member

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>`__
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wd? guess wait() ?

Copy link
Contributor Author

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


::

#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why an empty # ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@nickzhums nickzhums requested review from lmazuel and kaerm May 16, 2020 07:27

### 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`
Copy link

@zikalino zikalino Jun 3, 2020

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"

Copy link
Contributor Author

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**

Copy link

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
Copy link

@zikalino zikalino Jun 3, 2020

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
Copy link

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


::

location = "mylocation"
Copy link

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" ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, good point

@nickzhums nickzhums requested a review from zikalino June 3, 2020 06:36
nickzhums and others added 2 commits June 5, 2020 16:23
* [doc] add description about asynchronous client.

* update description.
@nickzhums nickzhums requested a review from changlong-liu June 18, 2020 02:49
@nickzhums nickzhums merged commit d662b54 into master Jun 18, 2020
@nickzhums nickzhums deleted the nickzhums-quickstart-track2 branch June 18, 2020 05:55
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Jun 22, 2020
…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)
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Jun 22, 2020
…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)
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Jun 22, 2020
…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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants