- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Azure Bicep 的新手(它本身很新),但对 ARM 模板有一些经验。
我正在尝试了解如何创建 Azure 博客存储容器的 Azure 事件网格订阅。
这不是生产代码,我一直在关注这个 tutorial现在我正在尝试使用未涵盖的 EventGrid。
当我去部署用二头肌创建的模板时,出现错误:
{
"error": {
"code": "InvalidRequest",
"message": "Invalid event subscription request: Supplied URL is invalid. It cannot be null or empty and should be a proper HTTPS URL like https://www.example.com."
}
}
我的事件网格订阅如下所示:
resource sub1 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2020-04-01-preview' = {
name: '${eventgrid.name}${subscriptionName}'
properties: {
destination: {
properties: {
maxEventsPerBatch: 1
preferredBatchSizeInKilobytes: 64
}
endpointType: 'WebHook'
}
filter: {
subjectBeginsWith: '/blobServices/default/containers/mycontainer'
includedEventTypes: [
'Microsoft.Storage.BlobCreated'
]
}
labels: []
eventDeliverySchema: 'EventGridSchema'
retryPolicy: {
maxDeliveryAttempts: 30
eventTimeToLiveInMinutes: 1440
}
topicType: 'Microsoft.Storage.StorageAccounts'
}
}
当我向事件订阅添加端点Url 属性时,出现不同的错误:
{
"status": "Failed",
"error": {
"code": "ResourceDeploymentFailure",
"message": "The resource operation completed with terminal provisioning state 'Failed'.",
"details": [
{
"code": "Url validation",
"message": "Webhook validation handshake failed for https://foobarblee.blob.core.windows.net/results-nlp. Http POST request failed with response code Unknown. For troublehooting, visit https://aka.ms/esvalidation. Activity id:, timestamp: 9/22/2020 11:21:07 PM (UTC)."
}
]
}
}
代码部分更改为如下所示:
resource sub1 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2020-04-01-preview' = {
name: '${eventgrid.name}${subscriptionName}'
properties: {
destination: {
properties: {
maxEventsPerBatch: 1
preferredBatchSizeInKilobytes: 64
endpointUrl: 'https://${storageAccount.name}.blob.core.windows.net/mycontainer'
}
endpointType: 'WebHook'
不幸的是,我找不到有关此特定问题的任何文档。
我的整个二头肌文件如下所示:
param location string = resourceGroup().location
param evgNamePrefix string = 'evg'
param subNamePrefix string = 'sub'
param stgNamePrefix string = 'stg'
param subOneName string = '/foo-local-debug'
param containerOneName string = '/mycontainer'
// param storageAccountName string = 'blee'
param globalRedundancy bool = true // defaults to true, but can be overridden
var storageAccountName = '${stgNamePrefix}${uniqueString(resourceGroup().id)}'
var eventGridName = '${evgNamePrefix}${uniqueString(resourceGroup().id)}'
var eventGridSubscriptionName = '${evgNamePrefix}${subNamePrefix}${uniqueString(resourceGroup().id)}${subOneName}'
resource evg 'Microsoft.EventGrid/systemTopics@2020-04-01-preview' = {
name: eventGridName
location: location
properties: {
source: stg.id
topicType: 'Microsoft.Storage.StorageAccounts'
}
}
resource sub1 'Microsoft.EventGrid/systemTopics/eventSubscriptions@2020-04-01-preview' = {
name: '${evg.name}${subOneName}'
properties: {
destination: {
properties: {
maxEventsPerBatch: 1
preferredBatchSizeInKilobytes: 64
endpointUrl: 'https://${stg.name}.blob.core.windows.net/mycontainer'
}
endpointType: 'WebHook'
}
filter: {
subjectBeginsWith: '/blobServices/default/containers/mycontainer'
includedEventTypes: [
'Microsoft.Storage.BlobCreated'
]
}
labels: []
eventDeliverySchema: 'EventGridSchema'
retryPolicy: {
maxDeliveryAttempts: 30
eventTimeToLiveInMinutes: 1440
}
topicType: 'Microsoft.Storage.StorageAccounts'
}
}
resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' = {
name: storageAccountName
location: location
kind: 'StorageV2'
sku: {
name: globalRedundancy ? 'Standard_GRS' : 'Standard_LRS' // if true --> GRS, else --> LRS
}
properties: {
azureFilesIdentityBasedAuthentication: {
directoryServiceOptions: 'None'
}
largeFileSharesState: 'Disabled'
networkAcls: {
bypass: 'AzureServices'
virtualNetworkRules: []
ipRules: []
defaultAction: 'Allow'
}
supportsHttpsTrafficOnly: true
encryption: {
services: {
file: {
keyType: 'Account'
enabled: true
}
blob: {
keyType: 'Account'
enabled: true
}
}
keySource: 'Microsoft.Storage'
}
accessTier:'Hot'
}
}
resource bs 'Microsoft.Storage/storageAccounts/blobServices@2019-06-01' = {
name: '${stg.name}/default'
properties: {
cors: {
corsRules: []
}
deleteRetentionPolicy: {
enabled: true
days: 7
}
}
sku: {
name: globalRedundancy ? 'Standard_GRS' : 'Standard_LRS' // if true --> GRS, else --> LRS
tier: 'Standard'
}
}
resource c1 'Microsoft.Storage/storageAccounts/blobServices/containers@2019-06-01' = {
name: '${stg.name}/default${containerOneName}'
properties: {
defaultEncryptionScope:'$account-encryption-key'
denyEncryptionScopeOverride: false
publicAccess: 'None'
}
}
output storageId string = stg.id
output computedStorageName string = stg.name
output eventGridId string = evg.id
output eventGridsName string = evg.name
最佳答案
我根据BICEP文档生成了ARM JSON。我将 Url 更改为 public webhook 并且它正在工作:
“endpointUrl”:“https://eval-mm.azurewebsites.net/api/Function1”
EventGrid 订阅 WebHook 必须是公共(public)的,并且不支持 URL 参数或 header 。这对我来说很烦人。
享受 BICEP,这是很棒的东西:-)
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"evgNamePrefix": {
"type": "string",
"defaultValue": "evg"
},
"subNamePrefix": {
"type": "string",
"defaultValue": "sub"
},
"stgNamePrefix": {
"type": "string",
"defaultValue": "stg"
},
"subOneName": {
"type": "string",
"defaultValue": "/foo-local-debug"
},
"containerOneName": {
"type": "string",
"defaultValue": "/mycontainer"
},
"globalRedundancy": {
"type": "bool",
"defaultValue": true
}
},
"functions": [],
"variables": {
"storageAccountName": "[format('{0}{1}', parameters('stgNamePrefix'), uniqueString(resourceGroup().id))]",
"eventGridName": "[format('{0}{1}', parameters('evgNamePrefix'), uniqueString(resourceGroup().id))]",
"eventGridSubscriptionName": "[format('{0}{1}{2}{3}', parameters('evgNamePrefix'), parameters('subNamePrefix'), uniqueString(resourceGroup().id), parameters('subOneName'))]"
},
"resources": [
{
"type": "Microsoft.EventGrid/systemTopics",
"apiVersion": "2020-04-01-preview",
"name": "[variables('eventGridName')]",
"location": "[parameters('location')]",
"properties": {
"source": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
"topicType": "Microsoft.Storage.StorageAccounts"
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
]
},
{
"type": "Microsoft.EventGrid/systemTopics/eventSubscriptions",
"apiVersion": "2020-04-01-preview",
"name": "[format('{0}{1}', variables('eventGridName'), parameters('subOneName'))]",
"properties": {
"destination": {
"properties": {
"maxEventsPerBatch": 1,
"preferredBatchSizeInKilobytes": 64,
"endpointUrl": "https://eval-mm.azurewebsites.net/api/Function1"
},
"endpointType": "WebHook"
},
"filter": {
"subjectBeginsWith": "/blobServices/default/containers/mycontainer",
"includedEventTypes": [
"Microsoft.Storage.BlobCreated"
]
},
"labels": [],
"eventDeliverySchema": "EventGridSchema",
"retryPolicy": {
"maxDeliveryAttempts": 30,
"eventTimeToLiveInMinutes": 1440
},
"topicType": "Microsoft.Storage.StorageAccounts"
},
"dependsOn": [
"[resourceId('Microsoft.EventGrid/systemTopics', variables('eventGridName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
]
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[variables('storageAccountName')]",
"location": "[parameters('location')]",
"kind": "StorageV2",
"sku": {
"name": "[if(parameters('globalRedundancy'), 'Standard_GRS', 'Standard_LRS')]"
},
"properties": {
"azureFilesIdentityBasedAuthentication": {
"directoryServiceOptions": "None"
},
"largeFileSharesState": "Disabled",
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": true,
"encryption": {
"services": {
"file": {
"keyType": "Account",
"enabled": true
},
"blob": {
"keyType": "Account",
"enabled": true
}
},
"keySource": "Microsoft.Storage"
},
"accessTier": "Hot"
}
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices",
"apiVersion": "2019-06-01",
"name": "[format('{0}/default', variables('storageAccountName'))]",
"properties": {
"cors": {
"corsRules": []
},
"deleteRetentionPolicy": {
"enabled": true,
"days": 7
}
},
"sku": {
"name": "[if(parameters('globalRedundancy'), 'Standard_GRS', 'Standard_LRS')]",
"tier": "Standard"
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
]
},
{
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
"apiVersion": "2019-06-01",
"name": "[format('{0}/default{1}', variables('storageAccountName'), parameters('containerOneName'))]",
"properties": {
"defaultEncryptionScope": "$account-encryption-key",
"denyEncryptionScopeOverride": false,
"publicAccess": "None"
},
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
]
}
],
"outputs": {
"storageId": {
"type": "string",
"value": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
},
"computedStorageName": {
"type": "string",
"value": "[variables('storageAccountName')]"
},
"eventGridId": {
"type": "string",
"value": "[resourceId('Microsoft.EventGrid/systemTopics', variables('eventGridName'))]"
},
"eventGridsName": {
"type": "string",
"value": "[variables('eventGridName')]"
}
}
}
关于azure - 使用 Azure Bicep 进行 Azure EventGrid 订阅的 Webhook Url 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64030748/
我想知道是否有任何方法可以为所有意图激活 webhook(除了一个一个激活它)。谢谢! 最佳答案 目前还没有这样的功能,但我遇到了类似的问题,这就是我解决它的方法: 下载所有意图的zip文件 写一个程
谁能在最基本的层面上解释一下 Incoming webhook、Outgoing webhook 和 O365 webhook 之间的区别 最佳答案 Webhooks 是一种轻型 HTTP 模式,用于
好吧,这可能 super 简单,但我只是没有足够的背景知识来确定: 如果我定义了一个 webhook 回调(例如,OpenAPI 中的回调):我可以从常规网页使用该回调吗? 我会假设是的,否则有什么意
我正在尝试设置 Grafana 以将 webhook 发送到 Microsoft Teams。我可以通过终端 curl 到地址,但不能通过 Grafanas 界面。 我将 URL 添加到 Grafan
我正在玩Paypal REST(php)环境,我喜欢玩沙盒webhooks。 是否可以将Paypal沙箱Webhooks与本地设置一起使用? http://localhost/test 是无效的网址
使用 slack webhooks,我可以使用消息中的简码发送表情符号: curl -X POST --data-urlencode "payload={\"channel\": \"#my_noti
我们想将Slack Webhook(传出Webhook)与内部Web服务一起使用。 我们公司位于防火墙后面,因此必须将外部连接列入白名单。 Slack似乎有多个地址,它将从中发送API请求,并且似乎没
我们目前正在实现 Mailgun 的 Webhook,以将电子邮件回复转换为应用程序中评论线程中的回复。我们设置一条路由来匹配收件人,并将操作设置为 store(notify="https://exa
我可以通过应用程序脚本通过 webhook 将消息发送到聊天室,但是我如何发送回复该消息。这是一种单向聊天。我如何才能通过 webhook 将其作为对话流. 最佳答案 您可以提供一个threadKey
我正在尝试注册一个 evernote webhook。但似乎注册表不起作用。 Evernote webhook 注册表格: 我填写了表格,点击“提交”,但总是得到以下错误响应: {"error":"R
我可以通过应用程序脚本通过 webhook 将消息发送到聊天室,但是我如何发送回复该消息。这是一种单向聊天。我如何才能通过 webhook 将其作为对话流. 最佳答案 您可以提供一个threadKey
我有一个订阅页面提要事件的 webhook。 我希望它告诉我何时在页面或用户管理的页面上创建了公共(public)事件。 应用仪表板告诉我这是将发送给我的 JSON 对象: { "field": "
当我在 google 项目和 API.AI 代理上创建操作时,我使用自己的服务作为 API.AI 实现 webhook。我希望 API.AI 会调用我的 webhook。但是当我通过谷歌上的 Acti
我正在按照本教程在 App Inventor 中发送电子邮件:https://www.hackster.io/taifun/trigger-ifttt-to-send-an-email-using-a
我正在尝试将消息发布到松弛团队中的任何 channel 。 我的 webhook 已正确创建并安装到我的测试团队中。作为安装过程的一部分,我选择了“发布到#channel1” 当我查看权限时,我看到我
我快速浏览了与 Bluesnap webhooks 相关的 IPN 类型和参数 - https://support.bluesnap.com/v2.2.7/docs/ipn-parameter-ref
我有一个 HTML 表格,我正在尝试通过 webhook 将其发布到 Slack。 有没有办法将 HTML 表格发布到 Slack? 这是 HTML 代码: HTML Tabl
我在我的 Slack 工作区中创建了一个传入 Webhook。我正在使用第三方工具将 JSON 对象发布到 Hook url。我想向@user_1 发送通知 我的问题是通知发送到我和该用户@user_
我正在开发一个与 Trello 紧密集成的应用程序,并使用 Trello webhooks 做很多事情。但是,我在 Trello 的开发人员文档中找不到任何地方可能触发 webhook 的“操作”是什
当我创建这篇文章时,我只是在stackoverflow上找到了没有任何回复的帖子...... TelegramBot. "Webhook can be set up only on ports 80,
我是一名优秀的程序员,十分优秀!