mattmcspirit / azurestack

Azure Stack Resources
80 stars 41 forks source link

Error with Multiple Azure Subscriptions #25

Closed CharbelNemnom closed 6 years ago

CharbelNemnom commented 6 years ago

The script is failing with the following error if you have multiple Azure Subscriptions. The parameter $azureRegSubId could be used to specify a particular Azure Subscription ID. (Line 898) TerminatingError(Get-AzureRmSubscription): "Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'SubscriptionId'. Specified method is not supported."

mattmcspirit commented 6 years ago

Hey Charbel - Thanks! i made the edits directly. I fixed this issue whenever the script needs to query the marketplace, however I will still need to test how to fix this on lines 2440 and 2498, where the App Service creates the AAD app. I may need to ask the user to provide a subscription used for ASDK deployment also. What do you think?

mattmcspirit commented 6 years ago

Although, thinking about it, it may not matter:

$appID = . .\Create-AADIdentityApp.ps1 -DirectoryTenantName "$azureDirectoryTenantName" -AdminArmEndpoint "adminmanagement.local.azurestack.external" -TenantArmEndpoint "management.local.azurestack.external" ` -CertificateFilePath "$AppServicePath\sso.appservice.local.azurestack.external.pfx" -CertificatePassword $secureVMpwd -AzureStackAdminCredential $asdkCreds

This command targets $azureDirectoryTenantName specifically, which in turn is only associated with a single subscription, so it should figure itself out i guess.

mattmcspirit commented 6 years ago

Should be fixed now - I used -TenantId when logging into Azure, which should get the correct subscription based on the tenant ID. Please test and let me know!

CharbelNemnom commented 6 years ago

Thank you Matt,

I am facing another weird issue with SQLServerRP.

The error: System.Management.Automation.RuntimeException: Microsoft.SQLAdapter.Admin endpoint is not responsive.

I have attached the log file for your reference.

In the portal under system.local.sqladapter RG, I am seeing Deployment Succeeded (3) only.

I repeated the deployment several times and still the same issue. ConfigASDKLog0529-093845.txt

Stage Status


DownloadTools Complete HostConfiguration Complete Registration Complete UbuntuImage Complete WindowsImage Complete ScaleSetGalleryItem Complete MySQLGalleryItem Complete SQLServerGalleryItem Complete MySQLRP Complete SQLServerRP Failed RegisterNewRPs Incomplete MySQLSKUQuota Incomplete SQLServerSKUQuota Incomplete MySQLDBVM Incomplete SQLServerDBVM Incomplete MySQLAddHosting Incomplete SQLServerAddHosting Incomplete CreatePlansOffers Incomplete AppServiceFileServer Incomplete AppServiceSQLServer Incomplete DownloadAppService Incomplete GenerateAppServiceCerts Incomplete CreateServicePrincipal Incomplete GrantAzureADAppPermissions Incomplete InstallAppService Incomplete InstallHostApps Incomplete CreateOutput Incomplete

Your help is highly appreciated!

Thank You! -Charbel

CharbelNemnom commented 6 years ago

Mode details here:

VERBOSE: Deploy completed. (Elapsed: 00:05:31.4322890) WARNING: Usage of this cmdlet without DnsRecords parameter will be deprecated soon. If there is a need to create empty record set, please specify DnsRecords parameter with an empty array as value VERBOSE: 11:45:03 AM : VERBOSE: 11:45:03 AM : VERBOSE: 11:45:03 AM : Testing SQLAdapter deployment VERBOSE: 11:45:03 AM : VERBOSE: Check https://SQLAdapter.dbadapter.local.azurestack.external:44300 WARNING: Can not execute [Test-ResourceProviderEndpoint] command at 1 time(s). Will retry. The error: System.Management.Automation.RuntimeException: Microsoft.SQLAdapter.Admin endpoint is not responsive VERBOSE: Check https://SQLAdapter.dbadapter.local.azurestack.external:44300 WARNING: Can not execute [Test-ResourceProviderEndpoint] command at 2 time(s). Will retry. The error: System.Management.Automation.RuntimeException: Microsoft.SQLAdapter.Admin endpoint is not responsive VERBOSE: Check https://SQLAdapter.dbadapter.local.azurestack.external:44300 WARNING: Can not execute [Test-ResourceProviderEndpoint] command at 3 time(s). Will retry. The error: System.Management.Automation.RuntimeException: Microsoft.SQLAdapter.Admin endpoint is not responsive

CharbelNemnom commented 6 years ago

Hello Matt,

I found similar issue here but it requires to open a support ticket:

https://social.msdn.microsoft.com/Forums/azure/en-US/29b327c5-fb9e-4287-8ab3-ce3097067b30/sql-resource-provider-failed-at-the-end?forum=AzureStack

https://github.com/MicrosoftDocs/azure-docs/issues/8753

Could you please help?

Many Thanks!