microsoftarchive / iot-journey

a guidance project for implementing an IoT solution on Azure
Other
89 stars 34 forks source link

Replace provisioning scripts for Long-term storage with Stream Analytics with ARM templates #317

Closed hveiras closed 9 years ago

hveiras commented 9 years ago

connects to #312 connects to #310

bennage commented 9 years ago

After merging into master, I am seeing this error:

Adding the [Microsoft.ServiceBus.dll] assembly to the script...
The [Microsoft.ServiceBus.dll] assembly has been successfully added to the script.
Method invocation failed because [Microsoft.ServiceBus.NamespaceManager] does not contain a method named 'GetEventHub'.
At C:\dev\iot-journey\setup\Setup.Arm\Scripts\LongTermStorage\StreamAnalytics\Deploy.ps1:57 char:2
+     $EventHubDescription = $NamespaceManager.GetEventHub($EventHubNam ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

You cannot call a method on a null-valued expression.
At C:\dev\iot-journey\setup\Setup.Arm\Scripts\LongTermStorage\StreamAnalytics\Deploy.ps1:65 char:2
+     $EventHubDescription.Authorization.Add($AccessRule)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Method invocation failed because [Microsoft.ServiceBus.NamespaceManager] does not contain a method named 'UpdateEventHub'.
At C:\dev\iot-journey\setup\Setup.Arm\Scripts\LongTermStorage\StreamAnalytics\Deploy.ps1:67 char:2
+     $NamespaceManager.UpdateEventHub($EventHubDescription)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

Is this related to #310? or perhaps because of the upgraded NuGet package?

hveiras commented 9 years ago

It is related to #310

bennage commented 9 years ago

When I run it, it is not adding the authorization rule as expected.

bennage commented 9 years ago

It seems like the root problem is L62

$EventHubDescription = $NamespaceManager.GetEventHub($EventHubName)

Or is that NamespaceManager isn't really the instance that we think it is? :worried:

bennage commented 9 years ago

I prefer not to merge this until we resolve #310. What are your thoughts?

hveiras commented 9 years ago

@bennage yes, I agree let's figure it out what is happening first.

hveiras commented 9 years ago

@bennage #310 is fixed

bennage commented 9 years ago

I'm getting a new error:

Exception calling "GetEventHub" with "1" argument(s): "The remote server returned an error: (401) Unauthorized. Manage claim is required for this operation.
TrackingId:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_xx,TimeStamp:9/10/2015 5:24:49 PM"
At C:\dev\iot-journey\setup\Setup.Arm\Scripts\LongTermStorage\AzureStreamAnalytics\Deploy.ps1:60 char:5
+     $EventHubDescription = $NamespaceManager.GetEventHub($EventHubNam ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : UnauthorizedAccessException

You cannot call a method on a null-valued expression.
At C:\dev\iot-journey\setup\Setup.Arm\Scripts\LongTermStorage\AzureStreamAnalytics\Deploy.ps1:68 char:5
+     $EventHubDescription.Authorization.Add($AccessRule)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Exception calling "UpdateEventHub" with "1" argument(s): "Value cannot be null.
Parameter name: description"
At C:\dev\iot-journey\setup\Setup.Arm\Scripts\LongTermStorage\AzureStreamAnalytics\Deploy.ps1:70 char:5
+     $NamespaceManager.UpdateEventHub($EventHubDescription)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentNullException

New-AzureResourceGroupDeployment : 10:25:10 AM - Resource Microsoft.Storage/storageAccounts 'IoT987' failed with message 'IoT987 is not a valid storage account name.
Storage account name must be between 3 and 24 characters in length and use numbers and lower-case letters only.'
At C:\dev\iot-journey\setup\Setup.Arm\Scripts\LongTermStorage\AzureStreamAnalytics\Deploy.ps1:75 char:9
+         New-AzureResourceGroupDeployment -ResourceGroupName $Resource ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzureResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.NewAzureResourceGroupDeploymentCommand

I see two different problems here, one with the authorization rule and the other with the storage account. For the storage account, can we just lowercase the app name?

bennage commented 9 years ago

Okay. So, no error if I run the command as admin.

bennage commented 9 years ago

Looks good!