-
Notifications
You must be signed in to change notification settings - Fork 340
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
[AVM Module Issue]: Output connectionstring of StorageAccount #2840
Comments
@tvriesde, thanks for submitting this issue for the Important A member of the @Azure/avm-res-storage-storageaccount-module-owners-bicep or @Azure/avm-res-storage-storageaccount-module-contributors-bicep team will review it soon! |
Hi @tvriesde the This is a working example: metadata name = 'Infrastructure for the smallestAzureDataplatform'
metadata description = 'This is the main entry point for the smallestAzureDataplatform'
targetScope = 'subscription'
param location string = 'northeurope'
param rgName string
param dlName string
param fnName string
param fnstgName string
param aspName string
param sqlServerName string
module rg 'br/public:avm/res/resources/resource-group:0.2.4' = { // Resource group to contain all resources
name: '${deployment().name}-resourceGroup'
params: {
name: rgName
location: location
}
}
module asp 'br/public:avm/res/web/serverfarm:0.2.2' = { // Hosting for the function app
name: '${deployment().name}-appServicePlan'
scope: resourceGroup(rgName)
dependsOn: [
rg
]
params: {
name: aspName
location: location
skuCapacity: 1
skuName: 'B1' // Can't use free tier because it doesn't support deployments from a package
reserved: true // Required for Linux
kind: 'Linux' // Needed for a python function app
}
}
module fnstg 'br/public:avm/res/storage/storage-account:0.9.1' = { // Storage account for the function app backend (where the function app triggers and logging functions is stored)
name: '${deployment().name}-functionStorage'
scope: resourceGroup(rgName)
dependsOn: [
rg
]
params: {
name: fnstgName
location: location
publicNetworkAccess: 'Enabled'
}
}
module fn 'br/public:avm/res/web/site:0.3.9' = { // Function app which will run the python code
name: '${deployment().name}-function'
scope: resourceGroup(rgName)
dependsOn: [
rg
asp
fnstg
]
params: {
name: fnName
location: location
kind: 'functionapp,linux'
serverFarmResourceId: asp.outputs.resourceId
siteConfig: {
pythonVersion: '3.11'
linuxFxVersion: 'python|3.11'
}
appSettingsKeyValuePairs: {
FUNCTIONS_WORKER_RUNTIME: 'python'
FUNCTIONS_EXTENSION_VERSION: '~4'
WEBSITE_RUN_FROM_PACKAGE: '1' // This is required to deploy the function app from a package (github cicd)
DATALAKE__serviceUri: dl.outputs.primaryBlobEndpoint // Required to have a storage account output binding in the function app
}
managedIdentities: {
systemAssigned: true // Creates a managed identity for the function app to access other azure resources
}
storageAccountResourceId: fnstg.outputs.resourceId // Backend storage account for the function app
storageAccountUseIdentityAuthentication: true // Required to be able to access the storage account without access keys
}
} |
Nice one, thanks @donheerschap. |
Warning Tagging the AVM Core Team (@Azure/avm-core-team-technical-bicep) due to a module owner or contributor having not responded to this issue within 3 business days. The AVM Core Team will attempt to contact the module owners/contributors directly. Tip
|
Thanks @donheerschap for chiming in.
@Agazoth was already so keen to start working on that for the storage account module as you can see here and finish the PR up once he's back from vacation. |
Check for previous/existing GitHub issues
Issue Type?
Feature Request
Module Name
avm/res/storage/storage-account
(Optional) Module Version
0.11.0
Description
When creating azure functions app it is required to submit the app setting AZUREWEBJOBSSTORAGE and provide connectionstring to the storage account. Currently i dont see a way how to create this connectionstring when using the module, as certain values are missing from the outputs.
missing values:
accountkey
endpointsuffix
better yet, it would be if the entire connection string could be as one output.
any tips on how to solve this when using the module are welcome.
(Optional) Correlation Id
No response
The text was updated successfully, but these errors were encountered: