Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Retrieve connection strings and primary key Azure Event Hub

$
0
0

Hi,

I have created Azure Service Bus namespace,queue and event hub and the respective authorization rules using ARM template. Now I want to retrieve the connection string and the primary keys using Azure PowerShell without using the ServiceBus.dll.

Is it possible?

As a temporary work around I have created a dummy ARM template which returns the connection string and primary key.

{"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","contentVersion": "1.0.0.0","parameters": {"serviceBusNamespace": {"type": "string","minLength": 1,"metadata": {"description": "The name of the service bus namespace to create."
            }
        },"resourceName": {"type": "string","minLength": 1,"metadata": {"description": "The name of the resource to be retreived."
            }
        },"resourceType": {"type": "string","minLength": 1,"allowedValues": ["queues","eventhubs"
            ],"metadata": {"description": "The type of the resource"
            }
        },"policy": {"type": "string","minLength": 1,"defaultValue": "ManagePolicy","allowedValues": ["ManagePolicy","SendPolicy","ListenPolicy"
            ],"metadata": {"description": "The type of the resource"
            }
        }
    },"variables": {
    },"resources": [ ],"outputs": {"connectionString": {"type": "string","value": "[listKeys(resourceId(concat('Microsoft.ServiceBus/namespaces/',parameters('resourceType'),'/authorizationRules'),parameters('serviceBusNamespace'),parameters('resourceName'),parameters('policy')),'2015-08-01').primaryConnectionString]"
        },"primaryKey": {"type": "string","value": "[listKeys(resourceId(concat('Microsoft.ServiceBus/namespaces/',parameters('resourceType'),'/authorizationRules'),parameters('serviceBusNamespace'),parameters('resourceName'),parameters('policy')),'2015-08-01').primaryKey]"
        }
    }
}
Is it a way to go temporarily?


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>