2017-11-23 1 views
0

紺碧の通知ハブを調査しており、メッセージの送受信に成功している間にハブを計画的に設定する必要もあります。APNS証明書を計画的にまたはCLIを介して紺碧の通知ハブにアップロードすることは可能ですか

通知ハブを作成できる唯一の方法は、this oneのようなazuredeploy.json ARMテンプレートを使用したazure cliを使用することです。しかし、私はそれにAPNS証明書を追加するための情報を見つけることができません。

私たちのハブから生成されたオートメーションスクリプトを見ると、google firebase APIキーまたはAPNS証明書の証拠はありません。これは可能なのですか、またはこれらはazure portalを通していつでも実行する必要がありますか?

UPDATED:アームテンプレートを少し問題なく使用して通知ハブ空間を作成することができましたが、作成しようとすると「悪い要求」(相関ID - 3faee649-7084-436d-8d7e-4a9c6f79cc4e)通知ハブ自身がapns証明書を持っています。

this postは同様の問題を抱えていますが、apnsのキーは私のものよりもはるかに短いです。私は文字通り、5000文字以上の間違った証明書ファイルからbase64文字列を作成しましたが、それは間違っていると思いますが、Appleの値がここに入ることを意味するものではありません。マイテンプレートはこのようになります

:apnsCredentialsプロパティで

{ 
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", 
    "contentVersion": "1.0.0.0", 
    "parameters": { 
    "Gcm.GoogleApiKey": { 
     "type": "string", 
     "metadata": { 
     "description": "Google Cloud Messaging API Key" 
     }, 
     "defaultValue": "" 
    }, 
    "Apns.apnsCertificate": { 
     "type": "string", 
     "metadata": { 
      "description": "A certificate (in base 64 format) provided by Apple on the iOS Provisioning Portal" 
     } 
     }, 
     "Apns.certificateKey": { 
     "type": "string", 
     "metadata": { 
      "description": "The Certificate Key provided by the iOS Provisioning Portal when registering the application" 
     }, 
     "defaultValue": "" 
     }, 
     "Apns.endpoint": { 
     "type": "string", 
     "metadata": { 
      "description": "The APNS endpoint to which our service connects. This is one of two values: gateway.sandbox.push.apple.com for the sandbox endpoint or gateway.push.apple.com, for the production endpoint. Any other value is invalid" 
     }, 
     "defaultValue": "gateway.sandbox.push.apple.com" 
     } 
    }, 
    "variables": { 
    "hubVersion": "[providers('Microsoft.NotificationHubs', 'namespaces').apiVersions[0]]", 
    "notificationHubNamespace": "[concat('hubv2', uniqueString(resourceGroup().id))]", 
    "notificationHubName": "notificationhub" 
    }, 
    "resources": [ 
    { 
     "name": "[variables('NotificationHubNamespace')]", 
     "location": "[resourceGroup().location]", 
     "type": "Microsoft.NotificationHubs/namespaces", 
     "apiVersion": "2017-04-01", 
     "comments": "Notification hub namespace", 
     "properties": { 
     "namespaceType": "NotificationHub" 
     }, 
     "resources": [ 
     { 
      "name": "[concat(variables('NotificationHubNamespace'),'/',variables('NotificationHubName'))]", 
      "location": "[resourceGroup().location]", 
      "type": "Microsoft.NotificationHubs/namespaces/notificationHubs", 
      "apiVersion": "2017-04-01", 
      "properties": { 
      "GcmCredential": { 
       "properties": { 
       "googleApiKey": "[parameters('Gcm.GoogleApiKey')]", 
       "gcmEndpoint": "https://android.googleapis.com/gcm/send" 
       } 
      }, 
      "apnsCredential": { 
       "properties": { 
        "apnsCertificate" : "[parameters('Apns.apnsCertificate')]", 
        "certificateKey" : "[parameters('Apns.certificateKey')]", 
        "endpoint" : "[parameters('Apns.endpoint')]" 
       } 
      } 
      }, 
      "dependsOn": [ 
      "[concat('Microsoft.NotificationHubs/namespaces/', variables('NotificationHubNamespace'))]" 
      ] 
     } 
     ] 
    } 
    ], 
    "outputs": { 
    } 
} 
+0

私はプロパティと資格情報を削除した場合、私は成功した名前空間とハブを作成することができます。しかし、私はそれらをプログラム的に何とか追加する必要があります。実際の後、またはこのテンプレートの一部として。 –

答えて

1

、apsnCertificateはファイルからbase64文字列であるとcertificatekeyは、強力なパスワードにする必要がある証明書のパスワードです。あなたは同じことに従っていますか?

また、表示される内部エラーメッセージもあります。はいの場合、それは何ですか?

おかげで、 て、Amol

+0

p12ファイルまたはpemファイルで、base64にする必要がありますか?文字通りファイル全体がbyte []に​​変換されてから、base64文字列にシリアル化されますか?空白のパスワードを使用することはできませんか?私は私たちの証明書に置くとは思わない。私はパスワードで新しいものを試してみることができます。また、私が内部の例外として見ることができるものはありませんでした。相関IDを使用して詳細情報を表示できるかどうかはわかりません - 3faee649-7084-436d-8d7e-4a9c6f79cc4e –

+0

パスワードを指定して.pemファイルを使用してもう一度試しました。 (パスワードを追加する唯一の方法は、.pemファイルをエクスポートすることです)。私はbase64にファイルをシリアル化して5796文字にしてから、これに強力なパスワードを追加しました(自動生成 - devilries799538'epistemologists)、まだ内部例外なしの悪い要求があります。 –

関連する問題