1. Packages
  2. Azure Classic
  3. API Docs
  4. notificationhub
  5. getHub

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.notificationhub.getHub

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

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);
Copy
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)
Copy
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, &notificationhub.LookupHubArgs{
			Name:              "notification-hub",
			NamespaceName:     "namespace-name",
			ResourceGroupName: "resource-group-name",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", example.Id)
		return nil
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:notificationhub:getHub
      arguments:
        name: notification-hub
        namespaceName: namespace-name
        resourceGroupName: resource-group-name
outputs:
  id: ${example.id}
Copy

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>
Copy
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]
Copy
func LookupHub(ctx *Context, args *LookupHubArgs, opts ...InvokeOption) (*LookupHubResult, error)
func LookupHubOutput(ctx *Context, args *LookupHubOutputArgs, opts ...InvokeOption) LookupHubResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetHubResult> getHub(GetHubArgs args, InvokeOptions options)
public static Output<GetHubResult> getHub(GetHubArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:notificationhub/getHub:getHub
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Specifies the Name of the Notification Hub.
NamespaceName This property is required. string
Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
ResourceGroupName This property is required. string
Specifies the Name of the Resource Group within which the Notification Hub exists.
Name This property is required. string
Specifies the Name of the Notification Hub.
NamespaceName This property is required. string
Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
ResourceGroupName This property is required. string
Specifies the Name of the Resource Group within which the Notification Hub exists.
name This property is required. String
Specifies the Name of the Notification Hub.
namespaceName This property is required. String
Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
resourceGroupName This property is required. String
Specifies the Name of the Resource Group within which the Notification Hub exists.
name This property is required. string
Specifies the Name of the Notification Hub.
namespaceName This property is required. string
Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
resourceGroupName This property is required. string
Specifies the Name of the Resource Group within which the Notification Hub exists.
name This property is required. str
Specifies the Name of the Notification Hub.
namespace_name This property is required. str
Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
resource_group_name This property is required. str
Specifies the Name of the Resource Group within which the Notification Hub exists.
name This property is required. String
Specifies the Name of the Notification Hub.
namespaceName This property is required. String
Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
resourceGroupName This property is required. String
Specifies the Name of the Resource Group within which the Notification Hub exists.

getHub Result

The following output properties are available:

ApnsCredentials List<GetHubApnsCredential>
A apns_credential block as defined below.
GcmCredentials List<GetHubGcmCredential>
A gcm_credential block 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
ResourceGroupName string
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
ApnsCredentials []GetHubApnsCredential
A apns_credential block as defined below.
GcmCredentials []GetHubGcmCredential
A gcm_credential block 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
ResourceGroupName string
Tags map[string]string
A mapping of tags to assign to the resource.
apnsCredentials List<GetHubApnsCredential>
A apns_credential block as defined below.
gcmCredentials List<GetHubGcmCredential>
A gcm_credential block 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
resourceGroupName String
tags Map<String,String>
A mapping of tags to assign to the resource.
apnsCredentials GetHubApnsCredential[]
A apns_credential block as defined below.
gcmCredentials GetHubGcmCredential[]
A gcm_credential block 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
resourceGroupName string
tags {[key: string]: string}
A mapping of tags to assign to the resource.
apns_credentials Sequence[GetHubApnsCredential]
A apns_credential block as defined below.
gcm_credentials Sequence[GetHubGcmCredential]
A gcm_credential block 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_name str
tags Mapping[str, str]
A mapping of tags to assign to the resource.
apnsCredentials List<Property Map>
A apns_credential block as defined below.
gcmCredentials List<Property Map>
A gcm_credential block 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
resourceGroupName String
tags Map<String>
A mapping of tags to assign to the resource.

Supporting Types

GetHubApnsCredential

ApplicationMode This property is required. string
The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
BundleId This property is required. string
The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
KeyId This property is required. string
The Apple Push Notifications Service (APNS) Key.
TeamId This property is required. string
The ID of the team the Token.
Token This property is required. string
The Push Token associated with the Apple Developer Account.
ApplicationMode This property is required. string
The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
BundleId This property is required. string
The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
KeyId This property is required. string
The Apple Push Notifications Service (APNS) Key.
TeamId This property is required. string
The ID of the team the Token.
Token This property is required. string
The Push Token associated with the Apple Developer Account.
applicationMode This property is required. String
The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
bundleId This property is required. String
The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
keyId This property is required. String
The Apple Push Notifications Service (APNS) Key.
teamId This property is required. String
The ID of the team the Token.
token This property is required. String
The Push Token associated with the Apple Developer Account.
applicationMode This property is required. string
The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
bundleId This property is required. string
The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
keyId This property is required. string
The Apple Push Notifications Service (APNS) Key.
teamId This property is required. string
The ID of the team the Token.
token This property is required. string
The Push Token associated with the Apple Developer Account.
application_mode This property is required. str
The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
bundle_id This property is required. str
The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
key_id This property is required. str
The Apple Push Notifications Service (APNS) Key.
team_id This property is required. str
The ID of the team the Token.
token This property is required. str
The Push Token associated with the Apple Developer Account.
applicationMode This property is required. String
The Application Mode which defines which server the APNS Messages should be sent to. Possible values are Production and Sandbox.
bundleId This property is required. String
The Bundle ID of the iOS/macOS application to send push notifications for, such as com.org.example.
keyId This property is required. String
The Apple Push Notifications Service (APNS) Key.
teamId This property is required. String
The ID of the team the Token.
token This property is required. String
The Push Token associated with the Apple Developer Account.

GetHubGcmCredential

ApiKey This property is required. string
The API Key associated with the Google Cloud Messaging service.
ApiKey This property is required. string
The API Key associated with the Google Cloud Messaging service.
apiKey This property is required. String
The API Key associated with the Google Cloud Messaging service.
apiKey This property is required. string
The API Key associated with the Google Cloud Messaging service.
api_key This property is required. str
The API Key associated with the Google Cloud Messaging service.
apiKey This property is required. 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 azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi