Maaaarden / VSCode-AzureAutomationExtension

8 stars 5 forks source link

Problem with long Resource Group names? #28

Closed marckean closed 2 years ago

marckean commented 5 years ago

This is my Resource Group name for Azure Automation. I have put this in the settings...

OaaSCSDNMWXKJTDR2Y2QVEWXZOLCODZKTXDSDFSCBII2VHAU2BTS76WBEQ-Southeast-Asia

... it doesn't seem to like it.

marckean commented 5 years ago

FYi - this is the bit where it uses the Resource Group name.

getOauthToken(function (token) {
      request.get({
        url: `https://management.azure.com/subscriptions/${azureconfig.subscriptionId}/resourceGroups/${azureconfig.resourceGroup}/providers/Microsoft.Automation/automationAccounts/${azureconfig.automationAccount}/runbooks/${runbookName}?api-version=${azureconfig.apiVersion}`,
        headers: {
          'Authorization': token.value,
          'content-type': 'application/json'
        }
Maaaarden commented 5 years ago

Hi @marckean

I've been testing a bit, and it does not seem to be caused by long RG name. How many runbooks do you have in your account? During this testing, it looks like it doesn't work with less than 2 runbooks. I think it is related to me traversing an array somewhere, and thus it fails when only one object is present.

marckean commented 5 years ago

I have over 10 runbooks. Are there any logs i can pull out when it connects? Because it just sits there, times out and displays nothing.

Maaaarden commented 5 years ago

@marckean I've made better support for error handling in version 0.9.3 - please upgrade, and let me know it shows any error messages in your scenario.