0

Could someone advice me or show me example of how to obtain public IP through Azure API on linux? I know that I can obtain public IP through wget, curl etc. but those use external domain and I would like to avoid it. There is some SDK for Python but I couldn't run any function.

I think maybe one of these my return what I need:
NetworkInterfaceIPConfigurationsOperations class
NetworkInterfacesOperations class

1 Answer 1

1

You should start with the Python tutorial https://learn.microsoft.com/en-us/python/azure/python-sdk-azure-get-started?view=azure-python

And then some network example: https://learn.microsoft.com/en-us/python/api/overview/azure/network?view=azure-python

Once you're confortable with the NetworkManagementClient client, you can do:

    result_get = network_client.public_ip_addresses.get(
        resource_group_name,
        public_ip_name,
    )

network_client.public_ip_addresses being an instance of https://learn.microsoft.com/en-us/python/api/azure.mgmt.network.v2018_02_01.operations.publicipaddressesoperations?view=azure-python

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.