We recommend using Azure Native.
Azure v6.22.0 published on Tuesday, Apr 1, 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 dictionary
The following arguments are supported:
- Name
This property is required. string - Specifies the Name of the Notification Hub.
- Namespace
Name This property is required. string - Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- Resource
Group Name 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.
- Namespace
Name This property is required. string - Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- Resource
Group Name 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.
- namespace
Name This property is required. String - Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- resource
Group Name 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.
- namespace
Name This property is required. string - Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- resource
Group Name 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.
- namespace
Name This property is required. String - Specifies the Name of the Notification Hub Namespace which contains the Notification Hub.
- resource
Group Name 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:
- Apns
Credentials List<GetHub Apns Credential> - A
apns_credential
block as defined below. - Gcm
Credentials List<GetHub Gcm Credential> - 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
- Namespace
Name string - Resource
Group stringName - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Apns
Credentials []GetHub Apns Credential - A
apns_credential
block as defined below. - Gcm
Credentials []GetHub Gcm Credential - 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
- Namespace
Name string - Resource
Group stringName - map[string]string
- A mapping of tags to assign to the resource.
- apns
Credentials List<GetHub Apns Credential> - A
apns_credential
block as defined below. - gcm
Credentials List<GetHub Gcm Credential> - 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
- namespace
Name String - resource
Group StringName - Map<String,String>
- A mapping of tags to assign to the resource.
- apns
Credentials GetHub Apns Credential[] - A
apns_credential
block as defined below. - gcm
Credentials GetHub Gcm Credential[] - 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
- namespace
Name string - resource
Group stringName - {[key: string]: string}
- A mapping of tags to assign to the resource.
- apns_
credentials Sequence[GetHub Apns Credential] - A
apns_credential
block as defined below. - gcm_
credentials Sequence[GetHub Gcm Credential] - 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_ strname - Mapping[str, str]
- A mapping of tags to assign to the resource.
- apns
Credentials List<Property Map> - A
apns_credential
block as defined below. - gcm
Credentials 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
- namespace
Name String - resource
Group StringName - Map<String>
- A mapping of tags to assign to the resource.
Supporting Types
GetHubApnsCredential
- Application
Mode This property is required. string - The Application Mode which defines which server the APNS Messages should be sent to. Possible values are
Production
andSandbox
. - Bundle
Id This property is required. string - The Bundle ID of the iOS/macOS application to send push notifications for, such as
com.org.example
. - Key
Id This property is required. string - The Apple Push Notifications Service (APNS) Key.
- Team
Id 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. string - The Application Mode which defines which server the APNS Messages should be sent to. Possible values are
Production
andSandbox
. - Bundle
Id This property is required. string - The Bundle ID of the iOS/macOS application to send push notifications for, such as
com.org.example
. - Key
Id This property is required. string - The Apple Push Notifications Service (APNS) Key.
- Team
Id 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. String - The Application Mode which defines which server the APNS Messages should be sent to. Possible values are
Production
andSandbox
. - bundle
Id This property is required. String - The Bundle ID of the iOS/macOS application to send push notifications for, such as
com.org.example
. - key
Id This property is required. String - The Apple Push Notifications Service (APNS) Key.
- team
Id 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. string - The Application Mode which defines which server the APNS Messages should be sent to. Possible values are
Production
andSandbox
. - bundle
Id This property is required. string - The Bundle ID of the iOS/macOS application to send push notifications for, such as
com.org.example
. - key
Id This property is required. string - The Apple Push Notifications Service (APNS) Key.
- team
Id 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
andSandbox
. - 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.
- application
Mode This property is required. String - The Application Mode which defines which server the APNS Messages should be sent to. Possible values are
Production
andSandbox
. - bundle
Id This property is required. String - The Bundle ID of the iOS/macOS application to send push notifications for, such as
com.org.example
. - key
Id This property is required. String - The Apple Push Notifications Service (APNS) Key.
- team
Id 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
- Api
Key This property is required. string - The API Key associated with the Google Cloud Messaging service.
- Api
Key This property is required. string - The API Key associated with the Google Cloud Messaging service.
- api
Key This property is required. String - The API Key associated with the Google Cloud Messaging service.
- api
Key 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.
- api
Key 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.