我不明白为什么不......
首先,你要记住,触发该通知的代码是实际使用的通知中心的名称和通知集线器连接字符串中的一个。
让我们来看看为Notification Hub Tutorial on App Services提出的代码。这是从应用服务的插件发送通知的代码:
// Get the Notification Hubs credentials for the Mobile App.
string notificationHubName = settings.NotificationHubName;
string notificationHubConnection = settings.Connections[MobileAppSettingsKeys.NotificationHubConnectionString].ConnectionString;
// Create a new Notification Hub client.
NotificationHubClient hub = NotificationHubClient
.CreateClientFromConnectionString(notificationHubConnection, notificationHubName);
现在,请让我们来看看这个段从这个post如何使用环境变量从部署插槽采取:
<td>ConnectionString: </td>
<td><%= Environment.GetEnvironmentVariable("SQLAZURECONNSTR_ConnectionString") %></td>
最后的建议here,那么你可以使用任何CUSTOMCONNSTR_或APPSETTING_以获得通知中心名称和通知集线器连接的是DEP结束于您的部署插槽。