Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
You can easily connect Dapr APIs to backing Azure services using a combination of Service Connector and Dapr. This feature creates Dapr components on your behalf with valid metadata and authenticated identity to access the Azure service.
In this guide, you connect Dapr Pub/Sub API to an Azure Service Bus by:
Start by navigating to the Dapr component creation feature.
In the Azure portal, navigate to your Container Apps environment.
In the left-side menu, under Settings, select Dapr components.
From the top menu, select Add > Azure component to open the Add Dapr Component configuration pane.
Note
Currently, creating Dapr components using Service Connector in the Azure portal is in preview and only works with Azure services (Azure Service Bus, Azure Cosmos DB, etc.). To create non-Azure Dapr components (Redis), use the manual component creation option.
For the component creation tool to map to the required component metadata, you need to provide the required metadata from predefined dropdowns in the Basics tab.
For example, for a pub/sub Azure Service Bus component, you'll start with the following fields:
Field | Example | Description |
---|---|---|
Component name | mycomponent |
Enter a name for your Dapr component. The name must match the component referenced in your application code. |
Building block | Pub/sub | Select the building block/API for your component from the drop-down. |
Component type | Service Bus | Select a component type from the drop-down. |
The component creation pane populates with different fields depending on the building block and component type you select. For example, the following table and image demonstrate the fields associated with an Azure Service Bus pub/sub component type, but the fields you see may vary.
Field | Example | Description |
---|---|---|
Subscription | My subscription | Select your Azure subscription |
Namespace | mynamespace |
Select the Service Bus namespace |
Authentication | User assigned managed identity | Select the subscription that contains the component you're looking for. Recommended: User assigned managed identity. |
User assigned managed identity | testidentity |
Select an existing identity from the drop-down. If you don’t already have one, you can create a new managed identity client ID. |
What happened?
Now that you've filled out these required fields, they'll automatically map to the required component metadata. In this Service Bus example, the only required metadata is the connection string. The component creation tool takes the information you provided and maps the input to create a connection string in the component YAML file.
While the component creation tool automatically populates all required metadata for the component, you can also customize the component by adding optional metadata.
Select Next : Metadata + Scopes.
Under Metadata, select Add to select extra, optional metadata for your Dapr component from a drop-down of supported fields.
Under Scopes, select Add or type in the app IDs for the container apps that you want to load this component.
Select Review + Create to review the component values.
Select Create.
Once the component has been added to the Container Apps environment, the portal displays the YAML (or Bicep) for the component.
Copy and save the YAML file for future use.
Select Done to exit the configuration pane.
You can then check the YAML/Bicep artifact into a repo and recreate it outside of the portal experience.
Note
When using Managed Identity, the selected identification is assigned to all containers apps in scope and target services.
In your Container Apps environment, go to Settings > Dapr components.
The Dapr components that are tied to your Container Apps environment are listed on this page. Review the list and select the Delete icon to delete a component, or select a component's name to review or edit its details.
Learn how to set Dapr component resiliency.
Learn more about:
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Learning path
Connect your services together learning path - Training
Use Azure to create website front-ends, back-end services, and triggered functions that compute-on-demand and can also communicate with each other.
Certification
Microsoft Certified: Azure Developer Associate - Certifications
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.