[Automation] Collect examples from azure-sdk-for-python#azure-mgmt-servicebus_8.2.0

Co-authored-by: azure-sdk <azuresdk@microsoft.com>
This commit is contained in:
Azure-Fluent 2023-02-20 08:03:04 +08:00 коммит произвёл GitHub
Родитель fd2aa6d998
Коммит 5655f3da13
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
134 изменённых файлов: 2430 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_migrationconfiguration_complete_migration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SubscriptionId",
)
response = client.migration_configs.complete_migration(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-41",
config_name="$default",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,40 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_migrationconfiguration_create_and_start_migration.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SubscriptionId",
)
response = client.migration_configs.begin_create_and_start_migration(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-41",
config_name="$default",
parameters={
"properties": {
"postMigrationName": "sdk-PostMigration-5919",
"targetNamespace": "/subscriptions/SubscriptionId/resourceGroups/ResourceGroup/providers/Microsoft.ServiceBus/namespaces/sdk-Namespace-4028",
}
},
).result()
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_migrationconfiguration_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SubscriptionId",
)
response = client.migration_configs.delete(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-41",
config_name="$default",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_migrationconfiguration_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SubscriptionId",
)
response = client.migration_configs.get(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-41",
config_name="$default",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_migrationconfiguration_list.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SubscriptionId",
)
response = client.migration_configs.list(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-9259",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationList.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_migrationconfiguration_revert.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SubscriptionId",
)
response = client.migration_configs.revert(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-41",
config_name="$default",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,43 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python private_end_point_connection_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subID",
)
response = client.private_endpoint_connections.create_or_update(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-2924",
private_endpoint_connection_name="privateEndpointConnectionName",
parameters={
"properties": {
"privateEndpoint": {
"id": "/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-ServiceBus-8396/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-2847"
},
"privateLinkServiceConnectionState": {"description": "testing", "status": "Rejected"},
"provisioningState": "Succeeded",
}
},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python private_end_point_connection_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.private_endpoint_connections.begin_delete(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-3285",
private_endpoint_connection_name="928c44d5-b7c6-423b-b6fa-811e0c27b3e0",
).result()
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python private_end_point_connection_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subID",
)
response = client.private_endpoint_connections.get(
resource_group_name="SDK-ServiceBus-4794",
namespace_name="sdk-Namespace-5828",
private_endpoint_connection_name="privateEndpointConnectionName",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python private_end_point_connection_list.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subID",
)
response = client.private_endpoint_connections.list(
resource_group_name="SDK-ServiceBus-4794",
namespace_name="sdk-Namespace-5828",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionList.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python private_link_resources_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subID",
)
response = client.private_link_resources.get(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-2924",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateLinkResourcesGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_authorization_rule_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.create_or_update_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-6914",
authorization_rule_name="sdk-AuthRules-1788",
parameters={"properties": {"rights": ["Listen", "Send"]}},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_authorization_rule_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.delete_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-namespace-6914",
authorization_rule_name="sdk-AuthRules-1788",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_authorization_rule_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.get_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-6914",
authorization_rule_name="sdk-AuthRules-1788",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_authorization_rule_list_all.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.list_authorization_rules(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-6914",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_authorization_rule_list_key.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.list_keys(
resource_group_name="ArunMonocle",
namespace_name="sdk-namespace-6914",
authorization_rule_name="sdk-AuthRules-1788",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_authorization_rule_regenerate_key.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.regenerate_keys(
resource_group_name="ArunMonocle",
namespace_name="sdk-namespace-6914",
authorization_rule_name="sdk-AuthRules-1788",
parameters={"keyType": "PrimaryKey"},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,32 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_check_name_availability.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.check_name_availability(
parameters={"name": "sdk-Namespace-2924"},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,38 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.begin_create_or_update(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace2924",
parameters={
"location": "South Central US",
"sku": {"name": "Standard", "tier": "Standard"},
"tags": {"tag1": "value1", "tag2": "value2"},
},
).result()
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.begin_delete(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-3285",
).result()
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.get(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-2924",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,31 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_list.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.list()
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceList.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_list_by_resource_group.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.list_by_resource_group(
resource_group_name="ArunMonocle",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceListByResourceGroup.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_name_space_update.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.namespaces.update(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-3285",
parameters={"location": "South Central US", "tags": {"tag3": "value3", "tag4": "value4"}},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceUpdate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,65 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_network_rule_set_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="Subscription",
)
response = client.namespaces.create_or_update_network_rule_set(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-6019",
parameters={
"properties": {
"defaultAction": "Deny",
"ipRules": [
{"action": "Allow", "ipMask": "1.1.1.1"},
{"action": "Allow", "ipMask": "1.1.1.2"},
{"action": "Allow", "ipMask": "1.1.1.3"},
{"action": "Allow", "ipMask": "1.1.1.4"},
{"action": "Allow", "ipMask": "1.1.1.5"},
],
"virtualNetworkRules": [
{
"ignoreMissingVnetServiceEndpoint": True,
"subnet": {
"id": "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"
},
},
{
"ignoreMissingVnetServiceEndpoint": False,
"subnet": {
"id": "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"
},
},
{
"ignoreMissingVnetServiceEndpoint": False,
"subnet": {
"id": "/subscriptions/854d368f-1828-428f-8f3c-f2affa9b2f7d/resourcegroups/alitest/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"
},
},
],
}
},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_network_rule_set_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="Subscription",
)
response = client.namespaces.get_network_rule_set(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-6019",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_network_rule_set_list.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="Subscription",
)
response = client.namespaces.list_network_rule_sets(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-6019",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_authorization_rule_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.create_or_update_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-7982",
queue_name="sdk-Queues-2317",
authorization_rule_name="sdk-AuthRules-5800",
parameters={"properties": {"rights": ["Listen", "Send"]}},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_authorization_rule_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.delete_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-namespace-7982",
queue_name="sdk-Queues-2317",
authorization_rule_name="sdk-AuthRules-5800",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_authorization_rule_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.get_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-7982",
queue_name="sdk-Queues-2317",
authorization_rule_name="sdk-AuthRules-5800",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_authorization_rule_list_all.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.list_authorization_rules(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-7982",
queue_name="sdk-Queues-2317",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleListAll.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_authorization_rule_list_key.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.list_keys(
resource_group_name="ArunMonocle",
namespace_name="sdk-namespace-7982",
queue_name="sdk-Queues-2317",
authorization_rule_name="sdk-AuthRules-5800",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleListKey.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_authorization_rule_regenerate_key.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.regenerate_keys(
resource_group_name="ArunMonocle",
namespace_name="sdk-namespace-7982",
queue_name="sdk-Queues-2317",
authorization_rule_name="sdk-AuthRules-5800",
parameters={"keyType": "PrimaryKey"},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.create_or_update(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-3174",
queue_name="sdk-Queues-5647",
parameters={"properties": {"enablePartitioning": True}},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.delete(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-183",
queue_name="sdk-Queues-8708",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.get(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-3174",
queue_name="sdk-Queues-5647",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_queue_list_by_name_space.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.queues.list_by_namespace(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-3174",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueListByNameSpace.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,42 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python rule_create_correlation_filter.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subscriptionId",
)
response = client.rules.create_or_update(
resource_group_name="resourceGroupName",
namespace_name="sdk-Namespace-1319",
topic_name="sdk-Topics-2081",
subscription_name="sdk-Subscriptions-8691",
rule_name="sdk-Rules-6571",
parameters={
"properties": {
"correlationFilter": {"properties": {"topicHint": "Crop"}},
"filterType": "CorrelationFilter",
}
},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_CorrelationFilter.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,37 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python rule_create_sql_filter.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subscriptionId",
)
response = client.rules.create_or_update(
resource_group_name="resourceGroupName",
namespace_name="sdk-Namespace-1319",
topic_name="sdk-Topics-2081",
subscription_name="sdk-Subscriptions-8691",
rule_name="sdk-Rules-6571",
parameters={"properties": {"filterType": "SqlFilter", "sqlFilter": {"sqlExpression": "myproperty=test"}}},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_SqlFilter.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python rule_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.rules.delete(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-1319",
topic_name="sdk-Topics-2081",
subscription_name="sdk-Subscriptions-8691",
rule_name="sdk-Rules-6571",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python rule_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.rules.get(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-1319",
topic_name="sdk-Topics-2081",
subscription_name="sdk-Subscriptions-8691",
rule_name="sdk-Rules-6571",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python rule_list_by_subscription.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.rules.list_by_subscriptions(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-1319",
topic_name="sdk-Topics-2081",
subscription_name="sdk-Subscriptions-8691",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleListBySubscription.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,31 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_operations_list.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.operations.list()
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/SBOperations_List.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_subscription_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="Subscriptionid",
)
response = client.subscriptions.create_or_update(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-1349",
topic_name="sdk-Topics-8740",
subscription_name="sdk-Subscriptions-2178",
parameters={"properties": {"enableBatchedOperations": True}},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_subscription_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subscriptionId",
)
response = client.subscriptions.delete(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-5882",
topic_name="sdk-Topics-1804",
subscription_name="sdk-Subscriptions-3670",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_subscription_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="Subscriptionid",
)
response = client.subscriptions.get(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-1349",
topic_name="sdk-Topics-8740",
subscription_name="sdk-Subscriptions-2178",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionGet.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_subscription_list_by_topic.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5{Subscriptionid}",
)
response = client.subscriptions.list_by_topic(
resource_group_name="ResourceGroup",
namespace_name="sdk-Namespace-1349",
topic_name="sdk-Topics-8740",
)
for item in response:
print(item)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionListByTopic.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,36 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_topic_authorization_rule_create.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.topics.create_or_update_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-6261",
topic_name="sdk-Topics-1984",
authorization_rule_name="sdk-AuthRules-4310",
parameters={"properties": {"rights": ["Listen", "Send"]}},
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleCreate.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_topic_authorization_rule_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.topics.delete_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-6261",
topic_name="sdk-Topics-1984",
authorization_rule_name="sdk-AuthRules-4310",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleDelete.json
if __name__ == "__main__":
main()

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-servicebus_8.2.0/sdk/servicebus/azure-mgmt-servicebus/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
from azure.identity import DefaultAzureCredential
from azure.mgmt.servicebus import ServiceBusManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-servicebus
# USAGE
python sb_topic_authorization_rule_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ServiceBusManagementClient(
credential=DefaultAzureCredential(),
subscription_id="5f750a97-50d9-4e36-8081-c9ee4c0210d4",
)
response = client.topics.get_authorization_rule(
resource_group_name="ArunMonocle",
namespace_name="sdk-Namespace-6261",
topic_name="sdk-Topics-1984",
authorization_rule_name="sdk-AuthRules-4310",
)
print(response)
# x-ms-original-file: specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleGet.json
if __name__ == "__main__":
main()

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше