-
Notifications
You must be signed in to change notification settings - Fork 753
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
remove support for providers() function in bicep #2017
Comments
agree with Brian! good suggestion. |
Relates to #4262 |
Need to decide whether to do this or to create a rule for it (the TTK has a rule discouraging the apiVersions return member). |
I am using the providers function for another use case. I have automated my deployments (using ARM then Bicep) and encountered an issue where I wanted to deploy resources in Canada Central but some of the resources were not available in that region and so I had to fall back to another region for certain resources. I ended up configuring my deployments with a primary location and an alternate location. Once
|
@kzryzstof thanks for sharing your scenario! The motivation for us to generally discourage this pattern is because the Is hard-coding the location to either @bmoore-msft, @alex-frankel FYI. |
The values for both the
In the example above, I specify that I want to deploy the service in two places, in Canada and in Japan. In the
This setup allows me to 'easily' add another region without messing with the resources. Let's say I want to deploy the service in India as well, I just need to do this. 1st I have to define the new locations with a new
And 2nd, in the YAML, I just need to add the new
All of this works because the Now if I have to hard-code the locations at the resource level (which I assume this was what you meant), it seems to complicate things a little bit as I may have to have a structure that tells Let me know if I am mistaken (and I could be :P ) |
Please what then will be the replaced version of this statement? {
name: 'AzureWebJobsStorage'
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccountName};AccountKey=${listKeys(resourceId(resourceGroup().name, 'Microsoft.Storage/storageAccounts', storageAccountName), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value};EndpointSuffix=${suffix}'
} |
@olusola-adio-sweaty - here's a sample: bicep/src/Bicep.Core.Samples/user_submitted/101/function-premium-vnet-integration/main.bicep Lines 134 to 137 in 7a933cf
If you already have the storageAccount in your Bicep file, then you'll just need to replace If you don't, then you'll need to define the following at the start of your file: resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
name: storageAccountName
} You can then use the following for the 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value};EndpointSuffix=${suffix}' |
@anthony-c-martin Thanks a lot. That worked very well. |
@kzryzstof thanks for the extra detail. Without the // picked these values at random - I haven't checked which locations are available
var componentsLocations = {
cae1: 'Canada East'
cae2: 'Canada Central'
jpe1: 'Japan West'
}
resource applicationInsightsResource 'Microsoft.Insights/components@2020-02-02' = {
name: applicationInsightsName
location: componentsLocations[deploymentId]
kind: 'web'
properties: {
Application_Type: 'web'
}
} It's definitely more verbose, but there are also some benefits as it is declarative and not dynamic; you wouldn't have to worry about the location being changed out from underneath you if a particular provider decides to support a new region. This also makes it possible to understand by looking at the file how the region selection logic is going to work. Would that be a suitable solution for you? |
@anthony-c-martin This is what I will have to do indeed... for each resources in my deployment. That makes it pretty verbose considering the number of number resources spread across several services. I just had a look at the number of resources (for fun) and I -apparently- have 152 resources. Would it be possible still to consider having something similar to |
@kzryzstof - can you expand a bit on what you're trying to do with "failing over" locations? Typically what we see is that a deployment will target a particular location and then when Also, since // if the primary location is in the list below, this map will relocate it to a region where insights are available
var insightsLocationMap = {
germanynorth: 'germanywestcentral'
southafricawest: 'southafricanorth'
westcentralus: 'westus2'
westindia: 'centralindia'
} Then the resource code is: resource applicationInsightsResource 'Microsoft.Insights/components@2020-02-02' = {
name: applicationInsightsName
location: contains(insightsLocationMap, primaryLocation) ? insightsLocationMap[primaryLocation] : alternateLocation
kind: 'web'
properties: {
Application_Type: 'web'
}
} Just a variation on @anthony-c-martin's solution that is a bit more generic based on what we usually see for resources that are not available in every region. Another "simplification" of this it putting the location map in keyVault and then it doesn't need to be added to every file. I would go this route if you map all locations, then the syntax of That said - I'm interested in the overall scenario - if you're doing this for 152 resources, you probably don't need to... most resources are available globally and when they aren't, it's unlikely that one map would work for all resource types. E.g. different resources will have different Any of that help? |
@bmoore-msft You definitely have a good argument stating that most of the resources are available everywhere. Turns out I got hit twice with App insights and SignalR at the beginning of a rather small project. So I figured it would be easier to build the concept of fail-over in my ARM pipeline (and then Bicep) (that was almost 2 years ago). It looks like it would be fairly simple to apply your suggestion that would target only few resources then. Thank you very much; I really appreciate it :) |
We're currently using this construct to dynamically retrieve the principalId that is required in various settings:
This allows one to use the same pattern for system-assigned and user-assigned identities. For example:
Not sure how to accomplish the same thing if the providers function was completely removed. |
Successful run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4083622&view=results This PR introduces a new Azure DevOps pipeline that automatically lints all Bicep files in the repository and generates a report of any linting warnings. These reports are stored as artifacts and uploaded to Azure Blob Storage for tracking over time. ### Benefits - Automated Linting: Ensures that all Bicep files are consistently checked for best practices and potential issues. - Historical Tracking: By appending the date to the lint warnings file, we can monitor progress and improvements over time. ### Next Steps - Monitor the lint warnings reports over time to identify and address recurring issues. - Use the stored reports to guide refactoring efforts and improve Bicep code quality across the repository. ### Current warnings: ``` WARNING: /home/codespace/window3/sdk/textanalytics/test-resources.bicep(32,34) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/textanalytics/test-resources.bicep(33,38) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/formrecognizer/test-resources.bicep(60,41) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/formrecognizer/test-resources.bicep(61,157) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/formrecognizer/test-resources.bicep(62,155) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/formrecognizer/test-resources.bicep(63,184) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/translation/test-resources.bicep(67,42) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/storage/test-resources.bicep(294,29) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(295,33) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAccountSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(296,115) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(299,33) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(300,37) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAccountSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(301,127) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(304,45) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(305,49) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAccountSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(308,34) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(309,38) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAccountSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(310,124) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(313,41) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(314,45) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAccountSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(315,131) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(318,42) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(319,46) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAccountSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/storage/test-resources.bicep(320,139) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/mixedreality/test-resources.bicep(25,42) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/communication/test-resources/test-resources.bicep(28,49) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/communication/test-resources/test-resources.bicep(29,66) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/communication/test-resources/test-resources.bicep(31,50) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/communication/communication-email/test-resources.bicep(52,49) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/communication/communication-email/test-resources.bicep(53,66) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/communication/communication-email/test-resources.bicep(55,55) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/template/test-resources.bicep(29,45) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/remoterendering/test-resources.bicep(111,49) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/remoterendering/test-resources.bicep(112,57) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/remoterendering/test-resources.bicep(117,47) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/tables/test-resources.bicep(62,29) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/tables/test-resources.bicep(63,31) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAccountSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/tables/test-resources.bicep(64,133) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAccountSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/tables/test-resources.bicep(65,115) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/eventgrid/test-resources.bicep(139,47) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/cognitivelanguage/test-resources.bicep(153,34) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/cognitivelanguage/test-resources.bicep(154,38) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/eventhub/event-hubs/perf-resources.bicep(5,9) : Warning BCP334: The provided value can have a length as small as 3 and may be too short to assign to a target with a configured minimum length of 6. /home/codespace/window3/sdk/eventhub/event-hubs/perf-resources.bicep(13,12) : Warning BCP035: The specified "resource" declaration is missing the following required properties: "location". If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues] /home/codespace/window3/sdk/eventhub/event-hubs/perf-resources.bicep(23,44) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listkeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(11,39) : Warning no-hardcoded-env-urls: Environment URLs should not be hardcoded. Use the environment() function to ensure compatibility across clouds. Found this disallowed host: "core.windows.net" [https://aka.ms/bicep/linter/no-hardcoded-env-urls] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(16,5) : Warning decompiler-cleanup: The name of variable 'eventHubsNamespace_var' appears to have originated from a naming conflict during a decompilation from JSON. Consider renaming it and removing the suffix (using the editor's rename functionality). [https://aka.ms/bicep/linter/decompiler-cleanup] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(19,5) : Warning decompiler-cleanup: The name of variable 'storageAccount_var' appears to have originated from a naming conflict during a decompilation from JSON. Consider renaming it and removing the suffix (using the editor's rename functionality). [https://aka.ms/bicep/linter/decompiler-cleanup] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(22,5) : Warning no-unused-vars: Variable "eventHubsAuthRuleResourceId" is declared but never used. [https://aka.ms/bicep/linter/no-unused-vars] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(26,9) : Warning BCP334: The provided value can have a length as small as 3 and may be too short to assign to a target with a configured minimum length of 6. /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(36,9) : Warning use-parent-property: Resource "eventHubsNamespace_eventHubName" has its name formatted as a child of resource "eventHubsNamespace". The syntax can be simplified by using the parent property. [https://aka.ms/bicep/linter/use-parent-property] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(37,3) : Warning BCP187: The property "location" does not exist in the resource or type definition, although it might still be valid. If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(48,9) : Warning use-parent-property: Resource "eventHubsNamespace_eventHubName_eventHubAuthRuleName" has its name formatted as a child of resource "eventHubsNamespace_eventHubName". The syntax can be simplified by using the parent property. [https://aka.ms/bicep/linter/use-parent-property] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(66,5) : Warning BCP073: The property "tier" is read-only. Expressions cannot be assigned to read-only properties. If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(81,71) : Warning BCP081: Resource type "Microsoft.Authorization/roleAssignments@2019-04-01-preview" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed. /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(90,64) : Warning BCP081: Resource type "Microsoft.Authorization/roleAssignments@2019-04-01-preview" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed. /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(101,45) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listkeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(104,35) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listkeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(105,129) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(105,156) : Warning BCP241: The "providers" function is deprecated and will be removed in a future release of Bicep. Please add a comment to Azure/bicep#2017 if you believe this will impact your workflow. /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(107,42) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/eventhub/event-hubs/test/stress/stress-test-resources.bicep(107,69) : Warning BCP241: The "providers" function is deprecated and will be removed in a future release of Bicep. Please add a comment to Azure/bicep#2017 if you believe this will impact your workflow. WARNING: /home/codespace/window3/sdk/servicebus/test-resources.bicep(123,46) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/servicebus/test-resources.bicep(124,54) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/servicebus/test-resources.bicep(131,36) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/servicebus/service-bus/perf-resources.bicep(9,5) : Warning decompiler-cleanup: The name of variable 'authorizationRuleName_var' appears to have originated from a naming conflict during a decompilation from JSON. Consider renaming it and removing the suffix (using the editor's rename functionality). [https://aka.ms/bicep/linter/decompiler-cleanup] /home/codespace/window3/sdk/servicebus/service-bus/perf-resources.bicep(38,46) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/servicebus/service-bus/test/stress/stress-test-resources.bicep(9,5) : Warning decompiler-cleanup: The name of variable 'authorizationRuleName_var' appears to have originated from a naming conflict during a decompilation from JSON. Consider renaming it and removing the suffix (using the editor's rename functionality). [https://aka.ms/bicep/linter/decompiler-cleanup] /home/codespace/window3/sdk/servicebus/service-bus/test/stress/stress-test-resources.bicep(38,46) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/web-pubsub/test-resources.bicep(57,39) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/web-pubsub/test-resources.bicep(58,29) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/web-pubsub/test-resources.bicep(59,42) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/web-pubsub/test-resources.bicep(60,56) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/search/test-resources.bicep(19,38) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAdminKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/search/test-resources.bicep(20,42) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listAdminKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/maps/test-resources.bicep(43,39) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/documentintelligence/test-resources.bicep(64,47) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listKeys' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/documentintelligence/test-resources.bicep(65,168) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/documentintelligence/test-resources.bicep(66,161) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/documentintelligence/test-resources.bicep(67,187) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/documentintelligence/test-resources.bicep(68,189) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/documentintelligence/test-resources.bicep(69,179) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] /home/codespace/window3/sdk/documentintelligence/test-resources.bicep(70,186) : Warning outputs-should-not-contain-secrets: Outputs should not contain secrets. Found possible secret: function 'listServiceSas' [https://aka.ms/bicep/linter/outputs-should-not-contain-secrets] WARNING: /home/codespace/window3/sdk/healthdataaiservices/azure-health-deidentification/test-resources.bicep(21,7) : Warning no-unused-params: Parameter "deploymentTime" is declared but never used. [https://aka.ms/bicep/linter/no-unused-params] /home/codespace/window3/sdk/healthdataaiservices/azure-health-deidentification/test-resources.bicep(32,9) : Warning BCP334: The provided value can have a length as small as 0 and may be too short to assign to a target with a configured minimum length of 3. /home/codespace/window3/sdk/healthdataaiservices/azure-health-deidentification/test-resources.bicep(168,26) : Warning BCP081: Resource type "microsoft.healthdataaiservices/deidservices@2024-02-28-preview" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed. ``` --------- Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
The JSON template language has a providers() function that returns information from the /providers api at run-time. The most common (may only) use case I've seen for this is
providers().apiVersions[0]
and using that in a list*() function to supply an apiVersion for the POST. The problem this creates is that the function is not deterministic... the "first" apiVersion will change over time (which changes the shape of the response) and it also doesn't indicate "latest" which is a mistaken common understanding.
TLDR; use of the function will eventually break your code even though you didn't change anything.
The function should be deprecated in ARM, though that would be a harder breaking change. In Bicep we can prevent the problem before it starts.
If we don't allow the fn, and there are valid use cases for it, we can always add it.
The text was updated successfully, but these errors were encountered: