konstruktoid / ansible-bastion-tunnels

Ansible inventory script using Azure Bastion tunnel functionality.
Apache License 2.0
3 stars 1 forks source link

Resource group could not found. #8

Open Rahulsharma0810 opened 5 months ago

Rahulsharma0810 commented 5 months ago

Thanks for all your efforts, But i get below error.

❯ python bastion_tunnels_inventory.py
azure.core.exceptions.ResourceNotFoundError: (ResourceGroupNotFound) Resource group 'ga-rocky8-x86-64' could not be found.
Code: ResourceGroupNotFound
Message: Resource group 'ga-rocky8-x86-64' could not be found.
az account set --subscription XXXX-5c93-XXXX-8d14-ff5c32cde849

az group list
[
  {
    "id": "/subscriptions/XXXX-5c93-XXXX-8d14-ff5c32cde849/resourceGroups/ga-rocky8-x86-64",
    "location": "eastus",
    "managedBy": null,
    "name": "ga-rocky8-x86-64",
    "properties": {
      "provisioningState": "Succeeded"
    },
    "tags": {},
    "type": "Microsoft.Resources/resourceGroups"
  }
]
konstruktoid commented 5 months ago

Hi @Rahulsharma0810, does creating a tunnel using az network bastion tunnel work with that resource group?

RS185734 commented 5 months ago

I am creating the bastion with terraform, below is the output

❯ az network bastion list

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
[
  {
    "disableCopyPaste": false,
    "dnsName": "bst-XX-3901-4193-997b-aabbe1594129.bastion.azure.com",
    "enableFileCopy": true,
    "enableIpConnect": true,
    "enableShareableLink": false,
    "enableTunneling": false,
    "etag": "W/\"6a7372dd-XX-497d-98e3-8a241ce3d164\"",
    "id": "/subscriptions/XXXX-5c93-XXXX-8d14-ff5c32cde849/resourceGroups/ga-rocky8-x86-64/providers/Microsoft.Network/bastionHosts/bastion-ga-rocky8-x86-64",
    "ipConfigurations": [
      {
        "etag": "W/\"6a7372dd-XX-497d-98e3-8a241ce3d164\"",
        "id": "/subscriptions/XXXX-5c93-XXXX-8d14-ff5c32cde849/resourceGroups/ga-rocky8-x86-64/providers/Microsoft.Network/bastionHosts/bastion-ga-rocky8-x86-64/bastionHostIpConfigurations/configuration",
        "name": "configuration",
        "privateIPAllocationMethod": "Dynamic",
        "provisioningState": "Succeeded",
        "publicIPAddress": {
          "id": "/subscriptions/XXXX-5c93-XXXX-8d14-ff5c32cde849/resourceGroups/ga-rocky8-x86-64/providers/Microsoft.Network/publicIPAddresses/bastion-publicip-ga-rocky8-x86-64",
          "resourceGroup": "ga-rocky8-x86-64"
        },
        "resourceGroup": "ga-rocky8-x86-64",
        "subnet": {
          "id": "/subscriptions/XXXX-5c93-XXXX-8d14-ff5c32cde849/resourceGroups/ga-rocky8-x86-64/providers/Microsoft.Network/virtualNetworks/VN-ga-rocky8-x86-64/subnets/AzureBastionSubnet",
          "resourceGroup": "ga-rocky8-x86-64"
        },
        "type": "Microsoft.Network/bastionHosts/bastionHostIpConfigurations"
      }
    ],
    "location": "eastus",
    "name": "bastion-ga-rocky8-x86-64",
    "provisioningState": "Succeeded",
    "resourceGroup": "ga-rocky8-x86-64",
    "scaleUnits": 2,
    "sku": {
      "name": "Standard"
    },
konstruktoid commented 5 months ago

enableTunneling needs to be enabled.