Giter Site home page Giter Site logo

Comments (17)

RossMurr4y avatar RossMurr4y commented on July 29, 2024 1

Seeing the same behaviour on Microsoft.CostManagement/views@2021-10-01:

if you provide the eTag after resource has been created: "Could not find member 'eTag' on object of type 'TemplateResource'. Path 'properties.template.resources[0].eTag'"

if you don't provide the eTag: "Etag value required for update operation of view: "

from bicep-types-az.

alex-frankel avatar alex-frankel commented on July 29, 2024 1

Awesome that this is fixed! I will move this into the types repo to track the swagger fix to mark etag as optional -- FYI @flanakin

from bicep-types-az.

slavizh avatar slavizh commented on July 29, 2024 1

I will make a fair comment here that Cost Management team cannot write proper APIs. Even some of the newer and simple APIs like providers/Microsoft.CostManagement/settings do not work properly with ARM/Bicep Templates.

Not to mention also the API versions that are published but not available on the service thus you get that the API is not supported and message which are available ones.

from bicep-types-az.

slavizh avatar slavizh commented on July 29, 2024

same old: we did the bare minimum on API and released it without testing ARM template support.

from bicep-types-az.

VM-ICT avatar VM-ICT commented on July 29, 2024

I am also facing similar issue. When I tried to create a resource group.
Below is my bicep code.

targetScope = 'subscription'

param namePrefix string
param envPrefix string
param instaneID string
param resourceLocation string = deployment().location
param projectName string = 'SampleProject'

resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: '${namePrefix}-${projectName}-${envPrefix}-${instaneID}'
location: resourceLocation
tags: {
Project: projectName
InnovationsLab: 'InnovationsLab'
Environment: envPrefix
}
}

Error
Error from Azure portal : The request content was invalid and could not be deserialized: 'Could not find member 'etag' on object of type 'TemplateResource'. Path 'properties.template.resources[0].etag', line 1, position 1162.'.
Any help is much appreciated.

from bicep-types-az.

massimosil avatar massimosil commented on July 29, 2024

I have the same issue, the API is not idempotent. In Azure/bicep#9393 you said to open a support ticket but this is not a solution, and #1441 redirects here. Please reopen this issue.

from bicep-types-az.

alex-frankel avatar alex-frankel commented on July 29, 2024

Re-open which issue? Azure/bicep#9393 is closed as a duplicate because the resolution will be the same. This is an issue with the cost management API, so that is why we suggest a support ticket. We have made the cost management team aware of the issue and we hope the fix the issue soon, but we can't do anything beyond that. A support ticket is an effective way to get the issue in front of the team where they will need to provide a mitigation or ETA for a fix.

from bicep-types-az.

jikuja avatar jikuja commented on July 29, 2024

i just yesterday re-deployed 'Microsoft.CostManagement/scheduledActions@2022-10-01 multiple times with Bicep without getting any issues => looks like Azure/bicep#9393 is fixed on RP now.


But Bicep documentation of the given resource still has false information of about etag property: https://learn.microsoft.com/en-us/azure/templates/microsoft.costmanagement/scheduledactions?pivots=deployment-language-bicep. REST API also have similar mentions: https://learn.microsoft.com/en-us/rest/api/cost-management/scheduled-actions/create-or-update?tabs=HTTP

I did not test if direct API call to PUT https://management.azure.com/providers/Microsoft.CostManagement/scheduledActions/{name}?api-version=2022-10-01 still requires eTag but Bicep **re-**deployment is working.

@slavizh It could be a good idea to test if they fixed all API endpoints in their namespace

cc: @massimosil @alex-frankel

from bicep-types-az.

vonbartas avatar vonbartas commented on July 29, 2024

i just yesterday re-deployed 'Microsoft.CostManagement/scheduledActions@2022-10-01 multiple times with Bicep without getting any issues => looks like Azure/bicep#9393 is fixed on RP now.

But Bicep documentation of the given resource still has false information of about etag property: https://learn.microsoft.com/en-us/azure/templates/microsoft.costmanagement/scheduledactions?pivots=deployment-language-bicep. REST API also have similar mentions: https://learn.microsoft.com/en-us/rest/api/cost-management/scheduled-actions/create-or-update?tabs=HTTP

I did not test if direct API call to PUT https://management.azure.com/providers/Microsoft.CostManagement/scheduledActions/{name}?api-version=2022-10-01 still requires eTag but Bicep **re-**deployment is working.

@slavizh It could be a good idea to test if they fixed all API endpoints in their namespace

cc: @massimosil @alex-frankel

It's fixed, I can confirm.

from bicep-types-az.

slavizh avatar slavizh commented on July 29, 2024

I am confirming that idempotency is fixed in Microsoft.CostManagement/exports@2022-10-01 but Microsoft.CostManagement/views@2022-10-01 reported by another user still requires eTag thus still not ARM/Bicep Template compliant resource.

