# S6378, S6308, S6388: False positives for existing resources in Bicep

**URL:** <https://community.sonarsource.com/t/s6378-s6308-s6388-false-positives-for-existing-resources-in-bicep/120746>\
**Category:** Report False-positive / False-negative...\
**Tags:** azureresourcemanager, sonarqube-cloud\
**Created:** [August 15, 2024, 2:06pm UTC](https://community.sonarsource.com/t/s6378-s6308-s6388-false-positives-for-existing-resources-in-bicep/120746 "2024-08-15T14:06:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MWilk](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@MWilk](https://community.sonarsource.com/u/MWilk)\
**Post date:** [August 15, 2024, 2:06pm UTC](https://community.sonarsource.com/t/s6378-s6308-s6388-false-positives-for-existing-resources-in-bicep/120746/1 "2024-08-15T14:06:19Z")

</div>

- What language is this for?

- Which rule?

- Why do you believe it’s a false-positive/false-negative?

- Are you using

- How can we reproduce the problem? Give us a self-contained snippet of code (formatted text, no screenshots)

```auto
//azureresourcemanager:S6378, azureresourcemanager:S6380
resource api_management 'Microsoft.ApiManagement/service@2022-04-01-preview' existing = {
  name: 'apim-${uniqueString(resourceGroup().id)}'
}

//azureresourcemanager:S6378, azureresourcemanager:S6388
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' existing = {
  name: 'sa${uniqueString(resourceGroup().id)}'
}

//azureresourcemanager:S6378
resource account 'Microsoft.DocumentDB/databaseAccounts@2022-05-15' existing = {
  name: 'da-${uniqueString(resourceGroup().id)}'
}

```

Also, I’m aware about this [[SONARIAC-1143] ARM rules should not check attributes on `existing` resources - Jira (atlassian.net)](https://sonarsource.atlassian.net/browse/SONARIAC-1143) which seems to be closed, but the issue for APIM, Storage Accounts and database account still persists.

---

<div class="post-metadata">

**Author:** ![rudy.regazzoni](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/rudy.regazzoni/32/38849_2.png) [@rudy.regazzoni](https://community.sonarsource.com/u/rudy.regazzoni)\
**Post date:** [August 22, 2024, 8:12am UTC](https://community.sonarsource.com/t/s6378-s6308-s6388-false-positives-for-existing-resources-in-bicep/120746/4 "2024-08-22T08:12:51Z")

</div>

Hello @MWilk and welcome to community!

Thanks for raising awareness on this topic.  
I investigated, and indeed, the previous ticket and code modification are not enough to avoid all FPs.  
I created another [ticket](https://sonarsource.atlassian.net/browse/SONARIAC-1596) to take care of it and check these rules and the rules from the previous ticket.

Sorry for the inconvenience caused and thank you again for your message.  
Best,  
Rudy

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [August 29, 2024, 1:08pm UTC](https://community.sonarsource.com/t/s6378-s6308-s6388-false-positives-for-existing-resources-in-bicep/120746/6 "2024-08-29T13:08:28Z")

</div>

Closed on August 29, 2024, 1:08pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
