azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

[BUG] Invalid resource type Microsoft.Web/sites/workflows requesting generic resource with an ResourceIdentifier

Open TWolversonReply opened this issue 1 year ago • 8 comments
trafficstars

Library name and version

Azure.ResourceManager 1.10.1

Describe the bug

Request ArmClient.GetGenericResource(new ResourceIdentifier(stringVar)) where stringVar is the resource ID of a Logic Apps Standard workflow queried by REST API using $"/subscriptions/{subscription}/resourceGroups/{resourceGroup}/providers/Microsoft.Web/sites/{webApp}/workflows?api-version=2018-11-01";. I am certain the resource ID is correct as it is the exact value returned by the REST API, and have corroborated this by using az resource show --ids (the id) which works fine. The ID in question is (anonymised):

/subscriptions/{subscription id - verified correct}/resourceGroups/{rg name - verified correct}/providers/Microsoft.Web/sites/{logic app name - verified correct}/workflows/{workflow name - verified correct}

Expected behavior

The resource is returned

Actual behavior

Exception thrown:

InvalidOperationException: Invalid resource type Microsoft.Web/sites/workflows Azure.ResourceManager.Resources.ResourceProviderCollection.GetApiVersion(ResourceType resourceType, CancellationToken cancellationToken)

Reproduction Steps

Use ArmClient.GetGenericResource with the ID of any Logic App Standard workflow

Environment

Windows 10 .NET SDK: Version: 8.0.102 Commit: 64f1bc458e Workload version: 8.0.100-manifests.3097af8b

Runtime Environment: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.102\

.NET workloads installed: Workload version: 8.0.100-manifests.3097af8b [aspire] Installation Source: SDK 8.0.100, VS 17.9.34310.174 Manifest Version: 8.0.0-preview.1.23557.2/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.0-preview.1.23557.2\WorkloadManifest.json Install Type: Msi

Host: Version: 8.0.2 Architecture: x64 Commit: 1381d5ebd2

.NET SDKs installed: 2.2.108 [C:\Program Files\dotnet\sdk] 3.1.426 [C:\Program Files\dotnet\sdk] 6.0.419 [C:\Program Files\dotnet\sdk] 7.0.116 [C:\Program Files\dotnet\sdk] 8.0.100 [C:\Program Files\dotnet\sdk] 8.0.102 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables: Not set

global.json file: Not found

Learn more: https://aka.ms/dotnet/info

Download .NET: https://aka.ms/dotnet/download

TWolversonReply avatar Feb 21 '24 14:02 TWolversonReply

Thank you for your feedback. Tagging and routing to the team member best able to assist.

jsquire avatar Feb 21 '24 20:02 jsquire

Hi @TWolversonReply Thank you for your feedback. I'm sorry, but Microsoft.Web/sites/workflows is indeed an invalid resource type. If it's a Logic Apps Standard workflow, I believe its resource type should be providers/Microsoft.Logic/workflows/{workflowName}, and the API version should be 2016-06-01. Clearly, there is no resource 'workflow' in AppService. The resource ID you provided is obviously an illegal product. I would like to know which REST API you used to get this ID format, so that we can troubleshoot.

mcgallan avatar Apr 07 '24 09:04 mcgallan

Hi @TWolversonReply. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] avatar Apr 07 '24 09:04 github-actions[bot]

Hi @TWolversonReply, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

github-actions[bot] avatar Apr 14 '24 10:04 github-actions[bot]

@mcgallan As I described it in the original message.

az rest --url "/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.Web/sites/$site/workflows?api-version=2018-11-01"

$sub, $rg, $site refer to what you'd expect; the subscription id, the resource group and the site name.

This returns

{
  "id": null,
  "nextLink": null,
  "value": [
    {
      "id": "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Web/sites/<site>/workflows/workflow-ids-tracking",
      "kind": "Stateful",
      "location": "UK South",
      "name": "<site>/workflow-ids-tracking",
      "properties": {
        "flowState": "Enabled",
        "health": {
          "state": "Healthy"
        }
      },
      "type": "Microsoft.Web/sites/workflows"
    },
    {
      "id": "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Web/sites/<site>/workflows/testOracleworkflow",
      "kind": "Stateful",
      "location": "UK South",
      "name": "<site>/testOracleworkflow",
      "properties": {
        "flowState": "Disabled",
        "health": {
          "state": "Healthy"
        }
      },
      "type": "Microsoft.Web/sites/workflows"
    },
    {
      "id": "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Web/sites/<site>/workflows/error-processing",
      "kind": "Stateful",
      "location": "UK South",
      "name": "<site>/error-processing",
      "properties": {
        "flowState": "Enabled",
        "health": {
          "state": "Healthy"
        }
      },
      "type": "Microsoft.Web/sites/workflows"
    },
    {
      "id": "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Web/sites/<site>/workflows/notification",
      "kind": "Stateful",
      "location": "UK South",
      "name": "<site>/notification",
      "properties": {
        "flowState": "Enabled",
        "health": {
          "state": "Healthy"
        }
      },
      "type": "Microsoft.Web/sites/workflows"
    },
    {
      "id": "/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Web/sites/<site>/workflows/system-health",
      "kind": "Stateful",
      "location": "UK South",
      "name": "<site>/system-health",
      "properties": {
        "flowState": "Disabled",
        "health": {
          "state": "Healthy"
        }
      },
      "type": "Microsoft.Web/sites/workflows"
    }
  ]
}

for an example in my current environment. As you can see the "id" properties have the following format:

"id": "/subscriptions//resourceGroups//providers/Microsoft.Web/sites//workflows/"

As far as I am aware, Microsoft.Logic/workflows is only correct for Consumption-tier Logic Apps. A Standard Logic App is an App Service with kind=functionapp,workflowapp - so if a workflow isn't a child resource of that site resource, what is it a child of?

TWolversonReply avatar Apr 18 '24 12:04 TWolversonReply

HI @TWolversonReply , thank you for your feedback. Regarding your response, I have reconfirmed through Swagger that in the api-version 2018-11-01, there indeed isn't a resource called 'workflows'. However, we will be upgrading the api version of App Service in the near future, at which point we will upgrade to the 2023 api-version. In this version, we have added resources related to workflows. The latest version of AppService (api-version 2021-02-01) indeed does not include content related to workflows. This issue is likely caused by the REST API version and SDK version being out of sync. I believe this issue will be resolved after the new version is released.

mcgallan avatar May 10 '24 06:05 mcgallan

Hi @TWolversonReply. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] avatar May 10 '24 06:05 github-actions[bot]

Hi @TWolversonReply, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

github-actions[bot] avatar May 17 '24 09:05 github-actions[bot]