Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the Azure IotHub fallback route #2719

Closed
IvanovOleg opened this issue Jan 19, 2019 · 4 comments
Closed

Add support for the Azure IotHub fallback route #2719

IvanovOleg opened this issue Jan 19, 2019 · 4 comments

Comments

@IvanovOleg
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

When you create an IoT Hub with a custom route via terraform, the IoTHub fallback route is disabled by default which is not suitable. If you enable this parameter in portal and run terraform again, it disables it.

New or Affected Resource(s)

  • azurerm_iothub

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

  • #0000
@danielscholl
Copy link

The default action of creating a hub via cli or portal is to have the IoT fallback route enabled. The default action of the terraform creating a hub is to have the IoT fallback route disabled with no option to enable it.

Terraform Configuration

provider "azurerm" {
  version = "=1.21.0"
}

resource "azurerm_resource_group" "test" {
  name     = "IoTEdgeResources"
  location = "eastus2"
}

resource "azurerm_iothub" "test" {
  name                = "tf-hub"
  resource_group_name = "${azurerm_resource_group.test.name}"
  location            = "${azurerm_resource_group.test.location}"

  sku {
    name     = "S1"
    tier     = "Standard"
    capacity = "1"
  }
}

Azure CLI Commands

# Create a Hub
az iot hub create --resource-group IoTEdgeResources --name test-cli-hub --sku S1 --location eastus2

# View fallbackRoute status
az iot hub list -g IoTEdgeResources --query \
  "[].{name:name, fallback:properties.routing.fallbackRoute.isEnabled}" \
  -otable

Creation Result

Name             Fallback
-----------      ----------
test-cli-hub     True
test-tf-hub      False

@BlueBasher
Copy link
Contributor

Terraform is indeed disabling the fallback route by default.
The difference is in the RoutingProperties, there should be a fallbackRoute and depending on a setting it should set isEnabled to true or false.

Terraform created

"routing": {
	"endpoints": {
		"serviceBusQueues": [],
		"serviceBusTopics": [],
		"eventHubs": [],
		"storageContainers": []
	},
	"routes": [],
	"fallbackRoute": {
		"name": "$fallback",
		"source": "DeviceMessages",
		"condition": "true",
		"endpointNames": [
			"events"
		],
		"isEnabled": false
	}
},

Azure Portal created

"routing": {
	"endpoints": {
		"serviceBusQueues": [],
		"serviceBusTopics": [],
		"eventHubs": [],
		"storageContainers": []
	},
	"routes": [],
	"fallbackRoute": {
		"name": "$fallback",
		"source": "DeviceMessages",
		"condition": "true",
		"endpointNames": [
			"events"
		],
		"isEnabled": true
	}
},

katbyte pushed a commit that referenced this issue Feb 22, 2019
Added the option to specify if the IoTHub fallback route should be enabled or not.
It defaults to enabled since the Azure Portal, CLI or ARM all default to true. This is a change in the behaviour of Terraform since Terraform used to default to disabled.
See also issue #2719
@StefanSchoof
Copy link
Contributor

I think this issue can be closed, since #2764 is merged and is released with 1.23.0

@tombuildsstuff tombuildsstuff added this to the v1.23.0 milestone Mar 20, 2019
@ghost
Copy link

ghost commented Apr 19, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants