You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding a resource using azd add, a single resource is created with a default name.
Example:
event-hubs for messaging.eventhubs.
The default name follows a hyphenated format.
Environment Variables:
Environment variables follow the format: AZURE_<TYPE>_<PROPERTY>. Unlike the type referenced in 1, underscores may be part of the name for variable naming clarity.
With messaging.eventhubs which stems from "Azure Event Hubs", AZURE_EVENT_HUBS_NAME represents the Event Hubs namespace.
When there are more than one types, an explicit environment variable mapping must be performed (which azd add can provide a default configuration modification that is used).
Common Properties
Suffix
Description
_HOST
Hostname, i.e. myaccount.blob.core.windows.net
_URL
URI reference , i.e. redis://
_ENDPOINT
HTTP URL , i.e. https://<vault-name>.vault.azure.net/
Environment variables follow the format: AZURE_<TYPE>_<PROPERTY>.
Given Convention 1, should <TYPE> here not contain any underscores? Do we expect to be able to parse out <TYPE> and <PROPERTY> from an environment variable name? Just wondering if there could be some ambiguity if both the type and property contain underscores.
Given Convention 1, should here not contain any underscores
There's definitely a point of confusion here, the environment variable naming should be stemmed from the official Azure resource naming.
I did made an explicit decision with this initial draft to have Types shortened for brevity and look closer to general programming language types, but for Environment variables to follow better standard environment variable naming conventions for clarity. I have updated the draft slightly to reflect this decision. Feel free to have a chat open for any thoughts here.
Do we expect to be able to parse out and from an environment variable name
This is a good point. In general, I don't believe this is done in practice -- the variables are just standard conventional environment variables of ALPHA_UPPER_SNAKE_CASE. The convention is to facilitate us leaning towards a standard practice, but we have no guarantees over machine operability. In areas of contention, I would lean towards favoring human readability here over machine operability.
!! WIP: Work in progress. This is a draft and does not represent final work.
General Conventions
Type Naming:
messaging.eventhubs
instead ofmessaging-eventhubs
.Default Resource Naming (simplified scaffolding scenarios):
azd add
, a single resource is created with a default name.event-hubs
formessaging.eventhubs
.Environment Variables:
AZURE_<TYPE>_<PROPERTY>
. Unlike the type referenced in 1, underscores may be part of the name for variable naming clarity.messaging.eventhubs
which stems from "Azure Event Hubs",AZURE_EVENT_HUBS_NAME
represents the Event Hubs namespace.azd add
can provide a default configuration modification that is used).Common Properties
_HOST
myaccount.blob.core.windows.net
_URL
redis://
_ENDPOINT
https://<vault-name>.vault.azure.net/
_PORT
333
Resource Definitions
Event Hubs
YAML Definition
Binding Environment Variables
AZURE_EVENT_HUBS_NAME
AZURE_EVENT_HUBS_HOST
Service Bus
YAML Definition
Binding Environment Variables
AZURE_SERVICE_BUS_NAME
AZURE_SERVICE_BUS_HOST
The text was updated successfully, but these errors were encountered: