InvalidResourceName error on learn/modules/connect-iot-edge-device-to-iot-central - azure-iot-central

I'm just running through this learning module and seem to be stuck on unit 5/8 (Exercise - Deploy an IoT Edge device and manage it from IoT Central)
https://learn.microsoft.com/en-us/learn/modules/connect-iot-edge-device-to-iot-central/
See screenshot below for the error I'm getting. I've followed the steps up to this point which have been fairly straight forward. Wondering if this is a bug? Can anyone shed any light on this? Thanks!

Most likely, the value of $APP_NAME is empty. That would result in a value of ip- for the dnsLabelPrefix parameter in the script. To verify this, try reading the value echo $APP_NAME.
This variable was set in module 3 Exercise - Create an IoT Central application. It's likely that if you took a break and started a new sandbox, this value is no longer set. Try setting the value explicitly before running the step resulting in the error. Simply set the value to your IoT Central app name.
APP_NAME="store-manager-$RANDOM"
echo "Your application name is: $APP_NAME"

Related

Forge design automation for Revit fail after our code finish

We are experimenting with Design automation for Revit and have gotten stuck on a failure that is hard to debug:
basically our code finish and then forge takes over and fails.
Here is part of the log: I have marked in green what part are "our" logs:
Basically the app takes an rfa and should output a json.
I have defined the activity like this:
What can I do to investigate what is causing this issue?
I found the issue:
you need to explicitly set the Succeeded property to true on the DesignAutomationReadyEventArgs. Otherwise it will report as failed.

Azure: what could be the cause of the error "Unable to edit or replace deployment"?

When I recreate my VM I got the following error:
Problem occurred during request to Azure services. Cloud provider details: Unable to edit or replace deployment 'VM-Name': previous deployment from '8/20/2019 6:20:33 AM' is still active (expiration time is '8/27/2019 5:17:41 AM'). Please see https://aka.ms/arm-deploy for usage details.
Help me please to understand.
What could be the cause of the error ?
UPDATED:
This deployment has not been started previously.
Prior to this, errors were received during creation:
Azure is not available now. Please Try again later
There were several such errors one at a time and then I got that error related to:
Unable to edit or replace deployment
My assumptions about this.
Tell me, am I right or not ?
I launched the image, then after some time I recreated it.
Creation began, but at that moment the connection with Azure was lost.
Then, when the connection was restored, we tried to make a deployment that was not removed in the previous attempt (because there was no connection with Azure).
As a result, we got such an error.
Does this theory make sense?
exactly what it says, there is another deployment with the same name going on at this time, either change the name of the deployment you are trying to queue or wait for the other deployment to finish\fail
This can also occur if you use Bicep templates for your ARM deployement and multiple modules or resources in the template have the same name:
module fooModule '../modules/foo.bicep' = {
name: 'foo'
}
module barModule '../modules/bar.bicep' = {
name: 'foo'
}
I got the same error initially pipeline was working but when retriggered pipeline took more time so i canceled the deployment and made a fresh rerun it encounters. i think i need wait until that deployment filed.

An unhandled exception of type 'System.FormatException' occurred in Microsoft.Azure.Devices.dll

I'm referring this tutorial to create a device identity. However, getting an exception as below:
Here is my config file:
Edit:
What is this Instrumentation key and value in App.Config? I just copied from the sample code. However, from where can I get it, in case I'm using a real device?
Am I missing any SDK or anything else?
Do I need to download something extra? the tutorial does not suggest anything.
Even when I'm running sample code from GiTHub getting the same error.
the following screen snippet shows a reason of this error, such as connectionString.
Use the connectionString from your Azure IoT Hub - see the tutorial section Create an IoT Hub step 6.
Can you check that the connection string you're using is in the correct format. It should look like:
"HostName={your hub name}.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey={your key}"
You can copy the complete connection string from the portal as described in the tutorial.
Issue resolve: I was missing my connection string.Which I got from "IoTHubOwner" from Azure portal login. :)

TeamCity Build Agent name is not picked up from config file

I have recently setup a VM on azure to use as my build agent.
When the agent is started its name is calculated based on the azure instance name (_myservername) and the name I provide in the buildAgent.properties file is ignored completely.
This is particularly problematic when I have a second agent and the same name is chosen which will result in name conflict.
looking at the teamcity-agent.log I can see the following lines:
[2016-07-14 15:33:04,745] WARN - ds.azure.AzurePropertiesReader - Unable to set self port. Azure integration will experience problems
[2016-07-14 15:33:04,745] INFO - ds.azure.AzurePropertiesReader - Added alternative address is set to
[2016-07-14 15:33:04,745] INFO - ds.azure.AzurePropertiesReader - Instance name and agent name are set to _myservername
...
Question is:
Why is the name I provide via config file is not taking precedence over any other place it reads the name from? -- should it?
How can I possibly force a name on it?
OK, the came to find the answer to this and would share it here in case it would be useful for the humans of the future!
The issue was caused by the the azure-plugin where it was setting a configuration-parameter on the agent called instance name.
https://github.com/JetBrains/teamcity-azure-plugin/issues/17
The issue is fixed in the latest version of the plugin so upgrading it solved my problem. :)

How can I troubleshoot Azure ARM template validation errors?

I have made some small changes to an Azure ARM template file and now when I try to deploy or validate via the xplat cli I get this message.
error: InvalidTemplateDeployment : The template deployment
'fakedDeploymentName' is not valid according to the validation
procedure. The tracking id is '\some kind of GUID here\'.
See inner errors for details. Please see http://aka.ms/arm-deploy for
usage details.
error: PreflightValidationCheckFailed : Preflight
validation failed. Please refer to the details for the specific
errors.
I would love to troubleshoot this problem, but I don't see any "inner errors" on the console. It even gives me a unique GUID each time, implying that I could use this GUID to look up a more informative message. Where can I view a more detailed error? (not looking for help on the real source of the error yet)
Log into the azure portal portal.azure.com.
Open the Activity log
Find the record with Operation Name of Validate in the list of activities. It should have a red exclamation mark because it failed.
Click on it that record. Then click on the JSON tab at the bottom. Get reading and somewhere deep down in returned Json you might find an error in the statusMessage such as "The storage account named helloworld is already taken."
Make sure you're running the latest version of the CLI, we're working on bubbling up the detailed error. If that's still not catching it, let us know https://github.com/Azure/azure-xplat-cli/issues
Then if the log isn't showing you the detail, run the deployment with the -vv switch, the detailed debug output (while verbose) will have all the error messages and you can usually sift through and find the specific failure.
azure group deployment create ... --debug
Powershell:
New-AzResourceGroupDeployment ... -debug
Run the following PowerShell Azure cmdlet with the tracking ID supplied:
Get-AzureRMLog -CorrelationId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -DetailedOutput
Building on nftw's answer...
To make it faster/easier to find the error issue I used grep and less with a variable as follows:
$correlationId ='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' # store your correlation ID here
Get-AzureRmLog -CorrelationId $correlationID -DetailedOutput | grep -C 10 $correlationID | less
In my testing the error was close to the top of the output. You could use less and the forward-slash key / and search "error" to find the error even quicker.
I believe that tracking ID is for technical support for looking at their logs, not for the user.
Regarding your exact question, you need to take a look at logs - reference.
Another good way to validate the template is to use Resource Explorer.
Building on #nftw:
$deploymentGroupName = 'deploymentGroupName'
$correlationId = ((Get-AzureRMLog -ResourceGroup $deploymentGroupName)[0]).CorrelationId
$logentry = (Get-AzureRMLog -CorrelationId $correlationId -DetailedOutput)
#$logentry
$rawStatusMessage = $logentry.Properties
$status = $rawStatusMessage.Content.statusMessage | ConvertFrom-Json
$status.error.details
$status.error.details.details
I was running in the same issue. Basically, I couldn't get any details passed "InvalidTemplateDeployment".
I added my ARM template in a Visual Studio: Azure Resource Group project template and tried to deploy it. I got verbose details in the Output tab. That helped me solve my problem.
In my case it was the name of the cluster, it can only be small letters and numbers.
az vm list [--only-show-errors]
[--resource-group]
[--show-details]
[--subscription]

Resources