共用方式為


New-AzEventGridClient

使用指定的參數建立用戶端。

語法

New-AzEventGridClient
   -Name <String>
   -NamespaceName <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   [-Attribute <Hashtable>]
   [-AuthenticationName <String>]
   [-CertificateSubjectCommonName <String>]
   [-CertificateSubjectCountryCode <String>]
   [-CertificateSubjectOrganization <String>]
   [-CertificateSubjectOrganizationUnit <String>]
   [-CertificateThumbprintPrimary <String>]
   [-CertificateThumbprintSecondary <String>]
   [-ClientCertificateAuthenticationAllowedThumbprint <String[]>]
   [-ClientCertificateAuthenticationValidationScheme <String>]
   [-Description <String>]
   [-State <String>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzEventGridClient
   -Name <String>
   -NamespaceName <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -JsonString <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzEventGridClient
   -Name <String>
   -NamespaceName <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -JsonFilePath <String>
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzEventGridClient
   -Name <String>
   -NamespaceInputObject <IEventGridIdentity>
   [-Attribute <Hashtable>]
   [-AuthenticationName <String>]
   [-CertificateSubjectCommonName <String>]
   [-CertificateSubjectCountryCode <String>]
   [-CertificateSubjectOrganization <String>]
   [-CertificateSubjectOrganizationUnit <String>]
   [-CertificateThumbprintPrimary <String>]
   [-CertificateThumbprintSecondary <String>]
   [-ClientCertificateAuthenticationAllowedThumbprint <String[]>]
   [-ClientCertificateAuthenticationValidationScheme <String>]
   [-Description <String>]
   [-State <String>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzEventGridClient
   -InputObject <IEventGridIdentity>
   [-Attribute <Hashtable>]
   [-AuthenticationName <String>]
   [-CertificateSubjectCommonName <String>]
   [-CertificateSubjectCountryCode <String>]
   [-CertificateSubjectOrganization <String>]
   [-CertificateSubjectOrganizationUnit <String>]
   [-CertificateThumbprintPrimary <String>]
   [-CertificateThumbprintSecondary <String>]
   [-ClientCertificateAuthenticationAllowedThumbprint <String[]>]
   [-ClientCertificateAuthenticationValidationScheme <String>]
   [-Description <String>]
   [-State <String>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

使用指定的參數建立用戶端。

範例

範例 1:使用指定的參數建立用戶端。

$attribute = @{"room"="345";"floor"="3";"deviceTypes"="Fan"}
New-AzEventGridClient -Name azps-client -NamespaceName azps-eventgridnamespace -ResourceGroupName azps_test_group_eventgrid -Attribute $attribute -State Enabled -ClientCertificateAuthenticationValidationScheme "SubjectMatchesAuthenticationName"

Name        ResourceGroupName
----        -----------------
azps-client azps_test_group_eventgrid

使用指定的參數建立用戶端。

參數

-AsJob

以作業身分執行命令

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Attribute

用戶端的屬性。 支援的值為 int、bool、string、string[]。範例:“attributes”: { “room”: “345”, “floor”: 12, “deviceTypes”: [“Fan”, “Light”] }

類型:Hashtable
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-AuthenticationName

用戶端用來驗證的名稱。 預設值是資源的名稱。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CertificateSubjectCommonName

主體名稱中的一般名稱欄位。 允許的限制為 64 個字元,而且應該指定。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CertificateSubjectCountryCode

主體名稱中的國家/地區代碼欄位。 如果有的話,國家/地區代碼應該以 ISO 2166-1 (alpha-2) 中定義的兩個字母代碼來表示。 例如:『US』。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CertificateSubjectOrganization

主體名稱中的組織欄位。 如果存在,允許的限制為64個字元。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CertificateSubjectOrganizationUnit

主體名稱中的組織單位欄位。 如果存在,允許的限制為32個字元。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CertificateThumbprintPrimary

用於驗證的主要指紋。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CertificateThumbprintSecondary

用於驗證的次要指紋。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ClientCertificateAuthenticationAllowedThumbprint

用戶端驗證期間允許的指紋清單。 只有在 validationScheme 為 'ThumbprintMatch' 時,才需要這個屬性。

類型:String[]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ClientCertificateAuthenticationValidationScheme

用來驗證客戶端的驗證配置。 默認值為 SubjectMatchesAuthenticationName。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

DefaultProfile 參數無法運作。 如果針對不同的訂用帳戶執行 Cmdlet,請使用 SubscriptionId 參數。

類型:PSObject
別名:AzureRMContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Description

用戶端資源的描述。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-InputObject

Identity 參數

類型:IEventGridIdentity
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-JsonFilePath

提供給建立作業的 Json 檔案路徑

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-JsonString

提供給建立作業的 Json 字串

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Name

用戶端名稱。

類型:String
別名:ClientName
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-NamespaceInputObject

Identity 參數

類型:IEventGridIdentity
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-NamespaceName

命名空間的名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-NoWait

以異步方式執行命令

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

用戶訂用帳戶內的資源組名。

類型:String
別名:ResourceGroup
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-State

指出用戶端是否已啟用。 預設值為 Enabled。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SubscriptionId

可唯一識別Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。

類型:String
Position:Named
預設值:(Get-AzContext).Subscription.Id
必要:False
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

IEventGridIdentity

輸出

IClient