We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.notificationhub.getHub
Explore with Pulumi AI
Use this data source to access information about an existing Notification Hub within a Notification Hub Namespace.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.notificationhub.getHub({
    name: "notification-hub",
    namespaceName: "namespace-name",
    resourceGroupName: "resource-group-name",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.notificationhub.get_hub(name="notification-hub",
    namespace_name="namespace-name",
    resource_group_name="resource-group-name")
pulumi.export("id", example.id)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/notificationhub"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := notificationhub.LookupHub(ctx, ¬ificationhub.LookupHubArgs{
			Name:              "notification-hub",
			NamespaceName:     "namespace-name",
			ResourceGroupName: "resource-group-name",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.NotificationHub.GetHub.Invoke(new()
    {
        Name = "notification-hub",
        NamespaceName = "namespace-name",
        ResourceGroupName = "resource-group-name",
    });
    return new Dictionary<string, object?>
    {
        ["id"] = example.Apply(getHubResult => getHubResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.notificationhub.NotificationhubFunctions;
import com.pulumi.azure.notificationhub.inputs.GetHubArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = NotificationhubFunctions.getHub(GetHubArgs.builder()
            .name("notification-hub")
            .namespaceName("namespace-name")
            .resourceGroupName("resource-group-name")
            .build());
        ctx.export("id", example.applyValue(getHubResult -> getHubResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:notificationhub:getHub
      arguments:
        name: notification-hub
        namespaceName: namespace-name
        resourceGroupName: resource-group-name
outputs:
  id: ${example.id}
Using getHub
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getHub(args: GetHubArgs, opts?: InvokeOptions): Promise<GetHubResult>
function getHubOutput(args: GetHubOutputArgs, opts?: InvokeOptions): Output<GetHubResult>def get_hub(name: Optional[str] = None,
            namespace_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetHubResult
def get_hub_output(name: Optional[pulumi.Input[str]] = None,
            namespace_name: Optional[pulumi.Input[str]] = None,
            resource_group_name: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetHubResult]func LookupHub(ctx *Context, args *LookupHubArgs, opts ...InvokeOption) (*LookupHubResult, error)
func LookupHubOutput(ctx *Context, args *LookupHubOutputArgs, opts ...InvokeOption) LookupHubResultOutput> Note: This function is named LookupHub in the Go SDK.
public static class GetHub 
{
    public static Task<GetHubResult> InvokeAsync(GetHubArgs args, InvokeOptions? opts = null)
    public static Output<GetHubResult> Invoke(GetHubInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetHubResult> getHub(GetHubArgs args, InvokeOptions options)
public static Output<GetHubResult> getHub(GetHubArgs args, InvokeOptions options)
fn::invoke:
  function: azure:notificationhub/getHub:getHub
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- Specifies the Name of the Notification Hub.
- NamespaceName string
- Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- ResourceGroup stringName 
- Specifies the Name of the Resource Group within which the Notification Hub exists.
- Name string
- Specifies the Name of the Notification Hub.
- NamespaceName string
- Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- ResourceGroup stringName 
- Specifies the Name of the Resource Group within which the Notification Hub exists.
- name String
- Specifies the Name of the Notification Hub.
- namespaceName String
- Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- resourceGroup StringName 
- Specifies the Name of the Resource Group within which the Notification Hub exists.
- name string
- Specifies the Name of the Notification Hub.
- namespaceName string
- Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- resourceGroup stringName 
- Specifies the Name of the Resource Group within which the Notification Hub exists.
- name str
- Specifies the Name of the Notification Hub.
- namespace_name str
- Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- resource_group_ strname 
- Specifies the Name of the Resource Group within which the Notification Hub exists.
- name String
- Specifies the Name of the Notification Hub.
- namespaceName String
- Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- resourceGroup StringName 
- Specifies the Name of the Resource Group within which the Notification Hub exists.
getHub Result
The following output properties are available:
- ApnsCredentials List<GetHub Apns Credential> 
- A apns_credentialblock as defined below.
- GcmCredentials List<GetHub Gcm Credential> 
- A gcm_credentialblock as defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region in which this Notification Hub exists.
- Name string
- NamespaceName string
- ResourceGroup stringName 
- Dictionary<string, string>
- A mapping of tags to assign to the resource.
- ApnsCredentials []GetHub Apns Credential 
- A apns_credentialblock as defined below.
- GcmCredentials []GetHub Gcm Credential 
- A gcm_credentialblock as defined below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The Azure Region in which this Notification Hub exists.
- Name string
- NamespaceName string
- ResourceGroup stringName 
- map[string]string
- A mapping of tags to assign to the resource.
- apnsCredentials List<GetHub Apns Credential> 
- A apns_credentialblock as defined below.
- gcmCredentials List<GetHub Gcm Credential> 
- A gcm_credentialblock as defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region in which this Notification Hub exists.
- name String
- namespaceName String
- resourceGroup StringName 
- Map<String,String>
- A mapping of tags to assign to the resource.
- apnsCredentials GetHub Apns Credential[] 
- A apns_credentialblock as defined below.
- gcmCredentials GetHub Gcm Credential[] 
- A gcm_credentialblock as defined below.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- The Azure Region in which this Notification Hub exists.
- name string
- namespaceName string
- resourceGroup stringName 
- {[key: string]: string}
- A mapping of tags to assign to the resource.
- apns_credentials Sequence[GetHub Apns Credential] 
- A apns_credentialblock as defined below.
- gcm_credentials Sequence[GetHub Gcm Credential] 
- A gcm_credentialblock as defined below.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- The Azure Region in which this Notification Hub exists.
- name str
- namespace_name str
- resource_group_ strname 
- Mapping[str, str]
- A mapping of tags to assign to the resource.
- apnsCredentials List<Property Map>
- A apns_credentialblock as defined below.
- gcmCredentials List<Property Map>
- A gcm_credentialblock as defined below.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- The Azure Region in which this Notification Hub exists.
- name String
- namespaceName String
- resourceGroup StringName 
- Map<String>
- A mapping of tags to assign to the resource.
Supporting Types
GetHubApnsCredential   
- ApplicationMode string
- The Application Mode which defines which server the APNS Messages should be sent to. Possible values are ProductionandSandbox.
- BundleId string
- The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
- KeyId string
- The Apple Push Notifications Service (APNS) Key.
- TeamId string
- The ID of the team the Token.
- Token string
- The Push Token associated with the Apple Developer Account.
- ApplicationMode string
- The Application Mode which defines which server the APNS Messages should be sent to. Possible values are ProductionandSandbox.
- BundleId string
- The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
- KeyId string
- The Apple Push Notifications Service (APNS) Key.
- TeamId string
- The ID of the team the Token.
- Token string
- The Push Token associated with the Apple Developer Account.
- applicationMode String
- The Application Mode which defines which server the APNS Messages should be sent to. Possible values are ProductionandSandbox.
- bundleId String
- The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
- keyId String
- The Apple Push Notifications Service (APNS) Key.
- teamId String
- The ID of the team the Token.
- token String
- The Push Token associated with the Apple Developer Account.
- applicationMode string
- The Application Mode which defines which server the APNS Messages should be sent to. Possible values are ProductionandSandbox.
- bundleId string
- The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
- keyId string
- The Apple Push Notifications Service (APNS) Key.
- teamId string
- The ID of the team the Token.
- token string
- The Push Token associated with the Apple Developer Account.
- application_mode str
- The Application Mode which defines which server the APNS Messages should be sent to. Possible values are ProductionandSandbox.
- bundle_id str
- The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
- key_id str
- The Apple Push Notifications Service (APNS) Key.
- team_id str
- The ID of the team the Token.
- token str
- The Push Token associated with the Apple Developer Account.
- applicationMode String
- The Application Mode which defines which server the APNS Messages should be sent to. Possible values are ProductionandSandbox.
- bundleId String
- The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
- keyId String
- The Apple Push Notifications Service (APNS) Key.
- teamId String
- The ID of the team the Token.
- token String
- The Push Token associated with the Apple Developer Account.
GetHubGcmCredential   
- ApiKey string
- The API Key associated with the Google Cloud Messaging service.
- ApiKey string
- The API Key associated with the Google Cloud Messaging service.
- apiKey String
- The API Key associated with the Google Cloud Messaging service.
- apiKey string
- The API Key associated with the Google Cloud Messaging service.
- api_key str
- The API Key associated with the Google Cloud Messaging service.
- apiKey String
- The API Key associated with the Google Cloud Messaging service.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.