Comments (17)
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.
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.
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.
same old: we did the bare minimum on API and released it without testing ARM template support.
from bicep-types-az.
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.
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.
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.
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
from bicep-types-az.
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
It's fixed, I can confirm.
from bicep-types-az.
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.
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: |
|
Milestone: | - |
from bicep-types-az.
Hi, does the issue with Microsoft.CostManagement/views endpoint was resolved? Currently I'm facing this issue.
from bicep-types-az.
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.
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.
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.
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.
from bicep-types-az.
Related Issues (20)
- ContainerRegistry HOT 1
- [Microsoft.DataFactory/factories]: Missing PipelineBillingEnabled HOT 1
- Dynamic throttling option in OpenAI Studio should be marked as settable
- [managedEnvironments]: "identity" property missing in type definition HOT 1
- Microsoft.DocumentDB/databaseAccounts: sqlEndpoint property removal
- Microsoft.OperationsManagement/solutions: 2015-11-01-preview does not support properties.sku
- Azure Backup Vaults: "Microsoft.DataProtection/backupVaults@2024-04-01" missing "SKU" in Bicep
- Unable to parse request payload when creating services on Microsoft.DocumentDB/databaseAccounts HOT 3
- APIM backends protocol not valid
- APIM Backend Pool can not deploy HOT 1
- 'Microsoft.Subscription/aliases@2021-10-01' - No . allowed in name HOT 2
- [documentDb\: Inaccuracy continuousModeProperties while using type 'Continuous' in backupPolicy
- Microsoft.Security/pricings@2024-01-01 | api
- [CustomDomainConfiguration]: missing certificateKeyVaultProperties
- Microsoft.Cdn/profiles/secrets works with FrontDoor profile but not CDN HOT 1
- Microsoft.MachineLearningServices/workspaces/deployments: Missing property SKU
- Bicep VSCode extension recommends API version not available by resource provider for `scheduledQueryRules` HOT 3
- Getting subscription offer type HOT 1
- Microsoft.Insights/scheduledQueryRules@2023-12-01 : missing HOT 1
- [Qumulo.Storage/fileSystems]: `storageSku` property enum values incorrect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bicep-types-az.