Comments (6)
Investigating !
from azure-iot-sdk-csharp.
Hi @bartoszbr
Can you please confirm that you were successful using a device ID that doesn't contain any special character? I am asking because this shouldn't be a problem.
Another thing: are you using the received URI immediately? By default the TTL for the storage URI SAS is 1hour.
Can you share the piece of code you are using?
from azure-iot-sdk-csharp.
Yes I can send files to another devices where DeviceId doesn't have any special character. I checked it also on another Azure account with another subscription and there was the same.
In every cases I use standard, default Azure Storage - I just connected it with my IoT Hub.
Initialization of DeviceClient object:
deviceClient = DeviceClient.Create(iotHubUri, new DeviceAuthenticationWithRegistrySymmetricKey(deviceName, deviceKey));
Method to handle Click event and call UploadToBlobAsync:
private async void sendFileButton_Click(object sender, EventArgs e)
{
if (ControlsHelper.IsComboBoxSelected(deviceIdComboBox, "Device ID") == false)
return;
var openFileDialog = new OpenFileDialog();
var result = openFileDialog.ShowDialog();
if (result != DialogResult.OK)
return;
using (var fileStream = openFileDialog.OpenFile())
{
var watch = System.Diagnostics.Stopwatch.StartNew();
try
{
await deviceClient.UploadToBlobAsync(openFileDialog.SafeFileName, fileStream);
}
catch (Exception ex)
{
LogError("Exception occurred during sending file", ex);
watch.Stop();
return;
}
watch.Stop();
var text = $"DeviceID: {deviceIdComboBox.SelectedItem} File {openFileDialog.SafeFileName} was sent in {watch.ElapsedMilliseconds}ms";
LogInformation(text, sentMessagesRrichTextBox);
}
}
from azure-iot-sdk-csharp.
Hi @bartoszbr
I was able to locally reproduce the issue using # symbol in device ID . The issue is specific to C# client SDK and doesn't happen with C Azure IoT SDK.
The issue happens when following call is made
https://github.com/Azure/azure-iot-sdk-csharp/blob/master/device/Microsoft.Azure.Devices.Client/Transport/HttpTransportHandler.cs#L230
When CloudBlockBlob object is created it omits special character # in StorageURI along with string after it. That is why UploadFromStreamAsync call fails.
Further investigation is going on to resolve this.
from azure-iot-sdk-csharp.
Hi @bartoszbr
Fix for this issue has been merged 2366f03 into master
from azure-iot-sdk-csharp.
This is now in the latest release. Closing.
from azure-iot-sdk-csharp.
Related Issues (20)
- [Bug Report] NullReferenceException was thrown from RegistryManager.GetTwinAsync HOT 7
- [Bug Report] Send message to multiple outputs using ModuleClient throws HOT 3
- [Technical Question] [v2-preview] How to send Payload as byte array to IoTHub and receive Payload as byte array
- [Bug Report] [v2-preview] How to send Payload as byte array to IoTHub and receive Payload as byte array HOT 12
- [Technical Question] [AzureSDK .NET v2] How to use ProvisioningTransportHandlerHttp in ProvisioningDeviceClient HOT 2
- [Technical Question] Best practice for IotHubDeviceClient Open-Close HOT 1
- [Technical Question] Why is `Newtonsoft.Json` still required in preview SDKs? HOT 10
- [Technical Question] Possible DNS issue - File Upload limiting connetion lifetime HOT 14
- [Technical Question] How to implement a manual Start/Stop mechanism on the IOT Device Client Re-Connection Sample HOT 8
- Unobserved task exception when using MQTT websocket when connection cannot be established HOT 4
- [Technical Question] [SDK v2] Lack of timeout options for IoT Hub device client HOT 6
- Device not able to connect module twin HOT 11
- [Bug Report] [SDK v2] Wrong currentRetryCount value for different RetryPolicy-s HOT 5
- [Bug Report] [v2] Opened connection on a device consumes my message HOT 12
- [Technical Question] HOT 14
- [Technical Question] Develop and Deploy C# Azure Function, custom IoT Edge Module in .NET SDK 6 HOT 10
- [Technical Question]Read and Write access to IoT edge Modules built with Podman on IoT Edge Server HOT 1
- In some circumstances DeviceClient.SendEventAsync can go wild, consume all available memory HOT 4
- [Bug Report] ModuleClient messages aren't routed when a DeviceClient is open at the same time HOT 2
- [Bug Report] Owner and Contributor roles fail with 'is not authorized for GET on /twins/device_id', "IoT Hub Data Reader" is explicitely required
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-iot-sdk-csharp.