Giter Club home page Giter Club logo

azure-docs-sdk-python's Introduction

azure-docs-sdk-python's People

Contributors

azure-sdk avatar bianliu1013 avatar danieljurek avatar dend avatar githubber17 avatar jasonwhowell avatar jimsuplizio avatar killa1218 avatar lisawong19 avatar lmazuel avatar mccoyp avatar mmacy avatar ntrogh avatar patrickfarley avatar rakshith91 avatar rloutlaw avatar saisang avatar sankethka avatar scbedd avatar seankane-msft avatar sima-zhu avatar sptramer avatar supernova-eng avatar swatdong avatar taojunshen avatar tfosmark avatar vsc-service-account avatar xiangyan99 avatar yannanwang1 avatar yunhaoling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-docs-sdk-python's Issues

Document is hidden

"https://docs.microsoft.com/en-us/python/api/overview/azure/monitoring/" from "api/overview/azure/monitoring/index.md" in "https://github.com/MicrosoftDocs/MachineLearning-Python-pr/tree/live/Monitor" is hidden now. There is another document with higher priority will be shown. It is "https://docs.microsoft.com/en-us/python/api/overview/azure/monitoring" from "https://github.com/MicrosoftDocs/azure-docs-sdk-python/blob/live/docs-ref-services/monitoring.md". Considering changing file name or folder name to make "api/overview/azure/monitoring/index.md" in "https://github.com/MicrosoftDocs/MachineLearning-Python-pr/tree/live/Monitor" view-able.

Issue with the argument enable_node_public_ip in the AmlCompute class of SDK v2

Link to the document - https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.entities.amlcompute?view=azure-python

I am trying to use the AML SDK v2 to create a compute cluster with the enable_node_public_ip=False. This results in an error since it appears that this argument was not initialized in the code written for the AmlCompute class as highlighted in the screenshot below. Basically, irrespective of the value for enable_node_public_ip, using this argument explicitly results in a type error.

image

Credentials objects are imported from azure.common.credentials but doc'd under msrestazure

(From https://github.com/MicrosoftDocs/azure-dev-docs/issues/97)

In code (for example, what's shown on the SDK authentication page, and what's in the SDK test code), one uses statements like the following to import Credentials classes from azure.common.credentials:

from azure.common.credentials import ServicePrincipalCredentials

However, ServicePrincipalCredentials and other credentials classes don't appear in the documentation for azure.common.credentials. Instead, they're documented only under msrestazure.azure_active_directory.

It seems like these classes should appear in the reference under azure.common.credentials because that's there people will look for them based on the code.

Create AOAI deployment with cogservices create API without passing in account (instead pass key + endpoint)

I want to create a AOAI model deployment using this API, since its the only one which supports deployment_name being set (OAI api does not support this: openai/openai-python#457):

I was suggested to do this:

from azure.mgmt.cognitiveservices import CognitiveServicesManagementClient
client = CognitiveServicesManagementClient(credential=<credential>, subscription_id=<subscription_id>)

deployment = client.deployments.begin_create_or_update(
    resource_group_name="<resource_group_name>",
    account_name="<account_name>",
    deployment_name="<deployment_name>",
    deployment={
        "properties": {
          "model": {
            "format": "OpenAI",
            "name": "<model name>",
            "version": "<model version>"
          },
          "scaleSettings": {
            "scaleType": "Standard"
          }
        }
    }
)

However, what I'm building does not have access to the Cog Services account name and rg, sub - but only has the AzureML subscription, resourceGroup as well as AzureOpenAI account base, key, version and type. Is there a way to use this library to create a deployment with that information instead of account info?

Thanks for the help!

Authenticate with Managed Service Identity(MSI) does not run as written

Attempted copy and paste of MSI sample, and receive the following error message:

raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='ip address', port=80): Max retries exceeded with url: /metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.core.windows.net%2F (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f18a6d81f90>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

Url value for link is truncated

How to connect to existing database and\or collection

The existing documentation and samples show how to create a client, a database and a collection, but they do not show the more common examples of how to work with existing data. How to:

  1. Create a client
  2. Use client to connect to database\container
  3. And from there... how to query, add, update and delete items

Documentation refers to pydocumentdb not azure-cosmos

https://github.com/MicrosoftDocs/azure-docs-sdk-python/blob/master/docs-ref-services/cosmosdb.md

Says to install pydocumentdb

https://pypi.org/project/pydocumentdb/

๐Ÿšจ๐Ÿšจ๐Ÿšจ The pydocumentdb package for versions 1.x and 2.x of the Azure Cosmos DB Python SDK for SQL API will be retired August 20, 2020. See the release and retirement documentation for more information.
Please use the latest version of the Python SDK with new package name, azure-cosmos.๐Ÿšจ๐Ÿšจ๐Ÿšจ

Example for create_entity method is corrupted

I noticed the example for the create_entity method is missing a few lines and columns.
On this page: azure.data.tables.TableClient class (this can also be found in the Document Details section)

File: azure.data.tables.TableClient.yml

At line 42, the example code is corrupted in some way.

In case anyone noticed this too, below is my best reconstruction:

class InsertDeleteEntity():
    def __init__(self):
        from azure.data.tables import TableEntity
		
        self.account_name = 'MyStorageAccount'
        self.access_key = '[an access key, similar to TXlTZWNyZXRTdG9yYWdlQWNjb3VudEFjY2Vzc0tleQ==]'
        self.endpoint = 'https://MyStorageAccount.table.core.windows.net/'
        self.table_name = 'MyTable'
        # self.entity = { 'RowKey':'myRowKey', 'PartitionKey':'myPartitionKey' }
        self.entity = TableEntity(RowKey='myRowKey', PartitionKey='myPartitionKey')

    def create_entity(self):
        from azure.data.tables import TableClient
        from azure.core.exceptions import ResourceNotFoundError, ResourceExistsError
        from azure.core.credentials import AzureNamedKeyCredential

        credential = AzureNamedKeyCredential(self.account_name, self.access_key)
        with TableClient(endpoint=self.endpoint, table_name=self.table_name, credential=credential) as table_client:

            try:
                resp = table_client.create_entity(entity=self.entity)
                print(resp)
            except ResourceExistsError:
                print("Entity already exists")
        # [END create_entity]

    def delete_entity(self):
        from azure.data.tables import TableClient
        from azure.core.exceptions import ResourceNotFoundError, ResourceExistsError
        from azure.core.credentials import AzureNamedKeyCredential

        credential = AzureNamedKeyCredential(self.account_name, self.access_key)
        with TableClient(endpoint=self.endpoint, table_name=self.table_name, credential=credential) as table_client:

            # Create entity to delete (to showcase etag)
            try:
                resp = table_client.create_entity(entity=self.entity)
            except ResourceExistsError:
                print("Entity already exists!")

            # [START delete_entity]
            table_client.delete_entity(row_key=self.entity["RowKey"], partition_key=self.entity["PartitionKey"])
            print("Successfully deleted!")
            # [END delete_entity]

if __name__ == "__main__":
    ___ = InsertDeleteEntity()
    ___.create_entity()
    ___.delete_entity()

'Authenticate with token credentials' sample does not run as written

Hi,

Just wanted to check on one example from the Authenticate with the Azure Management Libraries for Python doc. Running this sample generates the following error:

$ python adal_demo.py 
Traceback (most recent call last):
  File "adal_demo.py", line 11, in <module>
    context = adal.AuthenticationContext(LOGIN_ENDPOINT+TENANT)
NameError: name 'LOGIN_ENDPOINT' is not defined

If LOGIN_ENDPOINT and TENANT are capitalized for emphasis, please feel free to resolve this issue.

Thanks

query_entitities returns every row regardless of filter.

Using Python Function App with version azure-data-tables==12.0.0b1

  • Retrieve TableClient by calling TableServiceClient.create_table_if_not_exists
  • Build up filter
entity_query_value = "PartitionKey eq '{}'".format(self.partition_key)
  • Call query
            for found_entity in self.table_client.query_entities(
                filter=entity_query_value
            ):

First return.....found_entity['PartitionKey'] does not match the filter....in fact, the table has 2813 entries and no matter what I put in the filter I get 2813 return entities.

Misleading visibility_timeout, Required vs optional parameters, updates needed!

I see this correction on the sdk git but not on docs. Please update as needed.

https://docs.microsoft.com/en-us/python/api/azure-storage-queue/azure.storage.queue.queueclient?view=azure-python#azure-storage-queue-queueclient-receive-message

The PR and commit:

#1548

25f6410

Also, for update_message, pop_receipt and content don't need to be a required parameter. One place it says optional but another it says required. Details below:

image

WHY is it optional, because

  1. pop_receipt is already part of the message object. pop_receipt is only required if message object is not there like in case of cli and powershell.

  2. if we are issuing an update call for visibility_timeout alone, we do not need content as required parameter so it is optional.

Same for delete_message

image

Commit:

e9d4668

Please review and approve if it looks good.

Azure SDK Python mgmt packages overview page needs services.md

Most of mgmt packages explained here doesn't have service.md file here due to which it results in empty page.

Example for mgmt packages where Services.md file is missing causing a blank page to be displayed:
Automation Overview: https://docs.microsoft.com/en-us/python/api/overview/azure/automation?view=azure-python
Container Instances Overview: https://docs.microsoft.com/en-us/python/api/overview/azure/containerinstances?view=azure-python
Data Explorer: https://docs.microsoft.com/en-us/python/api/overview/azure/dataexplorer?view=azure-python
Data Share: https://docs.microsoft.com/en-us/python/api/overview/azure/datashare?view=azure-python
Private DNS: https://docs.microsoft.com/en-us/python/api/overview/azure/privatedns?view=azure-python

Please create the services.md file here so that we dont see blank pages in above links. These documentations should be fixed.

Note: I have listed only a few. There are many packages whose Overview page gives empty content.

Examples where the services.md is present and able to show the content:
Azure Storage: https://docs.microsoft.com/en-us/python/api/overview/azure/storage?view=azure-python
Compute: https://docs.microsoft.com/en-us/python/api/overview/azure/compute?view=azure-python
Container Registry: https://docs.microsoft.com/en-us/python/api/overview/azure/container-registry?view=azure-python
DevTest Labs: https://docs.microsoft.com/en-us/python/api/overview/azure/devtest-labs?view=azure-python

Install ADAL Doc reference

These docs reference installing ADAL with the following command:

pip install azure-graphrbac

And the sample code is different as well compared to most other docs, including the github repo's docs. For instance, the github repo shows:

pip install adal

Is the difference due to outdated docs or different implementations or is graphrbac used for a different purpose?

config.json search order

It is not clear how MLClient searches for config.json. It seems that from practice, it does not need to be in the current directory of the code and is discoverable if it is at one of the parents of the current directory; but this behavior is not documented.

Also, MLClient's from_config() does not expect config.json to be in ./.azureml directory, which is the default path for workspace.write_config() https://learn.microsoft.com/en-us/python/api/azureml-core/azureml.core.workspace.workspace?view=azure-ml-py#azureml-core-workspace-workspace-write-config . Would be great to be consistent about this, or at least document their behavior in more detail.

Event Grid sample code incorrect

Reviewing a support case (120021922002942), customer used the sample code here:
https://github.com/MicrosoftDocs/azure-docs-sdk-python/blob/024402b/docs-ref-services/event-grid.md#example

Looks like the events arguments are passed as a list of dicts and publish_events() serializes them into an azure.eventgrid.models.EventGridEvents, which uses custom serialization. The serialization expects properties in camelCase instead of snack_case. So the sample should be changed to something like:

events=[{
    'id' : "dbf93d79-3859-4cac-8055-51e3b6b54bea",
    'subject' : "Sample subject",
    'data': {
        'key': 'Sample Data'
    },
    'eventType': 'SampleEventType',
    'eventTime': datetime(2018, 5, 2),
    'dataVersion': 1
}]

Another option that might make more sense is to pass actual EventGridEvent objects in the list.

Examples with outdated API

In https://github.com/MicrosoftDocs/azure-docs-sdk-python/blob/master/docs-ref-services/data-lake-analytics.md, the example given is with outdated API:

from azure.mgmt.datalake.analytics.account.models import DataLakeAnalyticsAccount, DataLakeStoreAccountInfo

DataLakeStoreAccountInfo has been updated to DataLakeStoreAccountInformation, per https://github.com/Azure/azure-sdk-for-python/blob/430c1a7b95d2910bebf7f89469757b24587c893a/azure-mgmt-datalake-analytics/HISTORY.rst#040-2018-02-12

Example script for Monitor Alerts creates a deprecated resource type

On this page of our docs: https://docs.microsoft.com/en-us/python/api/overview/azure/monitoring?view=azure-python

We provide an example script, but applying it emits the following error:

azure.mgmt.monitor.models.error_response_py3.ErrorResponseException: As part of classic alerts retirement, starting Sep 01, 2019, no new classic alerts can be created except on a few metrics listed here https://aka.ms/classic-alerts-exceptions. All classic alerts including the exceptions listed will stop working after June 2020. It is strongly recommended to use new metric alerts. See https://aka.ms/create-metric-alerts.

This is the very last code snippet on the page.

It looks like it's a fairly straightforward update to use the metric_alerts method in place of the alertrules method for the legacy resource.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.