azure-samples / azure-samples-python-management Goto Github PK
View Code? Open in Web Editor NEWThis repo contains sample code for management libraries of Azure SDK for Python
License: MIT License
This repo contains sample code for management libraries of Azure SDK for Python
License: MIT License
I'm able to create to create the container group and the container runs fine, but I wanted to know how to add networking parameters to the following lines so that the container can be accessed publicly.
For reference, I'm trying to create a publicly accessible container instance with networking properties similar to the ones here:
I wan to be able to put there parameters into the code so that using python, I can create the container instance with desired networking configurations. Please, I need to do this urgently, any help would be appreciated.
Would be good to get some samples on dealing with reservations as there does not seem to be any examples of this module on the web
In testing I found the only property the server interprets is the "name" and all the others are ignored. For example you can ask for a name "F1", tier "Premium", size "B1" and you get an F1.
Related documentation issue: Azure/azure-sdk-for-python#16251
With the necessity of installing multiple dependencies and then the overhead of managing and updating them, utilizing the REST API instead of the Python SDK has been easier. There are no dependencies as requests is bulit-in and there's no updates required. While I think the Python SDK is still necessary, I wanted to provide this perspective for developers to just use requests
and make the REST API call is also a good solution.
It also looks like the samples have the sample JSON data structures that the REST API expects too.
I'm trying to integrate an existing account with the Overture API using Microsoft Synapse SQL queries. I haven't encountered much documentation in doing so.
Specifically I was wondering if it was possible through this python library to:
Is this possible and is azure-mgmt-synapse the appropriate library for achieving this? If so where can I best find documentation for this?
When I create the CostManagementClient object, there is nothing wrong, but when I use the CostManagementClient object to send a request, the error occurred.
How can I handle the exception Error?
'''
azure.core.exceptions.ServiceRequestError: <urllib3.connection.HTTPSConnection object at 0x00000276CD390490>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
'''
Based on the example here: Quickstart: Your first Python query - Azure Resource Graph | Microsoft Learn
Is there an example showing how to properly use the QueryRequestOptions skip_token for pagination?
Missing Azure Lab Services April 2022 update sample
There is very little to no documentation on managing quotas via the python SDK. The current example listed under samples for quota is confusing and doesn't show how to get a current quota, or detail how to get request an update, get a status update on the request, etc...
There's a good example for the Recovery Services module, but none for the much larger, more complex Recovery Services Backup module. It would be very useful to see a script that creates a Policy, attaches a vm to it, backs up that vm, and restores that vm from a backup.
I am trying to create a service queue using Python SDK in my Azure account.
While trying to run the file manage_topic.py (https://github.com/Azure-Samples/azure-samples-python-management/blob/master/samples/servicebus/manage_topic.py), I am getting below error:
Please suggest how I can fix the error and create a service bus queue using Python SDK
__servicebus_client = ServiceBusManagementClient( TypeError: __init__() got an unexpected keyword argument 'credential'__
Hello,
Please fix the network samples after recent breaking changes as mentioned here: azure-mgmt-network 23.0.0.
Current sample is almost 3 years old and might not relevant with the current Python and Azure SDK versions.
Thanks!
using the sdk for creating vnets and subnets in azure, and when adding a new route table entry, the new route table entry removed all existsing routes and added the new route to the route table.
The expected behavior would be to add another entry to the route table, rather than replace the route table contents with a single entry.
here is the sample code...
routeTableResponse = network_client.route_tables.begin_create_or_update(
resource_group_name=rgname,
route_table_name=rtname,
parameters={
"location": region,
"properties": {
"disableBgpRoutePropagation": False,
"routes": [
{
"name": newvnetname,
"properties": {
"addressPrefix": newvnetprefix,
"nextHopType": "VirtualAppliance",
"nextHopIpAddress": hublbipaddress}
}
],
}
}
).result()
I am missing an up-to-date sample for Cost Management. Can you please add some? I could not find anything.
The requirements.txt requested azure-mgmt-core
version 1.2.0. However, azure-mgmt-resource
version 20.1.0 depends on azure-mgmt-core
<2.0.0 and >=1.3.0
From the samples I can only know how to create_or_update
a Public IP/Interface or just delete
it (if I try to delete an attached IP, there will be an exception and ask me to detach the Public IP from Interface first).
So how can I detach a Public IP from Interface ?
Hi,
I am using CollectionPartitionOperations -> list_metrics.
metrics = client.collection_partition.list_metrics(
resource_group,
account_name,
database_rid,
container_rid,
"(name.value eq 'Data Size') and timeGrain eq duration'P1D' and startTime eq '2023-01-01T13:53:55.2780000Z' and endTime eq '2023-01-31T15:58:55.2780000Z'"
)
for metric in metrics:
print(metric)
Not printing anything.
I set 80,000 throughputs in my container.
We are using:
Python Azure SDK - azure-mgmt-cosmosdb==6.4.0
The document we follow:
https://learn.microsoft.com/en-us/python/api/azure-mgmt-cosmosdb/azure.mgmt.cosmosdb.operations.collectionpartitionoperations?view=azure-python
wrong import seen in manage_activity_log_alert.py
probably there are more broken imports due to refactoring going on and probable all samples should be re-validated for broken imports..
correct are:
[..]
from azure.mgmt.monitor import MonitorManagementClient
[..]
monitor_client = MonitorManagementClient(
credential=DefaultAzureCredential(),
subscription_id=SUBSCRIPTION_ID
)
The sample located here:
https://github.com/Azure-Samples/azure-samples-python-management/blob/main/samples/consumption/manage_consumption.py
Is not possible with the newest version of the CostManagementClient, which does not include budgets
nor anything similar.
Using example from:
When a request is made, it completes without printing the response, thus we are having to check if it was successful by running a new query to check the current quota limit to see if it has increased. This sample provided is very bare, and non-functional. Increased documentation / examples on the quota lib would be very helpful.
Hello,
I've been struggling finding some samples that will allows me to change/add CA certificate to my IotHub instance. Is there any sample available ?
Here what I began to do, but it doesn't work...
new_cert_pem: str = "---BEGIN CERTIFICATE----aaag..." # PEM format
environ['AZURE_CLIENT_ID'] = ""
environ['AZURE_TENANT_ID'] = ""
environ['AZURE_CLIENT_SECRET'] = ""
iothub_client = IotHubClient(
credential=DefaultAzureCredential(),
subscription_id=environ['AZ_SUBCRIPTION_ID']
)
iothub_client.certificates.create_or_update(
resource_group_name="iothub",
resource_name="myiothub",
certificate_name="CA-TO-ADD"
certificate_description=CertificateBodyDescription(
certificate=new_cert_pem.decode('utf8'),
is_verified=True
)
)
Thanks for your help !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.