Service Bus 1.0 Beta New-SBFarm : The specified directory service attribute or value does not exist - powershell

I am trying to register a new SB Farm following the procedure from http://msdn.microsoft.com/en-us/library/windowsazure/jj193021(v=azure.10).aspx
However when I try to execute the first part
$mycert= ConvertTo-SecureString -AsPlainText -Force -String 'password1'
New-SBFarm -FarmMgmtDBConnectionString "data source=.\SQLEXPRESS;Integrated
Security=True;" –CertAutoGenerationKey $mycert
I receive the following error:
New-SBFarm : The specified directory service attribute or value does not exist.
At line:1 char:1
+ New-SBFarm -FarmMgmtDBConnectionString "data
source=.\SQLEXPRESS;Integrated ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : NotSpecified: (:) [New-SBFarm], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Micr
osoft.ServiceBus.Commands.NewSBFarm
I have ensured my server meets the application requirements, however I am still no luck...
Any help please?

That line contains two separate cmdlet calls, one to create the secure string, and the second to create the new farm. Are you executing each call separately? From the pasted code, it seems like you're running them as one command, which would probably fail.
Also, the New-SBFarm has a switch to show verbose tracing. Could you try running the command with -verbose at the end and share the output?

Related

Add-AzureRmServiceFabricNodeType -> 'accountName' cannot be null

I'm trying to use the 'Add-AzureRmServiceFabricNodeType' command to add a new nodeType to an existing service fabric cluster. This is my command:
Add-AzureRmServiceFabricNodeType -ResourceGroupName "$ResourceGroupName$" -Name "$ClusterName$" -NodeType "$TypeName$" -VmSku "Standard_H8" -Capacity 3 -VmUserName "$UserName$" -VmPassword $pwd
Having already logged in and set the subscription using 'Login-AzureRmAccount' and 'Set-AzureRmContext'
The call runs for ~1hr and then returns the following error:
WARNING: Rolling back the changes to the cluster
Add-AzureRmServiceFabricNodeType : 'accountName' cannot be null.
At line:1 char:1
+ Add-AzureRmServiceFabricNodeType -ResourceGroupName "%ResourceGroupName% ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Add-AzureRmServiceFabricNodeType], ValidationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.ServiceFabric.Commands.AddAzureRmServiceFabricNodeType
I have successfully added a nodetype to this cluster in the past, but then i didn't set the -VmSku option. As well as that difference, the subscription has since been upgraded from a pay as you go sub to an Enterprise Agreement. Based on the error received I guess it might have something to do with that, but i can't seem to find what exactly.
Any ideas?
I will assume you used the secure encoding to provide the password
$password = ConvertTo-SecureString -String 'Password$123456' -AsPlainText -Force
I also suggest you add the -Tier as part of your command, because as part of provisioning process it requires the sku, tier and capacity. If you not provide one it will use the default, and the sku might not be compatible with the default tier or your account availability.
You can also check in Azure if the VMSS are created once you run the command.
If you want to investigate further, I would recommend reading the source code for the command operation executed for adding node types.

Deciphering error after runnning New-AzureRmDataLakeAnalyticsCatalogCredential

I am working on reading Azure SQL data from a U-SQL script into Data Lake. I am working on creating an external data source in U-SQL. A part of this effort involves the creation of a “credential” using PowerShell. I am following this guidance:
https://learn.microsoft.com/en-us/powershell/module/azurerm.datalakeanalytics/new-azurermdatalakeanalyticscatalogcredential
But, am stuck on an error, shown below. This part of it has me especially stumped: "The resource '' does not exist.". Due to this part of the command : "-Credential (Get-Credential)", I get prompted for login name and password. After that, I get presented with the error.
Please help me decipher this situation.
Thank you!
Eric
C:\WINDOWS\system32> New-AzureRmDataLakeAnalyticsCatalogCredential -AccountName "" `
-DatabaseName "<MYDBNAME>" `
-CredentialName "<MYCREDENTIALNAME>" `
-Credential (Get-Credential) `
-Uri "http://<MYSERVERNAME>.database.windows.net:1433"
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
WARNING: The output type defined for this cmdlet is incorrect and will be updated to reflect what is actually returned
(and defined in the help) in a future release.
New-AzureRmDataLakeAnalyticsCatalogCredential : The resource '' does not exist. Trace:
c3e04b2a-2690-4c5e-b61c-58a5ded93c6b Time: 2017-05-10T09:09:07.8971058-07:00
At line:1 char:1
+ New-AzureRmDataLakeAnalyticsCatalogCredential -AccountName "bladlalog ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [New-AzureRmData...talogCredential], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.DataLakeAnalytics.NewAzureDataLakeAnalyticsCatalogCredential
Solved by using a new ADL database name, that I created, and not the source Azure SQL database. I got the "az dla catalog credential create" to run cleanly. .... The online documentation I initially found was not clear for indicating the expected database name was an ADL database, and not the source Azure SQL database.

ADAL in Azure Automation: Type not loading intermittantly

I'm working on an Azure Automation script where I need to retrieve an access token to call the AAD Graph API. I wanted to use ADAL to do this so I zipped up Microsoft.IdentityModel.Clients.ActiveDirectory.dll and uploaded it as a module. When I run from the test blade, it sometimes works, and sometimes fails with this error:
New-Object : Cannot find type [Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential]: verify that the
assembly containing this type is loaded.
At line:22 char:9
+ $cred = New-Object Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredent ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
When it fails I just run it again and it works. Now I've published and scheduled this runbook as a daily job 3 days ago. So far it has failed every day with this same error.
Has any one else seen this? Any suggestions on next steps?
I fixed this by adding the following line to my script:
Add-Type -Path "C:\Modules\User\Microsoft.IdentityModel.Clients.ActiveDirectory\Microsoft.IdentityModel.Clients.ActiveDirectory.dll"
Still not sure why it was working intermittently before. I guess depending on what else was going on ADAL may or may not have been loaded?

Strange Error with Powershell when downloading files

I got a very strange error when trying to install dnvm on powershell. Actually I get this error with any attempt to download anything, e.g. "wget" produces a similar error.
I thought first that I don't have the rights to execute but running this in an Administrator shell + I changed the Security Policy.
Then I figured that the PS doesn't have access to the internet, so I adjusted the Firewall and even added PS to the allowed programs. No luck!
Now the weird thing is that I can download files just fine via IE.
This is the error that I get
Exception calling "DownloadString" with "1" argument(s): "An exception occurred during a WebClient request."
At line:1 char:17
+ &{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.gith ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
Anyone as an idea?
Also this is a machine running on AWS.
This is a shot in the dark, but first thing that comes to mind is proxy settings.
System.Net.WebClient does not automatically pick up IE's proxy configuration, but you should be able to force it to do so with:
$WebClient = New-Object System.Net.WebClient
$WebProxy = [System.Net.WebProxy]::GetDefaultProxy()
$WebClient.Proxy = $WebProxy
$WebClient.DownloadString($url)
or with your very compact syntax:
&{$Branch='dev';($w=New-Object Net.WebClient).Proxy=[Net.WebProxy]::GetDefaultProxy();iex $w.DownloadString($url)}

Azure PowerShell Error: while using Start-AzureSqlDatabaseCopy it throws exception with Error Code: NotFound

I was trying to make a copy of a database on azure using powershell. I have used "Start-AzureSqlDatabaseCopy" for powershell as descriibed on https://msdn.microsoft.com/en-us/library/ff951631.aspx. But it was failing, and not able to create database copy there. I even tried deleting an existing database using "Remove-AzureSqlDatabase" and saw the same issue.
I have connected to the subscription successfully by using Import-AzurePublishSettingsFile. Verified the connection by providing invalid server and throws the expected exception.
Tried to execute as below
Start-AzureSqlDatabaseCopy -ServerName $SourceServerName -DatabaseName $SourceDatabaseName -PartnerServer $TargetServerName -PartnerDatabase $TargetDatabaseName
Throws the below exception.
Start-AzureSqlDatabaseCopy :https://management.core.windows.net/Id/services/sqlservers/servers/server/databases/database/databasecopies does not exist. Error Code: NotFound At s\Scripts\CreateCIDatabase.ps1:36 char:6 + Start-AzureSqlDatabaseCopy -ServerName $SourceServerName -DatabaseName $Sou ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-AzureSqlDatabaseCopy], CommunicationException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.StartAzureSqlDatabaseCopy
I appreciate If someone can help me on this issue?
similar issue has also been posted https://stackoverflow.com/questions/29004974/azure-powershell-to-create-database-backup
Similar to this thread, it looks like you have not properly set your current subscription to the subscription your database is located on. Try to do the following.
1) Set the subscription to the subscription your database is on.
Set-AzureSubscription -SubscriptionName <Your Subscription Name>
2) Check to make sure your current subscription is the one you want to use.
Get-AzureSubscription -Current
3) Use the DBCopy cmdlet to start your copy.
Start-AzureSqlDatabaseCopy -ServerName <SourceServer> -DatabaseName <SourceDatabaseName> -PartnerServer <TargetServerName> -PartnerDatabase <TargetDatabaseName>
Hope this helps!