Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named values used in backend definitions #113

Open
mikaelsand opened this issue Feb 9, 2022 · 2 comments
Open

Named values used in backend definitions #113

mikaelsand opened this issue Feb 9, 2022 · 2 comments

Comments

@mikaelsand
Copy link

mikaelsand commented Feb 9, 2022

DependsOn not set

When defining a backend and use a named value, that named value is extracted in the template. So far so good.
But that backend is not set to depend on the same named value, leading to errors in deployment since the backend might be deployed before the named value is. Manually updating the template made it work just fine.

Original template code

(deleted some for readability)

{
      "type": "Microsoft.ApiManagement/service/backends",
      "name": "[concat(parameters('My_API_Service_name'), '/' ,'LogicAppName')]",
      "apiVersion": "2019-01-01",
      "properties": {
        "url": "Long tings pointing to a logic app in this case",
        "resourceId": "Pointing to said logic app",
        "credentials": {
          "query": {
            "sig": [
              "{{MyLogicAppKey}}"
            ]
          },
          "header": {}
        },
      "dependsOn": []
    },
    {
      "type": "Microsoft.ApiManagement/service/namedValues",
      "name": "[concat(parameters('My_API_Service_name'), '/', 'MyLogicAppKey')]",
      "apiVersion": "2020-06-01-preview",
      "properties": {
        "displayName": "MyLogicAppKey",
        "secret": true,
        "value": "A long thing pointing to the signature in the Logic app"
      },
      "resources": [],
      "dependsOn": []
    }

My updated template code

(Just the affected part the post is getting too long)

{
      "type": "Microsoft.ApiManagement/service/backends",
      "name": "[concat(parameters('My_API_Service_name'), '/' ,'LogicAppName')]",
      "apiVersion": "2019-01-01",
      "properties": {
        "url": "Long tings pointing to a logic app in this case",
        "resourceId": "Pointing to said logic app",
        "credentials": {
          "query": {
            "sig": [
              "{{MyLogicAppKey}}"
            ]
          },
          "header": {}
        },
      "dependsOn": [
        "[resourceId('Microsoft.ApiManagement/service/namedValues', parameters('My_API_Service_name'), 'MyLogicAppKey')]"
      ]
    },
@e-karlsson
Copy link

Hi! Having the same issue. @mikaelsand : did you find any solution for it or just went manual?

@MLogdberg : Something you have been looking into?

@mikaelsand
Copy link
Author

Sorry. I had to use the manual approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants