1. Packages
  2. Azure Native
  3. API Docs
  4. notificationhubs
  5. NotificationHubAuthorizationRule
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.3.0 published on Monday, Apr 28, 2025 by Pulumi

azure-native.notificationhubs.NotificationHubAuthorizationRule

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.3.0 published on Monday, Apr 28, 2025 by Pulumi

    Response for POST requests that return single SharedAccessAuthorizationRule.

    Uses Azure REST API version 2023-10-01-preview. In version 2.x of the Azure Native provider, it used API version 2023-01-01-preview.

    Other available API versions: 2023-01-01-preview, 2023-09-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native notificationhubs [ApiVersion]. See the version guide for details.

    Example Usage

    NotificationHubs_CreateOrUpdateAuthorizationRule

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var notificationHubAuthorizationRule = new AzureNative.NotificationHubs.NotificationHubAuthorizationRule("notificationHubAuthorizationRule", new()
        {
            AuthorizationRuleName = "MyManageSharedAccessKey",
            NamespaceName = "nh-sdk-ns",
            NotificationHubName = "nh-sdk-hub",
            ResourceGroupName = "5ktrial",
            Rights = new[]
            {
                AzureNative.NotificationHubs.AccessRights.Listen,
                AzureNative.NotificationHubs.AccessRights.Send,
            },
        });
    
    });
    
    package main
    
    import (
    	notificationhubs "github.com/pulumi/pulumi-azure-native-sdk/notificationhubs/v3"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := notificationhubs.NewNotificationHubAuthorizationRule(ctx, "notificationHubAuthorizationRule", &notificationhubs.NotificationHubAuthorizationRuleArgs{
    			AuthorizationRuleName: pulumi.String("MyManageSharedAccessKey"),
    			NamespaceName:         pulumi.String("nh-sdk-ns"),
    			NotificationHubName:   pulumi.String("nh-sdk-hub"),
    			ResourceGroupName:     pulumi.String("5ktrial"),
    			Rights: pulumi.StringArray{
    				pulumi.String(notificationhubs.AccessRightsListen),
    				pulumi.String(notificationhubs.AccessRightsSend),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.notificationhubs.NotificationHubAuthorizationRule;
    import com.pulumi.azurenative.notificationhubs.NotificationHubAuthorizationRuleArgs;
    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) {
            var notificationHubAuthorizationRule = new NotificationHubAuthorizationRule("notificationHubAuthorizationRule", NotificationHubAuthorizationRuleArgs.builder()
                .authorizationRuleName("MyManageSharedAccessKey")
                .namespaceName("nh-sdk-ns")
                .notificationHubName("nh-sdk-hub")
                .resourceGroupName("5ktrial")
                .rights(            
                    "Listen",
                    "Send")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const notificationHubAuthorizationRule = new azure_native.notificationhubs.NotificationHubAuthorizationRule("notificationHubAuthorizationRule", {
        authorizationRuleName: "MyManageSharedAccessKey",
        namespaceName: "nh-sdk-ns",
        notificationHubName: "nh-sdk-hub",
        resourceGroupName: "5ktrial",
        rights: [
            azure_native.notificationhubs.AccessRights.Listen,
            azure_native.notificationhubs.AccessRights.Send,
        ],
    });
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    notification_hub_authorization_rule = azure_native.notificationhubs.NotificationHubAuthorizationRule("notificationHubAuthorizationRule",
        authorization_rule_name="MyManageSharedAccessKey",
        namespace_name="nh-sdk-ns",
        notification_hub_name="nh-sdk-hub",
        resource_group_name="5ktrial",
        rights=[
            azure_native.notificationhubs.AccessRights.LISTEN,
            azure_native.notificationhubs.AccessRights.SEND,
        ])
    
    resources:
      notificationHubAuthorizationRule:
        type: azure-native:notificationhubs:NotificationHubAuthorizationRule
        properties:
          authorizationRuleName: MyManageSharedAccessKey
          namespaceName: nh-sdk-ns
          notificationHubName: nh-sdk-hub
          resourceGroupName: 5ktrial
          rights:
            - Listen
            - Send
    

    Create NotificationHubAuthorizationRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new NotificationHubAuthorizationRule(name: string, args: NotificationHubAuthorizationRuleArgs, opts?: CustomResourceOptions);
    @overload
    def NotificationHubAuthorizationRule(resource_name: str,
                                         args: NotificationHubAuthorizationRuleArgs,
                                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def NotificationHubAuthorizationRule(resource_name: str,
                                         opts: Optional[ResourceOptions] = None,
                                         namespace_name: Optional[str] = None,
                                         notification_hub_name: Optional[str] = None,
                                         resource_group_name: Optional[str] = None,
                                         rights: Optional[Sequence[Union[str, AccessRights]]] = None,
                                         authorization_rule_name: Optional[str] = None,
                                         location: Optional[str] = None,
                                         primary_key: Optional[str] = None,
                                         secondary_key: Optional[str] = None,
                                         tags: Optional[Mapping[str, str]] = None)
    func NewNotificationHubAuthorizationRule(ctx *Context, name string, args NotificationHubAuthorizationRuleArgs, opts ...ResourceOption) (*NotificationHubAuthorizationRule, error)
    public NotificationHubAuthorizationRule(string name, NotificationHubAuthorizationRuleArgs args, CustomResourceOptions? opts = null)
    public NotificationHubAuthorizationRule(String name, NotificationHubAuthorizationRuleArgs args)
    public NotificationHubAuthorizationRule(String name, NotificationHubAuthorizationRuleArgs args, CustomResourceOptions options)
    
    type: azure-native:notificationhubs:NotificationHubAuthorizationRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args NotificationHubAuthorizationRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args NotificationHubAuthorizationRuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args NotificationHubAuthorizationRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NotificationHubAuthorizationRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NotificationHubAuthorizationRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var notificationHubAuthorizationRuleResource = new AzureNative.NotificationHubs.NotificationHubAuthorizationRule("notificationHubAuthorizationRuleResource", new()
    {
        NamespaceName = "string",
        NotificationHubName = "string",
        ResourceGroupName = "string",
        Rights = new[]
        {
            "string",
        },
        AuthorizationRuleName = "string",
        Location = "string",
        PrimaryKey = "string",
        SecondaryKey = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := notificationhubs.NewNotificationHubAuthorizationRule(ctx, "notificationHubAuthorizationRuleResource", &notificationhubs.NotificationHubAuthorizationRuleArgs{
    	NamespaceName:       pulumi.String("string"),
    	NotificationHubName: pulumi.String("string"),
    	ResourceGroupName:   pulumi.String("string"),
    	Rights: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	AuthorizationRuleName: pulumi.String("string"),
    	Location:              pulumi.String("string"),
    	PrimaryKey:            pulumi.String("string"),
    	SecondaryKey:          pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var notificationHubAuthorizationRuleResource = new NotificationHubAuthorizationRule("notificationHubAuthorizationRuleResource", NotificationHubAuthorizationRuleArgs.builder()
        .namespaceName("string")
        .notificationHubName("string")
        .resourceGroupName("string")
        .rights("string")
        .authorizationRuleName("string")
        .location("string")
        .primaryKey("string")
        .secondaryKey("string")
        .tags(Map.of("string", "string"))
        .build());
    
    notification_hub_authorization_rule_resource = azure_native.notificationhubs.NotificationHubAuthorizationRule("notificationHubAuthorizationRuleResource",
        namespace_name="string",
        notification_hub_name="string",
        resource_group_name="string",
        rights=["string"],
        authorization_rule_name="string",
        location="string",
        primary_key="string",
        secondary_key="string",
        tags={
            "string": "string",
        })
    
    const notificationHubAuthorizationRuleResource = new azure_native.notificationhubs.NotificationHubAuthorizationRule("notificationHubAuthorizationRuleResource", {
        namespaceName: "string",
        notificationHubName: "string",
        resourceGroupName: "string",
        rights: ["string"],
        authorizationRuleName: "string",
        location: "string",
        primaryKey: "string",
        secondaryKey: "string",
        tags: {
            string: "string",
        },
    });
    
    type: azure-native:notificationhubs:NotificationHubAuthorizationRule
    properties:
        authorizationRuleName: string
        location: string
        namespaceName: string
        notificationHubName: string
        primaryKey: string
        resourceGroupName: string
        rights:
            - string
        secondaryKey: string
        tags:
            string: string
    

    NotificationHubAuthorizationRule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The NotificationHubAuthorizationRule resource accepts the following input properties:

    NamespaceName string
    Namespace name
    NotificationHubName string
    Notification Hub name
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    Rights List<Union<string, Pulumi.AzureNative.NotificationHubs.AccessRights>>
    Gets or sets the rights associated with the rule.
    AuthorizationRuleName string
    Authorization Rule Name
    Location string
    Deprecated - only for compatibility.
    PrimaryKey string
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    SecondaryKey string
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    Tags Dictionary<string, string>
    Deprecated - only for compatibility.
    NamespaceName string
    Namespace name
    NotificationHubName string
    Notification Hub name
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    Rights []string
    Gets or sets the rights associated with the rule.
    AuthorizationRuleName string
    Authorization Rule Name
    Location string
    Deprecated - only for compatibility.
    PrimaryKey string
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    SecondaryKey string
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    Tags map[string]string
    Deprecated - only for compatibility.
    namespaceName String
    Namespace name
    notificationHubName String
    Notification Hub name
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    rights List<Either<String,AccessRights>>
    Gets or sets the rights associated with the rule.
    authorizationRuleName String
    Authorization Rule Name
    location String
    Deprecated - only for compatibility.
    primaryKey String
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    secondaryKey String
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    tags Map<String,String>
    Deprecated - only for compatibility.
    namespaceName string
    Namespace name
    notificationHubName string
    Notification Hub name
    resourceGroupName string
    The name of the resource group. The name is case insensitive.
    rights (string | AccessRights)[]
    Gets or sets the rights associated with the rule.
    authorizationRuleName string
    Authorization Rule Name
    location string
    Deprecated - only for compatibility.
    primaryKey string
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    secondaryKey string
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    tags {[key: string]: string}
    Deprecated - only for compatibility.
    namespace_name str
    Namespace name
    notification_hub_name str
    Notification Hub name
    resource_group_name str
    The name of the resource group. The name is case insensitive.
    rights Sequence[Union[str, AccessRights]]
    Gets or sets the rights associated with the rule.
    authorization_rule_name str
    Authorization Rule Name
    location str
    Deprecated - only for compatibility.
    primary_key str
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    secondary_key str
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    tags Mapping[str, str]
    Deprecated - only for compatibility.
    namespaceName String
    Namespace name
    notificationHubName String
    Notification Hub name
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    rights List<String | "Manage" | "Send" | "Listen">
    Gets or sets the rights associated with the rule.
    authorizationRuleName String
    Authorization Rule Name
    location String
    Deprecated - only for compatibility.
    primaryKey String
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    secondaryKey String
    Gets a base64-encoded 256-bit primary key for signing and validating the SAS token.
    tags Map<String>
    Deprecated - only for compatibility.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NotificationHubAuthorizationRule resource produces the following output properties:

    AzureApiVersion string
    The Azure API version of the resource.
    ClaimType string
    Gets a string that describes the claim type
    ClaimValue string
    Gets a string that describes the claim value
    CreatedTime string
    Gets the created time for this rule
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyName string
    Gets a string that describes the authorization rule.
    ModifiedTime string
    Gets the last modified time for this rule
    Name string
    The name of the resource
    Revision int
    Gets the revision number for the rule
    SystemData Pulumi.AzureNative.NotificationHubs.Outputs.SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    AzureApiVersion string
    The Azure API version of the resource.
    ClaimType string
    Gets a string that describes the claim type
    ClaimValue string
    Gets a string that describes the claim value
    CreatedTime string
    Gets the created time for this rule
    Id string
    The provider-assigned unique ID for this managed resource.
    KeyName string
    Gets a string that describes the authorization rule.
    ModifiedTime string
    Gets the last modified time for this rule
    Name string
    The name of the resource
    Revision int
    Gets the revision number for the rule
    SystemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    azureApiVersion String
    The Azure API version of the resource.
    claimType String
    Gets a string that describes the claim type
    claimValue String
    Gets a string that describes the claim value
    createdTime String
    Gets the created time for this rule
    id String
    The provider-assigned unique ID for this managed resource.
    keyName String
    Gets a string that describes the authorization rule.
    modifiedTime String
    Gets the last modified time for this rule
    name String
    The name of the resource
    revision Integer
    Gets the revision number for the rule
    systemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    azureApiVersion string
    The Azure API version of the resource.
    claimType string
    Gets a string that describes the claim type
    claimValue string
    Gets a string that describes the claim value
    createdTime string
    Gets the created time for this rule
    id string
    The provider-assigned unique ID for this managed resource.
    keyName string
    Gets a string that describes the authorization rule.
    modifiedTime string
    Gets the last modified time for this rule
    name string
    The name of the resource
    revision number
    Gets the revision number for the rule
    systemData SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    azure_api_version str
    The Azure API version of the resource.
    claim_type str
    Gets a string that describes the claim type
    claim_value str
    Gets a string that describes the claim value
    created_time str
    Gets the created time for this rule
    id str
    The provider-assigned unique ID for this managed resource.
    key_name str
    Gets a string that describes the authorization rule.
    modified_time str
    Gets the last modified time for this rule
    name str
    The name of the resource
    revision int
    Gets the revision number for the rule
    system_data SystemDataResponse
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type str
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    azureApiVersion String
    The Azure API version of the resource.
    claimType String
    Gets a string that describes the claim type
    claimValue String
    Gets a string that describes the claim value
    createdTime String
    Gets the created time for this rule
    id String
    The provider-assigned unique ID for this managed resource.
    keyName String
    Gets a string that describes the authorization rule.
    modifiedTime String
    Gets the last modified time for this rule
    name String
    The name of the resource
    revision Number
    Gets the revision number for the rule
    systemData Property Map
    Azure Resource Manager metadata containing createdBy and modifiedBy information.
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

    Supporting Types

    AccessRights, AccessRightsArgs

    Manage
    Manage
    Send
    Send
    Listen
    Listen
    AccessRightsManage
    Manage
    AccessRightsSend
    Send
    AccessRightsListen
    Listen
    Manage
    Manage
    Send
    Send
    Listen
    Listen
    Manage
    Manage
    Send
    Send
    Listen
    Listen
    MANAGE
    Manage
    SEND
    Send
    LISTEN
    Listen
    "Manage"
    Manage
    "Send"
    Send
    "Listen"
    Listen

    SystemDataResponse, SystemDataResponseArgs

    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    CreatedAt string
    The timestamp of resource creation (UTC).
    CreatedBy string
    The identity that created the resource.
    CreatedByType string
    The type of identity that created the resource.
    LastModifiedAt string
    The timestamp of resource last modification (UTC)
    LastModifiedBy string
    The identity that last modified the resource.
    LastModifiedByType string
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.
    createdAt string
    The timestamp of resource creation (UTC).
    createdBy string
    The identity that created the resource.
    createdByType string
    The type of identity that created the resource.
    lastModifiedAt string
    The timestamp of resource last modification (UTC)
    lastModifiedBy string
    The identity that last modified the resource.
    lastModifiedByType string
    The type of identity that last modified the resource.
    created_at str
    The timestamp of resource creation (UTC).
    created_by str
    The identity that created the resource.
    created_by_type str
    The type of identity that created the resource.
    last_modified_at str
    The timestamp of resource last modification (UTC)
    last_modified_by str
    The identity that last modified the resource.
    last_modified_by_type str
    The type of identity that last modified the resource.
    createdAt String
    The timestamp of resource creation (UTC).
    createdBy String
    The identity that created the resource.
    createdByType String
    The type of identity that created the resource.
    lastModifiedAt String
    The timestamp of resource last modification (UTC)
    lastModifiedBy String
    The identity that last modified the resource.
    lastModifiedByType String
    The type of identity that last modified the resource.

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:notificationhubs:NotificationHubAuthorizationRule MyManageSharedAccessKey /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName} 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
    Azure Native v3.3.0 published on Monday, Apr 28, 2025 by Pulumi