from bicep-types-az.

 avatar commented on July 29, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ccmaxpcrew. Please see https://aka.ms/biceptypesinfo for troubleshooting help.

Issue Details

Bicep version
Bicep CLI version 0.4.1318 (ee0d808f35)

Describe the bug
The API is not idempotent. You can create the resource the first time but when trying to reapply you get:

Status Message: Etag value required for update operation of report: test1.Please get the latest to avoid overwrite. (Request ID: 37dfcd1f-b755-45a0-bcd4-80eb27347b73) (Code:400)

if you try to add

etag: '*'

at the same level as name you will get error:

  • Error: Code=InvalidRequestContent; Message=The request content was invalid and could not be deserialized: 'Could not find member 'eTag' on object of type 'TemplateResource'. Path 'properties.template.resources[0].eTag', line 19, position 17.'.

To Reproduce
Steps to reproduce the behavior:

targetScope = 'subscription'

resource export 'Microsoft.CostManagement/exports@2021-10-01' = {
  name: 'test1'
  properties: {
    format: 'Csv'
    partitionData: false
    definition: {
      type: 'Usage'
      timeframe: 'TheLastBillingMonth'
      dataSet: {
        granularity: 'Daily'
        configuration: null
      }
      timePeriod: null
    }
    deliveryInfo: {
      destination: {
        resourceId: '/subscriptions/<sub id>/resourceGroups/<rg name>/providers/Microsoft.Storage/storageAccounts/<str account name>'
        container: 'test'
        rootFolderPath: 'test2'
        sasToken: null
        storageAccount: null
      }
    }
    schedule: {
      status: 'Active'
      recurrence: 'Monthly'
      recurrencePeriod: {
        from: '2022-04-06T00:00:00Z'
        to: '2022-05-01T00:00:00Z'
      }
    }
  }
}

Additional context
Add any other context about the problem here.

Author: slavizh
Assignees: -
Labels:

inaccuracy, RP: Microsoft.CostManagement, Service Attention, Cost Management and Consumption

Milestone: -

from bicep-types-az.

przlwo avatar przlwo commented on July 29, 2024

Hi, does the issue with Microsoft.CostManagement/views endpoint was resolved? Currently I'm facing this issue.

from bicep-types-az.

vonbartas avatar vonbartas commented on July 29, 2024

Hi, does the issue with Microsoft.CostManagement/views endpoint was resolved? Currently I'm facing this issue.

For me works fine.

from bicep-types-az.

przlwo avatar przlwo commented on July 29, 2024

Thank you @vonbartas.
Can you confirm that eTag: '*' should work? Which API version do you use?

Maybe you can find other reason why I'm getting message 'Could not find member 'eTag' on object of type 'TemplateResource'.

resource costAnomalyView 'Microsoft.CostManagement/views@2022-10-05-preview' = {
name: vName
eTag: '*'
properties: {
accumulated: 'string'
chart: 'Table'
displayName: 'CostAnomaly'
metric: 'ActualCost'
query: {
dataSet: {
aggregation: {
totalCost: {
function: 'Sum'
name: 'PreTaxCost'
}
}
granularity: 'Daily'
grouping: [
{
name: 'SubscriptionId'
type: 'Dimension'
}
]
sorting: [
{
direction: 'Descending'
name: 'Subscription'
}
]
}
includeMonetaryCommitment: null
timeframe: 'WeekToDate'
type: 'Usage'
}
scope: 'subscriptions/{subscriptionId}'
}
}

from bicep-types-az.

vonbartas avatar vonbartas commented on July 29, 2024

Thank you @vonbartas. Can you confirm that eTag: '*' should work? Which API version do you use?

Maybe you can find other reason why I'm getting message 'Could not find member 'eTag' on object of type 'TemplateResource'.

resource costAnomalyView 'Microsoft.CostManagement/views@2022-10-05-preview' = { name: vName eTag: '*' properties: { accumulated: 'string' chart: 'Table' displayName: 'CostAnomaly' metric: 'ActualCost' query: { dataSet: { aggregation: { totalCost: { function: 'Sum' name: 'PreTaxCost' } } granularity: 'Daily' grouping: [ { name: 'SubscriptionId' type: 'Dimension' } ] sorting: [ { direction: 'Descending' name: 'Subscription' } ] } includeMonetaryCommitment: null timeframe: 'WeekToDate' type: 'Usage' } scope: 'subscriptions/{subscriptionId}' } }

@2022-10-01

from bicep-types-az.

przlwo avatar przlwo commented on July 29, 2024

unfortunatelly this API version also returns error "The request content was invalid and could not be deserialized: 'Could not find member 'eTag' on object of type 'TemplateResource' :(

from bicep-types-az.

ccmaxpcrew avatar ccmaxpcrew commented on July 29, 2024

from bicep-types-az.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.