有没有简单的方法来将一个服务总线中的所有队列复制粘贴到另一个服务总线中?
您可以使用 ARM 模板创建和部署基础结构。了解更多关于 ARM 模板的内容,请访问
ARM 模板
1. 创建一个服务总线。
2. 创建队列。
3. 转到资源组并选择服务总线。
4. 点击右侧的三个点,选择导出模板。
5. ARM 模板导出。
6. ARM 模板 JSON。
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"namespaces_punitmt_name": {
"defaultValue": "punitmt",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.ServiceBus/namespaces",
"apiVersion": "2022-01-01-preview",
"name": "[parameters('namespaces_punitmt_name')]",
"location": "East US",
"sku": {
"name": "Standard",
"tier": "Standard"
},
"properties": {
"minimumTlsVersion": "1.2",
"publicNetworkAccess": "Enabled",
"disableLocalAuth": false,
"zoneRedundant": false
}
},
{
"type": "Microsoft.ServiceBus/namespaces/AuthorizationRules",
"apiVersion": "2022-01-01-preview",
"name": "[concat(parameters('namespaces_punitmt_name'), '/RootManageSharedAccessKey')]",
"location": "East US",
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces', parameters('namespaces_punitmt_name'))]"
],
"properties": {
"rights": [
"Listen",
"Manage",
"Send"
]
}
},
{
"type": "Microsoft.ServiceBus/namespaces/networkRuleSets",
"apiVersion": "2022-01-01-preview",
"name": "[concat(parameters('namespaces_punitmt_name'), '/default')]",
"location": "East US",
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces', parameters('namespaces_punitmt_name'))]"
],
"properties": {
"publicNetworkAccess": "Enabled",
"defaultAction": "Allow",
"virtualNetworkRules": [],
"ipRules": []
}
},
{
"type": "Microsoft.ServiceBus/namespaces/queues",
"apiVersion": "2022-01-01-preview",
"name": "[concat(parameters('namespaces_punitmt_name'), '/message1')]",
"location": "eastus",
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces', parameters('namespaces_punitmt_name'))]"
],
"properties": {
"maxMessageSizeInKilobytes": 256,
"lockDuration": "PT30S",
"maxSizeInMegabytes": 1024,
"requiresDuplicateDetection": false,
"requiresSession": false,
"defaultMessageTimeToLive": "P14D",
"deadLetteringOnMessageExpiration": false,
"enableBatchedOperations": true,
"duplicateDetectionHistoryTimeWindow": "PT10M",
"maxDeliveryCount": 10,
"status": "Active",
"autoDeleteOnIdle": "P10675199DT2H48M5.4775807S",
"enablePartitioning": false,
"enableExpress": false
}
},
{
"type": "Microsoft.ServiceBus/namespaces/queues",
"apiVersion": "2022-01-01-preview",
"name": "[concat(parameters('namespaces_punitmt_name'), '/message2')]",
"location": "eastus",
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces', parameters('namespaces_punitmt_name'))]"
],
"properties": {
"maxMessageSizeInKilobytes": 256,
"lockDuration": "PT30S",
"maxSizeInMegabytes": 1024,
"requiresDuplicateDetection": false,
"requiresSession": false,
"defaultMessageTimeToLive": "P14D",
"deadLetteringOnMessageExpiration": false,
"enableBatchedOperations": true,
"duplicateDetectionHistoryTimeWindow": "PT10M",
"maxDeliveryCount": 10,
"status": "Active",
"autoDeleteOnIdle": "P10675199DT2H48M5.4775807S",
"enablePartitioning": false,
"enableExpress": false
}
}
]
}
您可以使用这些ARM模板来创建相同的内容。