-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
List VNET through python returns null #24130
Comments
Hi @satya5186, thanks for your feedback! After investigation, if you want to list Vnet, you should use We prefer to use a dedicated SDK to manage resources, such as |
Hi @satya5186, could you please use followed code to try?
In addition, which version of |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
Describe the bug
List VNET through python returns null
Exception or Stack Trace
No stack trace but value returns NULL
To Reproduce
Steps to reproduce the behavior:
Code Snippet
Add the code snippet that causes the issue.
from azure.identity import AzureCliCredential
from azure.mgmt.resource import ResourceManagementClient
create env variables for below:
export AZURE_CLIENT_ID="" / thi is name in the sp
export AZURE_CLIENT_SECRET="" / thi is password in the sp
export AZURE_TENANT_ID="" / thi is the tenant in the sp
credential = AzureCliCredential()
subscription = "91b48fa1-bfc1-481a-b30e-c063117e7e79"
def azure_vnet_list():
for resource_list in ResourceManagementClient(credential, subscription).resources.list():
if resource_list.type == "Microsoft.Compute/virtualMachines":
print(resource_list.name)
def main():
azure_vnet_list()
if name == "main":
main()
Expected behavior
A clear and concise description of what you expected to happen.
It should list the newly created VNET
Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
Additional context
Add any other context about the problem here.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: